False compile error during mvn release:perform says invalid pom while pom is fine and code compiles - maven-release-plugin

While trying to release new version of our-test-tools project I get:
1. Warning on invalid POM
[WARNING] The POM for org.synyx.hades:org.synyx.hades:jar:1.6.3.RELEASE-2 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
2. Compilation error
COMPILATION ERROR: [...] package org.springframework.jdbc.datasource
does not exist
However!
There's no compile error in our-test-tools and synyx's POM is valid.
Following works (Maven reports success):
mvn install also with -o on project I'm trying to release
mvn release:prepare
mvn install on checked out project (check out done by mvn release:perform itself)
mvn verify or mvn help:effective-pom on synyx project
Following did not help:
cleaning local repository
updating dependent project to make preferred Maven profile active
-e and -X switches - I found no clues
Any ideas what can be wrong or what can I try?
Further info:
SCM = Git.
**our-test-tools* project POM: http://pastebin.com/vkaXshhL

Related

mvn site fails due to dependency resolution

I want to run the site lifecycle after an mvn verify, but it fails.
to be precise:
mvn versions:set -DnextSnapshot=true
mvn install
mvn site
# works
mvn versions:set -DnextSnapshot=true
mvn verify
mvn site
# fails
The project is a bom-based multimodule project consisting of:
pom.xml - root bom
modules/pom.xml - has pom.xml as parent
modules/ci-lib/pom.xml - has modules/pom.xml as parent - library project
modules/ci-main/pom.xml - has modules/pom.xml as parent - uses the library project
for more details, see https://github.com/helt/ez-ci
Error details are quite obvious (mvn -X), but I wonder why the dependency resolution does not look into the project artifacts itself...
[DEBUG] Could not find metadata de.fhg.igd.iva.examples:ci-lib:1.0.3-SNAPSHOT/maven-metadata.xml in local (C:\Users\foobar\.m2\repository)
Is there a way to tell maven-site-plugin to look up all information in the respective target/ directories of this project? Any other idea how to fix it is also appreciated...

Could not resolve dependencies for project spmf ca.pfv pom.xml

I am working on open source maven project that use several mining dependencies.
after write this command into component mvn clean install I got ERROR in pom.xml file,enter code here that version of spmf is wrong.
<groupId>ca.pfv</groupId>
<artifactId>spmf</artifactId>
<version>2.33</version> // !!!
full error:
omponents-spmanalysis: Could not resolve dependencies for project
info.collide:components-spmanalysis:jar:2.0.0-SNAPSHOT: Failure to
find ca.pfv:spmf:jar:2.33
I tried to use different versions but same error at maven install.

Could not resolve dependencies for project, except when called with package

I have an EAR project, defined very similarly as the reference project of WildFly. In addition to that, I have another JAR project JarProject
which is included in:
parent's pom.xml (as a <module> and in its <dependencyManagement>)
the EjbProject's pom.xml (with the scope provided)
the EarProject's pom.xml (with the default scope, compile)
The problem is that when executing mvn eclipse:eclipse or mvn wildfly:deploy (from the parent project) it fails with the error
[ERROR] Failed to execute goal on project EjbProject: Could not resolve dependencies for project groupId:EjbProject:jar:0.0.4-SNAPSHOT: Could not find artifact groupId:JarProject:jar:0.0.4-SNAPSHOT -> [Help 1]
It somehow looks the JarProject in the local repository, and does not see it in the parent project.
Very important note: mvn package works without problems, as mvn package wildfly:deploy or mvn package eclipse:eclipse do, but without pacakgeing before eclipse:eclipse, it fails.
Maven version: 3.0.4 and 3.3.3
I'm not sure I got the question. Hope this will help...
Goals "eclipse:eclipse" and "wildfly:deploy" do not trigger building of your projects. To use a project as a dependency it needs to be built from the parent pom or installed in you repository.
When you do mvn package eclipse:eclipse the package triggers the build of the JarProject.
If you want do be able to do only mvn eclipse:eclipse then you need to perform a mvn install on your JarProject first.

Maven POM error - POM is missing

I am trying to build a maven project. My other team members are able to build it without issues. I get the following errors:
[WARNING] The POM for org.hectorclient:hector-core:jar:1.0-3 is missing, no dependency information
available
[WARNING] The POM for org.hectorclient:hector-test:jar:1.0-3 is missing, no dependency information
available
Then the build fails with the error: Could not resolve dependencies for the project XYZ. What could be possibly going wrong?
Surely the jar is missing from your .m2 local repository.
Assuming the dependency is written in the pom.
What I suggest:
Case: When you have internet
fire mvn install that will follow your POM.xml and it will download all the necessary jars.
then fire mvn compile to build.
Case: You are having restricted internet connection that is restricting / no Internet
Take the repository + POM from other machine that is compiling successfully
then fire mvn -o compile
I assume it will solve your case.
#Vaibs You are correct. Adding to your answer:
"Check the settings.xml of yours and the others. If you are not able to download the dependencies from internet like the one you mentioned due to some reason then you will need to set up maven somewhere else and and fire "mvn install" there to get the latest dependencies and put those .m2 into yours."

Maven release:perform not passing settings file to the deploy phase

I'm having an issue where Maven is not passing the settings to the deploy phase when I use the release plugin. I have my settings.xml file in the same folder as my pom.xml. When I run the following command it deploys successfully to the Maven repository.
mvn deploy -s settings.xml
However when I run this command, it fails saying that it doesn't have permissions to deploy to the repository.
mvn release:perform -B -s settings.xml
Here is the error message:
[INFO] [INFO] Error deploying artifact: Failed to transfer file: http://mavenrepo/groupId/artifactId/versionId/artifactId-versionId.pom. Return code is: 401
The only thing I can think that is causing the second to fail is that the release plugin doesn't pass the settings down to the deploy phase. How do I get this to work?
I used to have the MAVEN_OPTS environment variable set to specify my settings.xml file, but since this will run on from TeamCity, that is no longer an option.
I found a bug in the codehaus Jira for this same issue here. It was fixed in maven-release-plugin 2.2.2. As soon as I changed the version number in my pom.xml, it worked fine.

Resources