Maven Project Relative Path error

Asked

Viewed 1,041 times

1

I have to maintain a system in java with Maven. However the system has 3 projects where one refers to the other, I tried to change the build path adding projects and etc. So far nothing below follows the file pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>br.org.MyCompany</groupId>
    <artifactId>inscricoes-cursos-backend</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>war</packaging>
    <name>inscricoes-backend</name>
    <parent> <!-- esta apresentando erro aqui nesta linha -->
        <groupId>com.oracle.weblogic.archetype</groupId>
        <artifactId>wls-common</artifactId>
        <version>12.1.3-0-0</version>
        <relativePath></relativePath>
    </parent>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-web-api</artifactId>
            <version>6.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-mapper-asl</artifactId>
            <version>1.9.13</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-jaxrs</artifactId>
            <version>1.9.13</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/javax.ws.rs/javax.ws.rs-api -->
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
            <version>2.0</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <version>2.8.5</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>2.8.5</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.8.5</version>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.6</version>
        </dependency>
        <dependency>
            <groupId>br.org.MyCompany</groupId>
            <artifactId>gerador-boleto</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>br.org.MyCompany</groupId>
            <artifactId>gerador-boleto</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
    </dependencies>
    <build>
        <finalName>inscricoes-cursos-backend</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.1.1</version>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.oracle.weblogic</groupId>
                <artifactId>weblogic-maven-plugin</artifactId>
                <version>12.1.3-0-0</version>
                <!-- You can find and redefine the following variables in the parent 
                    pom file. oracleMiddlewareHome oracleServerUrl oracleUsername oraclePassword 
                    oracleServerName -->
                <configuration>
                    <middlewareHome>${oracleMiddlewareHome}</middlewareHome>
                </configuration>
                <executions>
                    <!--Deploy the application to the server -->
                    <execution>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>deploy</goal>
                        </goals>
                        <configuration>
                            <user>******</user>
                            <password>*****</password>                  <source>${project.build.directory}/${project.build.finalName}.${project.packaging}</source>
                            <target>ms_2</target>
                            <verbose>true</verbose>
                            <name>${project.build.finalName}</name>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

The error showing on the line of parent says the following.

"Project build error: Non-resolvable Parent POM for br.org.Mycompany:registration-courses-backend:1.0-SNAPSHOT: Failure to find com.oracle.Weblogic.archetype:wls-common:pom: 12.1.3-0-0 in https://repo.maven.apache.org/maven2 was cached in the local Repository, Resolution will not be reattempted until the update interval of central has Elapsed or updates are Forced and 'Parent.relativePath' points at no local POM"

I think you have to change something in that folder .M2 but I don’t know what.

probably run a command similar to that:

mvn install:install-file -DpomFile=oracle-maven-sync-12.1.3.pom -Dfile=oracle-maven-sync-12.1.3.jar -DoracleHome=/Users/edwin/Oracle/JDevMiddleware12.1.3 

I have no idea what that command is doing so I don’t know what to change in it if that’s what it is.

  • This group parent indicates that your project, is inheriting project features com.oracle.weblogic.archetype:wls-common. The error means that this project is not being found in the maven that you’re using. I don’t know what this archetype is about. Giving a "googled", appears something like: https://docs.oracle.com/middleware/1212/wls/WLPRG/maven.htm#WLPRG585. It seems a good starting point. Before you start servicing any system, I recommend you at least try to understand what it is.

1 answer

2

OK thanks staff I found a solution to my problem basically was to manually install the plugins of Weblogic 12.1.3, below a full description of how I did it in case someone goes through this same situation.

First of all I configured the environment variables of Maven: M2_HOME as below.(C:\Program Files\Maven\apache-maven-3.5.0 <-- where my Maven is installed)

maven variaveis de ambiente

So I used the variable created in the path variable as below (process very similar to the configuration of the java environment variables)

maven path

I can now use the mvn command at the command prompt

then I went to the folder C:\oracle\Middleware\Oracle_Home\oracle_common\plugins\maven\com\oracle\maven\oracle-maven-sync\12.1.3 (This is where my Weblogic is installed, so I circled the commands below)

mvn install:install-file -DpomFile=oracle-maven-sync-12.1.3.pom -Dfile=oracle-maven-sync-12.1.3.jar

mvn com.oracle.maven:oracle-maven-sync:push -Doracle-maven-sync.oracleHome=C:\oracle\Middleware\Oracle_Home -DoverwriteParent=true

mvn help:describe -DgroupId=com.oracle.weblogic -DartifactId=weblogic-maven-plugin -Dversion=12.1.3-0-0

special attention to the second command where you have to use the oracle home which can be in different places for each case.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.