non resolvable parent POM issue - maven

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).

Related

maven version plugin NPE

Hi I'm trying to execute
mvn versions:set -DgroupId=a304-b5c1d9177065 -DnewVersion=2.2.2
for my project with this pom.xml
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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>${groupId}</groupId>
<artifactId>mul-project-template-artifact</artifactId>
<version>1.0.0</version>
<packaging>mule-application</packaging>
<name>mul-project-template</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<app.runtime>4.3.0-20210119</app.runtime>
<mule.maven.plugin.version>3.4.2</mule.maven.plugin.version>
<groupId>com.company</groupId>
</properties>
mvn clean install
is working with build success
but
mvn versions:set -DgroupId=a304-b5c1d9177065 -DnewVersion=2.2.2
returns
ERROR] Failed to execute goal org.codehaus.mojo:versions-maven-plugin:2.1:set (default-cli) on project logger-connector-artifact: Execution default-cli of goal org.codehaus.mojo:versions-maven-plugin:2.1:set failed.: NullPointerException -> [Help 1]
Working with latest version also shows same exception
ERROR] Failed to execute goal org.codehaus.mojo:versions-maven-plugin:2.8.1:set (default-cli) on project logger-connector-artifact: Execution default-cli of goal org.codehaus.mojo:versions-maven-plugin:2.8.1:set failed.: NullPointerException -> –
I also have this warning
[WARNING] 'groupId' contains an expression but should be a constant. # ${groupId}:logger-connector-artifact:1.0.0, /home/jenkins/agent/workspace/ine_logger-connector_development/pom.xml, line 5, column 11 [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.

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

how to build a war file using maven in eclipse for play framework2.5?

i am doing build war file using maven in eclipse for play 2.5.4 project
for that
it shows error like
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project play: Compilation failure
[ERROR] /C:/play/app/filters/ExampleFilter.java:[40,20] lambda expressions are not supported in -source 1.5
[ERROR] (use -source 8 or higher to enable lambda expressions)
[ERROR] -> [Help 1]
[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/MojoFailureException
You're using or forcing JDK 5 but you need JDK 8 : http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
EDIT
To create WAR instead of JAR, add this to your pom :
<packaging>war</packaging>
Example :
<?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>com.example</groupId>
<artifactId>hello-world</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
...
</project>

Maven failed to execute goal org.apache.maven.plugins:maven-jar-plugin

Like below, I had an error when running mvn package
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:2.3.1:jar (default-jar) on project hello-world: Execution default-jar of goal org.apache.maven.plugins:maven-jar-plugin:2.3.1:jar failed: Unable to load the mojo 'jar' in the plugin 'org.apache.maven.plugins:maven-jar-plugin:2.3.1'. A required class is missing: org/codehaus/plexus/components/io/resources/PlexusIoResourceCollection
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.maven.plugins:maven-jar-plugin:2.3.1
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/maven/repository/org/apache/maven/plugins/maven-jar-plugin/2.3.1/maven-jar-plugin-2.3.1.jar
[ERROR] urls[1] = file:/C:/maven/repository/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] urls[2] = file:/C:/maven/repository/org/apache/maven/maven-archiver/2.4.1/maven-archiver-2.4.1.jar
[ERROR] urls[3] = file:/C:/maven/repository/org/codehaus/plexus/plexus-archiver/1.0/plexus-archiver-1.0.jar
[ERROR] urls[4] = file:/C:/maven/repository/commons-lang/commons-lang/2.1/commons-lang-2.1.jar
[ERROR] urls[5] = file:/C:/maven/repository/org/codehaus/plexus/plexus-utils/2.0.5/plexus-utils-2.0.5.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: org.codehaus.plexus.components.io.resources.PlexusIoResourceCollection
[ERROR] -> [Help 1]
[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/PluginContainerException
This is my pom.xml. I got rid of unnecessary things, but still it didn't work..
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>sds.jetty.simple</groupId>
<artifactId>hello-world</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>Jetty HelloWorld</name>
<properties>
<jettyVersion>8.1.2.v20120308</jettyVersion>
</properties>
<dependencies>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>${jettyVersion}</version>
</dependency>
</dependencies>
<build>
</build>
</project>
Try to remove to folder
.m2\repository\org\apache\maven\plugins\maven-jar-plugin
on your file system. Your plugin jar might be corrupted.
If this does not work, try to remove the jetty-server folder (same reason)
I met similar issue once. It turned out to be a maven 3 issue. After switching to maven 2.2.1 my build ran fine.
Even faced this issue. It will be resolved by just deleting the .m2/repository folder and build the Project again.
It is working for me for your example POM file, the problem should be somewhere else.
Are you sure there is no connection problems there? Your antivirii software doesn't prevents you downloading artifacts? Isn't an entry in your local repository corrupted?
Thats an unresolved issue in Maven 3.3.1 and 3.3.3; https://issues.apache.org/jira/browse/MNG-5787
I upgraded to 3.3.9 and things started working.
i recently encountered the issue and i just need to remove the folders from .m2/repository and rerun the pom. it worked.
1.I will suggest you to delete the .m2 folder completely
2.Then do maven -> Update Project.
3.Maven Install
I have had the same error using the maven version 3.6.3. In my case, it is not an issue with maven. But I have a very large size folder (5 GB) copied inside the src/resource folder unusually. After removing the junk folder, everything worked normally.
Compiling with Java 8 instead of Java 6 has solved the problem in my case.
For us this was caused when Eclipse / Maven automatically changed our JDK to 1.5 (from 1.8). Manually changing back to 1.8 fixed the issue.
There should be some issue within the dependencies which maven can't resolve on the fly.
try running this command on your project root.
mvn dependency:tree
this should resolve all the dependency issues and help you run with the appliction

Resources