Child project not finding parent with relativePath - maven

I've create a project parent used to manage dependencies and version in child projects, see the pom.xml
<groupId>myCompany</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
Than, i created a child project, that inherited from the parent, see the pom.xml
<parent>
<groupId>myCompany</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<artifactId>filrstChild</artifactId>
<name>filrst Child</name>
Note the two project are in the same folder
group :
parent
firstChild
PS :
the child projects are already exists before parent, so the architecture is not from scratch, that why i didn't use the standard way to created parent & modules
with gitlab-ci i'm trying to build the firstChild, after building parent
So, parent build correctly, but firstChild is not building
this is my gitlab-ci on firstChild
image: appinair/jdk11-maven
variables:
MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode"
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
cache:
paths:
- target/
build:
stage: build
script:
- mvn $MAVEN_CLI_OPTS clean install -Dmaven.test.skip=true -Dmaven.javadoc.skip=true
artifacts:
paths:
- target/
- .m2/repository/
And this is the error that i got after building firstChild
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for myCompany:firstChild:[unknown-version]: Could not find artifact myCompany:parent:pom:1.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM # line 5, column 10
#
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project myCompany:firstChild:[unknown-version] (/builds/compiere-ws/firstChild/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for myCompany:firstChild:[unknown-version]: Could not find artifact myCompany:parent:pom:1.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM # line 5, column 10 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
ERROR: Job failed: exit code 1
So, any idea ?
PS:
Note that the firstChild build correctly in my local server or with jenkins, it's not building only with gitlab-ci

Related

Unable to build Artifactory OSS 7.15 from source

I was trying to compile JFrog Artifactory from source code, but I ran into a maven issue.
Here are my steps:
Download the latest source from https://releases.jfrog.io/artifactory/bintray-artifactory/org/artifactory/oss/jfrog-artifactory-oss/7.17.5/jfrog-artifactory-oss-7.17.5-sources.tar.gz
Unzip it and run mvn clean install in the root directory
Get an error
This is the error I got:
PS C:\Users\mTrachoz\Desktop\jfrog-artifactory-7.17.5> mvn clean install
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.artifactory:artifactory-parent:7.17.5: Failure to find org.jfrog.common:jfrog-parent-pom:pom:7.17.2 in http://jcenter.bintray.com 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 wrong local POM # line 22, column 13
#
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.artifactory:artifactory-parent:7.17.5 (C:\Users\mTrachoz\Desktop\jfrog-artifactory-7.17.5\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for org.artifactory:artifactory-parent:7.17.5: Failure to find org.jfrog.common:jfrog-parent-pom:pom:7.17.2 in http://jcenter.bintray.com 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 wrong local POM # line 22, column 13 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

Oozie Installation error-bin/mkdistro.sh -DskipTests

hduser#kas-XX:/usr/lib/Oozie/oozie-4.3.0$ bin/mkdistro.sh -DskipTests
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
Downloading from central: http://repo1.maven.org/maven2/org/apache/apache/17/apache-17.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.apache.oozie:oozie-main:4.3.0: Could not transfer artifact org.apache:apache:pom:17 from/to central (http://repo1.maven.org/maven2): Failed to transfer file: http://repo1.maven.org/maven2/org/apache/apache/17/apache-17.pom. Return code is: 501 , ReasonPhrase:HTTPS Required. and 'parent.relativePath' points at wrong local POM # line 21, column 13
#
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.apache.oozie:oozie-main:4.3.0 (/usr/lib/Oozie/oozie-4.3.0/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for org.apache.oozie:oozie-main:4.3.0: Could not transfer artifact org.apache:apache:pom:17 from/to central (http://repo1.maven.org/maven2): Failed to transfer file: http://repo1.maven.org/maven2/org/apache/apache/17/apache-17.pom. Return code is: 501 , ReasonPhrase:HTTPS Required. and 'parent.relativePath' points at wrong local POM # line 21, column 13 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
ERROR, Oozie distro creation failed
Version Information:
Hadoop 3.1.2,
openjdk version "11.0.5" ,
Apache Maven 3.6.0
Maven home: /usr/share/maven
Java version: 11.0.5, vendor: Private Build, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en_IN, platform encoding: UTF-8
OS name: "linux", version: "5.3.0-26-generic", arch: "amd64", family: "unix",
Ubuntu 18.04
{personal hadoop environment and single node}

Maven's Non-Resolvable Parent POM Problem

We have downloaded the Project "https://bitbucket.org/m2m/cumulocity-clients-java/src/develop/" and try to run the project the project but we have the following issue :
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.nsn.cumulocity.clients-java:clients-java:9.19.1-SNAPSHOT: Failure to find com.nsn.cumulocity.root:root:pom:9.19.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 wrong local POM # line 5, column 10
#
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.nsn.cumulocity.clients-java:clients-java:9.19.1-SNAPSHOT (D:\Projects\Dormakaba\Code\Test-Code\cumulocity\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for com.nsn.cumulocity.clients-java:clients-java:9.19.1-SNAPSHOT: Failure to find com.nsn.cumulocity.root:root:pom:9.19.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 wrong local POM # line 5, column 10 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
My Main POM.XML
http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
<parent>
<groupId>com.nsn.cumulocity.root</groupId>
<artifactId>root</artifactId>
<version>9.19.0</version>
<relativePath>/pom.xml</relativePath>
</parent>
<groupId>com.nsn.cumulocity.clients-java</groupId>
<artifactId>clients-java</artifactId>
<packaging>pom</packaging>
<version>9.19.1-SNAPSHOT</version>
<name>Cumulocity :: Clients Java</name>
<url>http://startups.jira.com/wiki/display/MTM/Home</url>
<scm>
<connection>scm:hg:ssh://hg#bitbucket.org/m2m/cumulocity-clients-java</connection>
<tag>HEAD</tag>
</scm>
<modules>
<module>device-capability-model</module>
<module>java-client</module>
<module>java-me-client</module>
<module>java-me-client-test</module>
<module>java-me-maven-plugin</module>
<module>java-me-smartrest</module>
<module>java-email-client</module>
<module>java-sms-client</module>
<module>java-client-services</module>
</modules>
...................
Best regards, Manoj
Like the error message states, your Parent Pom is not found in the Remote Repository and neither in your local Repository nor in the given relative Path.
Put the Parent Pom in the correct location and all should be fine.
EDIT: The description of this project states, that you do need to add their own repo.
https://bitbucket.org/m2m/cumulocity-clients-java

Failure to find project in Maven repository

I have a Maven module with a submodule.
The relevant part of the parent is this:
<groupId>my.package.name</groupId>
<artifactId>parent-module</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>my.package.name</name>
<modules>
<module>child-module</module>
</modules>
The relevant part of the child is:
<groupId>my.package.name</groupId>
<artifactId>child-module</artifactId>
<version>1.0-SNAPSHOT</version>
<name>my.package.name</name>
<parent>
<groupId>my.package.name</groupId>
<artifactId>parent-module</artifactId>
<version>1.0</version>
<relativePath>../pom.xml</relativePath> <!-- not necessary -->
</parent>
For this, I'm getting:
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for my.package.name:child-module:1.0-SNAPSHOT: Failure to find my.package.name:parent-module:pom:1.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 wrong local POM # line 11, column 13
#
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project my.package.name:child-module:1.0-SNAPSHOT (/path/to/parent-module/child-module/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for my.package.name:child-module:1.0-SNAPSHOT: Failure to find my.package.name:parent-module:pom:1.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 wrong local POM # line 11, column 13 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
The XML files are located at:
/parent-module/child-module/pom.xml
/parent-module/pom.xml
So why is it trying to find the parne module in the online Maven repository?
Why doesn't see it locally?
Failure to find my.package.name:parent-module:pom:1.0
Your parent version is <version>1.0-SNAPSHOT</version>, but in the child pom.xml parent version is <version>1.0</version> make it same
Try to execute:
mvn -U clean install
Using Maven's -U Command Line Option

Maven fails building CAS server

I am trying to implement SSO feature and downloaded all projects and pom.xml from http://www.jasig.org/cas/download.
So, I got my maven project and then In eclipse I just did import as existing maven project.
then I Run the project as MVN CLEAN and it is not running and getting error as
[INFO] Scanning for projects...
Downloading: http://developer.ja-sig.org/maven2/org/jasig/parent/jasig-parent/21/jasig-parent-21.pom
Downloading: http://repository.jboss.org/nexus/content/groups/public-jboss/org/jasig/parent/jasig-parent/21/jasig-parent-21.pom
Downloading: http://repo.maven.apache.org/maven2/org/jasig/parent/jasig-parent/21/jasig-parent-21.pom
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.jasig.cas:cas-server:3.5.0 (D:\CAS\Single Sign On\cas-server-3.5.0-release\cas-server-3.5.0\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Could not transfer artifact org.jasig.parent:jasig-parent:pom:21 from/to jasig-repository (http://developer.ja-sig.org/maven2): null to http://developer.ja-sig.org/maven2/org/jasig/parent/jasig-parent/21/jasig-parent-21.pom and 'parent.relativePath' points at wrong local POM # line 22, column 11: UnresolvedAddressException -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
some one told that it is proxy problem, so i changed settings.xml file to place proxy as
<proxy>
<id>123</id>
<active>true</active>
<protocol>http</protocol>
<username>abc.def#xyz.com</username>
<password>xyz1233</password>
<host>proxy.com</host>
<port>80</port>
<nonProxyHosts>google.com</nonProxyHosts>
</proxy>
still it is not running, can someone please pointout mistake?
Why not downloading jasig-parent from Maven central instead ?

Resources