Failure to find project in Maven repository - maven

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

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

Child project not finding parent with relativePath

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

Maven Project Failed to Build in Eclipse

I created a demo maven project from start.spring.io, and I tried to run mvn clean package from Eclipse, but it gave me the following error:
[INFO] Scanning for projects...
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/2.0.6.RELEASE/spring-boot-starter-parent-2.0.6.RELEASE.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.example:demo:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.0.6.RELEASE from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org and 'parent.relativePath' points at no local POM # line 14, column 10
#
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.example:demo:0.0.1-SNAPSHOT (C:\Development\demo\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for com.example:demo:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.0.6.RELEASE from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org and 'parent.relativePath' points at no local POM # line 14, column 10: Unknown host repo.maven.apache.org -> [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
Picked up JAVA_TOOL_OPTIONS: -agentpath:"C:\Windows\system32\Aternity\Java\JavaHookLoader.dll"="C:\ProgramData\Aternity\hooks"
Anyone knows the problem? Thanks in advance.
Problem is solved by adding the settings.xml in the .m2 folder.

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

non resolvable parent POM issue

Hi i am having a strange issue building a maven project on a my machine.
Their does not seem to be an issue with the pom file or code as the exact same project can be succesfully built on another workstation.
the error i receive is this
The project com.jonney:jon-app-parent:1.3.9 (/Users/me/Work/jon-app-paren/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Failure to find com.jonney-parent:pom:3 in http://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 6, 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
here is a snippet of my pom file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>com.jonney-parent</artifactId>
<name>Jon SDK java</name>
<packaging>jar</packaging>
<parent>
<groupId>com.jonney</groupId>
<artifactId>com.jonney-parent</artifactId>
<version>1.3.9</version>
<relativePath>../pom.xml</relativePath>
</parent>
Try calling Maven with "-U" option (force update of dependencies).

Resources