How to solve non-resolvable parent pom.xml error? - java

Maven goal fails letting us know the parent pom.xml is not resolvable. Any ideas on how to fix this?
[ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.opencastproject:opencast-engage-paella-player:7-SNAPSHOT: Could not find artifact org.opencastproject:base:pom:7-SNAPSHOT and 'parent.relativePath' points at wrong local POM # line 7, column 11

There is no 7-SNAPSHOT at Maven repository. Check out https://mvnrepository.com/artifact/org.opencastproject/opencast-engage-paella-player

Related

How to resolve central.maven.org: Unknown host central.maven.org in Maven Project?

Please find the below logs :
[ERROR] Failed to execute goal on project hospital: Could not resolve dependencies for project
com.project_name.test.web:hospital:war:0.0.1-SNAPSHOT: Failed to collect dependencies at
com.example.test:example-child:jar:1.1.12-SNAPSHOT: Failed to read artifact descriptor for
com.example.test:example-child:jar:1.1.12-SNAPSHOT: Could not transfer artifact
com.example.test:example-parent:pom:1.1.12-SNAPSHOT from/to maven-central
(http://central.maven.org/maven2/): central.maven.org: Unknown host central.maven.org -> [Help 1]
Thanks in advance!
This failes likely due to an artifact downloaded earlier (in my case .m2/repository/org/geotools/geotools/19.1/geotools-19.1.pom) containing this as a specific repo, maybe even retrieved from a thirdparty repo.
Check your local artifacts for references to the repository, e.g. by this brute force approach:
grep -nr "central.maven.org" ~/.m2/repository/
Replacing/removing the dependency solved the issue.

Project build error: Non-resolvable parent POM cannot find repository

The company gave me a project on data compressor, I have to run the project and reduce it's compression ratio.
To run the project i downloaded all the repositories using maven. But the POM file is giving an error as:
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.influxdb:influxdb-java:jar -> version 1.5 vs 2.4 # line 254, column 16
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: log4j:log4j:jar -> duplicate declaration of version 1.2.17 # line 264, column 22
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.apache.commons:commons-math3:jar -> duplicate declaration of version 3.6.1 # line 302, column 18
[FATAL] Non-resolvable parent POM for teevr-apps-dataxlrator:teevr-dataxlrator:1.1.15: Failure to find teevr-apps:parent-root:pom:1.0.0 in https://repo.eclipse.org/content/repositories/californium/ was cached in the local repository, resolution will not be reattempted until the update interval of repo.eclipse.org has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM # line 11, column 10
#
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project teevr-apps-dataxlrator:teevr-dataxlrator:1.1.15 (E:\Ubuntu\dataxlrator-master\dataxlrator\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for teevr-apps-dataxlrator:teevr-dataxlrator:1.1.15: Failure to find teevr-apps:parent-root:pom:1.0.0 in (same link as above) was cached in the local repository, resolution will not be reattempted until the update interval of repo.eclipse.org has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM # line 11, 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:
i ran this project as maven build in eclipse neon.
This is my first question on this site so please forgive me for the inconvenience caused in analyzing my problem.
I think you would find every thing in the project link itself but if I missed something please let me know.
You have duplicated the dependencies in your POM, leave only one for each.
org.influxdb:influxdb-java
log4j:log4j
org.apache.commons:commons-math3

Depends on other local module

I have two modules and one links the other one. When I install the second one the build failed saying me 'Could not find artifact'. Here's poms:
<groupId>xyz.upperlevel.graphicengine</groupId>
<artifactId>graphicengine</artifactId>
<packaging>pom</packaging>
<version>FINAL</version>
<modules>
<module>graphicengine-api</module>
<module>gamelauncher</module>
<module>testgame</module>
</modules>
This is the pom of the main project.
Then here's the pom of one of its modules (are all the equal):
<parent>
<groupId>xyz.upperlevel.graphicengine</groupId>
<artifactId>graphicengine</artifactId>
<version>FINAL</version>
</parent>
<groupId>xyz.upperlevel.graphicengine.testgame</groupId>
<artifactId>testgame</artifactId>
<version>1.0-SNAPSHOT</version>
I have the module A that links to the module B all inside the MAIN project. When I build the module A all goes fine (since it has no dependency from local modules) but when I build the module B it failed. This is the error:
Failed to execute goal on project gamelauncher: Could not resolve dependencies for project xyz.upperlevel.graphicengine.gamelauncher:gamelauncher:jar:1.0-SNAPSHOT: Failed to collect dependencies at xyz.upperlevel.graphicengine.api:graphicengine-api:jar:1.0-SNAPSHOT: Failed to read artifact descriptor for xyz.upperlevel.graphicengine.api:graphicengine-api:jar:1.0-SNAPSHOT: Failure to find xyz.upperlevel.graphicengine:graphicengine:pom:FINAL 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 -> [Help 1]
How to solve?
Do you use the right coordinates of your artifacts? Maven should have created the repository automatically. See https://maven.apache.org/guides/introduction/introduction-to-repositories.html for more informations on repositories. For a detailed spec for artifacts and dependencies see https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html.
To be able to help you in a better way, please provide some code.
I HAVE SOLVED: I WAS BUILDING FROM MODULES PATH AND INSTEAD OF BUILDING FROM ROOT PROJECT PATH! DON'T FALL IN MY SAME ERROR!

How to make Maven Versions Plugin update-parent goal work with multi-module project

I'm using version 2.1 of the versions-maven-plugin.
I have a source tree like the following:
+-- JavaProjects
+-- customs-deployment-support
+-- pom.xml
+-- pom.xml (a.k.a. base-parentpom)
+-- Projects
+-- customs-template
+-- pom.xml
+-- customs-ear-template
+-- pom.xml
+-- customs-rpm-template
+-- pom.xml
+-- customs-site-template
+-- pom.xml
+-- pom.xml (a.k.a. customs-parentpom)
Now above, the <parent /> for the customs-template project is customs-deployment-support. The <parent /> for all the other customs-*-template projects is base-parentpom.
Note: the customs-parentpom is just an "aggregator" and is not the real parent for any customs module, but it does declare each customs-* project as a <module /> in its <modules /> section.
For SNAPSHOT version builds this works great.
Now, I want to move to versioned artifacts where each artifact's version signature is something like x.x.x_yyyyMMddhhmm_nn.
So, now I want to employ the versions-maven-plugin to build the customs-parentpom (or "aggregator" pom.xml)
I use Jenkins for builds. So I configure a pre-step to jigger the versions within the <parent /> section of each customs project with something like:
mvn versions:update-parent
I want it to find the latest upstream artifacts (i.e., base-parentpom and customs-parentpom) available in Nexus.
But it fails with...
[ERROR] The build could not read 4 projects -> [Help 1]
[ERROR]
[ERROR] The project com.etse:etse-customs-template:3.1.0-SNAPSHOT (/var/lib/jenkins/jobs/ETSE-trunk-AllCustoms/workspace/customs-template/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Failure to find com.etse:etse-customs-deployment-support:pom:3.1.0-SNAPSHOT in http://repository.jboss.org/nexus/content/groups/public-jboss/ was cached in the local repository, resolution will not be reattempted until the update interval of jboss-public-repository-group has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM # line 5, column 11 -> [Help 2]
[ERROR]
[ERROR] The project com.etse:etse-customs-ear-template:3.1.0-SNAPSHOT (/var/lib/jenkins/jobs/ETSE-trunk-AllCustoms/workspace/customs-ear-template/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Failure to find com.etse:etse-parentpom:pom:3.1.0-SNAPSHOT in http://repository.jboss.org/nexus/content/groups/public-jboss/ was cached in the local repository, resolution will not be reattempted until the update interval of jboss-public-repository-group has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM # line 5, column 10 -> [Help 2]
[ERROR]
[ERROR] The project com.etse:etse-customs-rpm-template:3.1.0-SNAPSHOT (/var/lib/jenkins/jobs/ETSE-trunk-AllCustoms/workspace/customs-rpm-template/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Failure to find com.etse:etse-parentpom:pom:3.1.0-SNAPSHOT in http://repository.jboss.org/nexus/content/groups/public-jboss/ was cached in the local repository, resolution will not be reattempted until the update interval of jboss-public-repository-group has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM # line 5, column 10 -> [Help 2]
[ERROR]
[ERROR] The project com.etse:etse-customs-site-template:3.1.0-SNAPSHOT (/var/lib/jenkins/jobs/ETSE-trunk-AllCustoms/workspace/customs-site-template/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Failure to find com.etse:etse-parentpom:pom:3.1.0-SNAPSHOT in http://repository.jboss.org/nexus/content/groups/public-jboss/ was cached in the local repository, resolution will not be reattempted until the update interval of jboss-public-repository-group 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
Consider that I never want Jenkins to produce a SNAPSHOT version artifact in the above case. I realize that the SNAPSHOT is not available in the local .m2 repository. Do I (really) need one in order for the versions plugin to resolve correctly?
What am I doing wrong? Is it even possible to do what I'm trying to do? I'm willing to share pom.xml files if that will help.
So this was just a misunderstanding on my part. If you employ a multi-module setup, you need to make sure that when you check-out your source, in order to build a module it must be able to trace its path back to a parent (via <relativePath />).
I was checking out a module, but not its parent; therefore I was getting the the non-resolvable parent POM errors.
So, in order for the reactor to do its part, you need to define all modules in the aggregator (and/or parent) pom.xml.
Then you can build a single (or multiple) modules (projects) like so
mvn clean install --projects <project1>,<project2> --amd

Maven build of Saiku open source project fails second time after no changes

I was doing a build yesterday for the second time of an open source project (Saiku) – I have made no changes to the POM.XML or any of the libraries/jars. The build succeeded a few days ago but now fails. The following pastebin shows the output. The errors are of two types – failure to delete /clean project, and cannot find artifact. Does anyone have any troubleshooting tips?
http://pastebin.com/g2bpAtMS
error type 1
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean (default-clean) on project saiku-core: Failed to clean project: Failed to delete /usr/local/.m2/repository/saiku/saiku-core/target/javadoc-bundle-options/javadoc-options-javadoc-resources.xml
error Type 2
- [ERROR] The build could not read 1 project -> [Help 1]
- [ERROR] The project org.saiku:saiku-webapp:2.2-SNAPSHOT (/usr/local/.m2/repository/saiku/saiku-webapp/pom.xml) has 1 error
- [ERROR] Non-resolvable parent POM: Could not find artifact org.saiku:saiku-core:pom:2.2-SNAPSHOT and 'parent.relativePath' points at wrong local POM # line 3, column 10 -> [Help 2]
Are you building within your local repo? That would be bad.
I get similar errors because, I think, my virus checker locks a file underneath the target/ directory and clean cannot delete the directory. I delete the directory manually and resume the build.
Failed to delete /usr/local/.m2/repository/saiku/saiku-core/target/javadoc-bundle-options/javadoc-options-javadoc-resources.xml
You have locked this file. Close every program which could have opened it.
Failed to delete /usr/local/.m2/repository/saiku/saiku-ui/target/classes/routers/QueryRouter.js
Idem for this file.
/usr/local/.m2/repository/saiku/saiku-server/target/saiku-server-foodmart-2.2-SNAPSHOT.tar.gz
Idem for this file.
Could not find artifact org.saiku:saiku-core:pom:2.2-SNAPSHOT and 'parent.relativePath' points at wrong local POM
It seems you have changed something : Maven does not find the parent pom referenced by relativePath attribute.
Check these errors, you always many errors.
I've fixed that by setting relativePath in pom.xml of saiku-webapp:
<parent>
<artifactId>saiku-core</artifactId>
<groupId>org.saiku</groupId>
<version>2.6-SNAPSHOT</version>
<relativePath>../saiku-core/pom.xml</relativePath>
</parent>

Categories

Resources