Why is jaxws-maven-plugin showing these warnings? - maven

Everything is working fine, but I am puzzled as to what's going on with these warnings.
When I run the wsimport goal, for each of my project's test dependencies it reports that it "cannot find file".
[INFO] --- jaxws-maven-plugin:2.3:wsimport (default-cli) # my-project ---
[WARNING] cannot find file for com.realvnc.services:test-utils
[WARNING] cannot find file for org.cassandraunit:cassandra-unit
[WARNING] cannot find file for org.springframework.ws:spring-ws-test
[WARNING] cannot find file for com.jayway.jsonpath:json-path
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
Questions:
What exactly is this file and what is looking for it?
Is this symptomatic of some problem I haven't noticed yet?
Is there a way to remove these warnings?

It looks like you are experiencing an already reported bug:
WsImportMojo: warning "cannot find file for" for test artefacts
The issue is still open (at the time of writing) and fix would be probably availabled with version 2.5.2-SNAPSHOT (no yet released and hence not available on Maven Central).
Hence, concerning your questions:
What exactly is this file and what is looking for it?
The warning is issued in this line while scanning for artifacts (dependencies) but not filtering by scope (test and provided should indeed be ignored) or optional dependencies.
Is this symptomatic of some problem I haven't noticed yet?
No, you can ignore it. It will be gone in future versions.
Is there a way to remove these warnings?
No, for the moment. Again, they will be gone in a future version.

Related

Maven build fails with test failures, but all surefire reports are ok

When I do Maven build on my project I get the following:
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] There are test failures.
Please refer to .
However, all my surefire reports show 0 failures and 0 errors.
Any ideas what could cause this or how to find out?
Regards,
Olli
This could be because of inadequate memory issue on the computer.
Running the maven build by redirecting the logs to a separate log file resolved the problem for me
mvn clean install > log-file.log
Please note that since if inadequate memory is really the issue (like in my case) then it also depends on the command we are executing. For example, mvn clean install eclipse:clean eclipse:eclipse command worked fine when the logs are redirected to a file instead of console but when I used the maven command with -X flag and ran the command then I faced the problem again even though I redirected the output to log file
Please see below answers which might be similar issue:
The forked VM terminated without saying properly goodbye. VM crash or System.exit called
I had the same issue after upgrading my project from Java 8 to 9.
My tests passed when running from my IDE, but failed when run with maven, and all surefire reports were clean, no failures.
Then I opened an html surefire report found in ${project_dir}/target/surefire-reports/testng-junit-results where I saw the whole stack trace from that one failure and it had something to do with java.base module which I had problems with before (the standard Java 9 modules accessibility issues) so I realized I had to add a few --add-opens flags in my surefire plugin argLine:
--add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED
--add-opens=java.base/jdk.internal.loader=ALL-UNNAMED
This issue was super frustrating because the errors were not intuitive, I still don't understand why it just didn't say "module java.base does not "opens jdk.internal.loader" to unnamed module" like I've seen before.
Check the version of surefire used and make sure it's up to date. That might be enough to let you see the reason for the failure, if not correct the problem entirely.
If the same problem persists, temporarily set the forkCount property to 0 and re-run the build. I have seen Surefire swallow exceptions from forked processes before. If this is what's happening, not using a fork will let you see the exception so you may correct the issue.

Maven Jenkins Plugin POMs missing for dependency information on JARs

I have been trying to follow the tutorial here: https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial
I have spent about 7 hours on this now and finally decided to just ask and hope for a response.
I haven't edited the pom file at all from the create command. I am pretty sure I have my settings file correct. When I try to run or package the project though I get this:
[WARNING] The POM for org.apache.maven.surefire:surefire-booter:jar:2.9 is missing, no dependency information available
[WARNING] The POM for org.apache.maven.surefire:maven-surefire-common:jar:2.9 is missing, no dependency information available
[WARNING] The POM for org.apache.maven:maven-toolchain:jar:2.0.9 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.260s
[INFO] Finished at: Tue Jan 29 16:07:56 EST 2013
[INFO] Final Memory: 41M/387M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.9:test (default-test) on project helloworld: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.9:test failed: Plugin org.apache.maven.plugins:maven-surefire-plugin:2.9 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.apache.maven.surefire:surefire-booter:jar:2.9, org.apache.maven.surefire:maven-surefire-common:jar:2.9, org.codehaus.plexus:plexus-utils:jar:2.1: Failure to find org.apache.maven.surefire:surefire-booter:jar:2.9 in http://repo.jenkins-ci.org/public/ was cached in the local repository, resolution will not be reattempted until the update interval of repo.jenkins-ci.org has elapsed or updates are forced ->
So I am assuming that it is supposed to be downloading these 3 jar files from the repositories I set up in the settings file... but it isn't. Is there any reason this would happen? Anything I can do to make it download these files? Or is it downloading them I am just not referencing them correctly somewhere? I'm pretty new to this so i could be completely off.
If it helps I have maven 3.0.4 and jdk 1.7.0_02. Everything else I have pretty much copy and pasted from the tutorial I think. Any help would be greatly appreciated!
Something went probably wrong when you attempted to get the artefacts the first time, and now you are stuck because of a nasty maven bug. Maven might have created an empty folder in your local repository (.m2) and now thinks you already have the dependency. So you should check if this is what happened and, if so, deleted the folder.
See my answer here :
Compiler error "archive for required library could not be read" - Spring Tool Suite
And you can also check why there was a problem in the first place. Do you access the following url with your browser ?
http://repo.jenkins-ci.org/public/org/apache/maven/surefire/surefire-booter/2.9/

maven deploy:deploy-file fails (409 Conflict), yet artifact uploads successfully

NOTE:
I now realize that the jar got placed into my repository, but the pom.xml did not. Now, I have another project where the pom.xml fails to get promoted, but the jar is placed in the repository.
However, another project, both the pom.xml and the jar do get placed in the repository.
I have a project in Jenkins where I use the promotion plugin to deploy my artifacts in Maven via the deploy:deploy-file goal.
This works for several other projects I have in Maven, but it fails for this project. The funny thing is that the file (but not the pom.xml) uploads anyway. I've verified this by removing the artifact from our Maven repository, then running the promotion. The artifact is in our repository after the promotion.
Here's the log I'm getting. Broke up the extra long lines the best I could:
[workspace] $ /bin/bash -xe /opt/tomcat/apache-tomcat-7.0.27/temp/hudson7357923598740079329.sh
+ FILE_LOC=/mnt/jenkins/builds/metricsdb-trunk/21/archive/target/archive
+ mvn deploy:deploy-file
-Dversion=0.8.0
-Dfile=/mnt/jenkins/builds/metricsdb-trunk/21/archive/target/archive/metricsdb-etl.jar
-DpomFile=/mnt/jenkins/builds/metricsdb-trunk/21/archive/target/archive/pom.xml
-Durl=http://repo.vegicorp.com/artifactory/ext-release-local -DrepositoryId=VegiCorp
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Command Line Spring Batch Module 0.8.0.CI-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-deploy-plugin:2.7:deploy-file (default-cli) # metricsdb-etl ---
Uploading: http://repo.vegicorp.com/artifactory/ext-release-local/com/vegicorp/batch/metricsdb/metricsdb-etl/0.8.0/metricsdb-etl-0.8.0.jar
2/38 KB
4/38 KB
[...]
Uploaded: http://repo.vegicorp.com/artifactory/ext-release-local/com/vegicorp/batch/metricsdb/metricsdb-etl/0.8.0/metricsdb-etl-0.8.0.jar (38 KB at 202.2 KB/sec)
Uploading: http://repo.vegicorp.com/artifactory/ext-release-local/com/vegicorp/batch/metricsdb/metricsdb-etl/0.8.0/metricsdb-etl-0.8.0.pom
2/7 KB
4/7 KB
[...]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.243s
[INFO] Finished at: Thu Oct 04 14:38:52 CDT 2012
[INFO] Final Memory: 4M/119M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file
(default-cli) on project metricsdb-etl: Failed to deploy artifacts:
Could not transfer artifact com.vegicorp.batch.metricsdb:metricsdb-etl:pom:0.8.0 from/to
VegiCorp (http://repo.vegicorp.com/artifactory/ext-release-local):
Failed to transfer file: http://repo.vegicorp.com/artifactory/ext-release-local/com/vegicorp/batch/metricsdb/metricsdb-etl/0.8.0/metricsdb-etl-0.8.0.pom.
Return code is: 409, ReasonPhrase:Conflict. -> [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/MojoExecutionException
failed build hudson.tasks.Shell#24a6e7f9 SUCCESS
Finished: FAILURE
Output with the debug flag (-X) is in Pastebin.
I found the problem. Two problems actually:
I only had the release repository setup, and I was attempting to save a snapshot release in the release repository. Artifactory was setup to only allow releases in the release repository. This can be modified in the Artifactory setting, but I decided against this.
My pom.xml has a different version in it than I was trying to save it to. For example, the pom.xml said version 2.0 and I was trying to save the release as 2.0.2. Artifactory rejected the pom (but not the jar) for this reason.
I found the Artifactory setting (which is per repository) that asks whether or not to "Suppress POM consistency checks". Checking this box will allow me to set the version to one, but have the pom say another.
I also had to modify my Maven "settings.xml" file to allow for both a Release and Snapshot repository. I also have to modify my URL to the snapshot repository.
We were only using Ivy for a while (which doesn't have a snapshot concept), so we were just putting stuff in the release repository. This is a Maven project, and the developer marked the version in the POM as a SNAPSHOT.
Unfortunately, Maven documentation is pretty poor, and there still aren't any good books on Maven. Even worse is that the error messages are simply poor. What does "409, ReasonPhrase:Conflict. -> [Help 1]" mean?
Not that Ivy documentation is so much better, but Ant in Action has some excellent sections on using Ivy.
Ensure that you include -SNAPSHOT as part of your version if you are publishing to the snapshot repository.
And remove -SNAPSHOT in case you are publishing it to a non-snapshot repository.
Yeah....Multiple Reason for same error. May be it will help somebody
1. Login as Admin to Artifactory
2. Configuration -> Repositories
3. Edit the Local Repository ---> Suppress POM Consistency Checks
This solves my problem.... Not sure. Right approach or not ?
I also face this problem, and I found the reason is the parent project didn't deploy in the snapshot repository.
I run mvn deploy in the parent folder, and the problem resolved.
Had that error message too. For me the problem was that the setup of the server is to accept only release, not SNAPSHOT. After removing the SNAPSHOT from the pom, it worked fine.
In my case the POM file associated with the jar file (external, in same dir) had a dependency to itself. This was a offline zipped repo from a third party that I needed to load into artifactory.
I modified the POM files, removed the self-dependency and made sure the package info was right. Then artifacts deployed with no problems. Sent email to vendor so they can fix in their build.
I had this issue as well and it turned out that we had include/exclude rules set up on the repository I was trying to deploy to and my deployment didn't match those rules.
My solution was to point the deployment at a new repository that had **/* as the include rule (and the pattern from my other repository as an exclude rule to keep them separate).
I have been experiencing the same problem.
(TL;DR: solution see last line)
During the deploy from jenkins to Artifactory, sometimes (magic!) a 409 - conflict error appeared with the following error message on the Artifactory log:
[WARN ] (o.a.e.UploadServiceImpl:239) - Sending HTTP error code 409: Checksum policy 'LocalRepoChecksumPolicy: CLIENT' rejected the artifact 'gradle-integration:com.redacted.java/fooProject/123/foo-123.jar'. Checksums info: ChecksumsInfo{checksums={SHA-1=ChecksumInfo{type=SHA-1, original='da39a3ee5e6b4b0d3255bfef95601890afd80709', actual='1459689f0be058f4ecef7e6fe3576f1550a8afda'}, MD5=ChecksumInfo{type=MD5, original='d41d8cd98f00b204e9800998ecf8427e', actual='14c7a498de028d6eb5882b3c698bc456'}}}.
As the trained eye might notice: The MD5# d41d8cd98f00b204e9800998ecf8427e is the checksum for an empty file or string.
Which means that the following must be happening:
The copy job that prepares the Artifacts in the publish folder had not finished and therefore the file was empty when the checksum was calculated.
However when the deploy happened the file was there, Artifactory now receives a checksum which is incorrect and correctly refuses the file with the error code 409.
THE SOLUTION (is simple):
Make 100% sure the files are definitely there before you start the deploy job (add a pause or proper logic).
There is a good possibility that the space on your remote repo is full. Verify that before going all technical and wasting time. Wasted 2-3 hrs thinking its a logical problem.
In my case the root cause for that very error was dependency version property that was not in the root pom.
The solution was moving the property to root pom where the version for the dependency was required.
So, missing version property of a dependency.
Very misleading error message indeed.
The world snapshot was written in lower case inside the pom.xml file. It must be written in upper case.
Ali

How can I locate the POM which requests a missing POM?

When I build my project, I get these warnings:
[INFO] ------------------------------------------------------------------------
[INFO] Building XXX
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.eclipse.update:org.eclipse.update.configurator:jar:3.2.0 is missing, no dependency information available
[WARNING] The POM for org.eclipse.emf:org.eclipse.emf.ecore:jar:2.3.2 is missing, no dependency information available
[WARNING] The POM for com.ibm.icu:com.ibm.icu:jar:3.4.4 is missing, no dependency information available
In my build, I overwrite the versions of these dependencies and the build itself succeeds.
What is the fastest way to fix the warnings?
Edit: What is the fastest way to locate the POMs which contain these versions?
Note: I have 7000 POMs in my local repo.
try the analyze tools from the dependency-plugin
especially the mvn dependency:analyze-dep-mgt
A few things that might help:
mvn dependency:tree -Dverbose=true can spit out unused duplicates/versions. Wasn't enough in my case, however, for some reason it didn't show the offending jar's listed [?]. It also doesn't show the ommitted jar's descendants, which may or may not be useful.
ref: http://jira.codehaus.org/browse/MDEP-123
Intellij can list what it thinks are offending pom's and paths (open the pom.xml file, hover over the underlined "project":
Unfortunately none of these was enough for me, either.
Then I noticed that if you delete the offending directory from your ~/.m2/repository, it will be downloaded again and basically empty. So I think what this error message can sometimes mean is "your nexus lists a version that it doesn't actually have available for download." It appears that maven by default, if you request for instance commons-logging 1.1.1, will attempt to download the pom's for all known versions of common-logging, then, in my case, it spit out that warning but it was benign. Phew!
So in truth, none of your projects might point to the warned of bad pom (or bad version, etc.) Except nexus' metadata index.
You could use dependency:tree to see what pom references the one you're missing

Maven site error with version range

I have a Maven project that declares a dependency on another Maven artifact using an open ended version range, such as this:
<dependency>
<groupId>org.terracotta.toolkit</groupId>
<artifactId>terracotta-toolkit-1.0</artifactId>
<version>[1.0.0-SNAPSHOT,]</version>
</dependency>
(I know that it is to some degree asking for trouble using such version ranges, but for this particular project we have very good reason for doing so.)
For the most part this works fine, but when trying to generate the project web site with "mvn site", I get the following error when it tries to create the Dependency Management Report:
[INFO] Generating "Dependency Management" report. Downloading: http:/XXXXXXXXXX/content/groups/public/org/terracotta/toolkit/terracotta-toolkit-1.0/[1.0.0-SNAPSHOT,]/terracotta-toolkit-1.0-[1.0.0-SNAPSHOT,].pom
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Invalid uri 'http://XXXXXXXXXX/content/groups/public/org/terracotta/toolkit/terracotta-toolkit-1.0/[1.0.0-SNAPSHOT,]/terracotta-toolkit-1.0-[1.0.0-SNAPSHOT,].pom': escaped absolute path not valid
[INFO] ------------------------------------------------------------------------
[INFO] Trace java.lang.IllegalArgumentException: Invalid uri 'http://XXXXXXXXXX/content/groups/public/org/terracotta/toolkit/terracotta-toolkit-1.0/[1.0.0-SNAPSHOT,]/terracotta-toolkit-1.0-[1.0.0-SNAPSHOT,].pom': escaped absolute path not valid
As you can see from the message, it tries to construct a URI with the open ended version range specification instead of the resolved version number, which of course fails.
Can anyone tell me if there is a workaround?
Does it work properly if you fix the version of the terracotta artifact to 1.0.0?
Also, which version of Maven are you using? As per this link:
https://cwiki.apache.org/MAVEN/maven-3x-compatibility-notes.html
if you are using Maven 3.x, you will have issues with mvn site.
This turned out to be a bug in Maven 2.2.0 that was fixed in Maven 2.2.1. I was mistaken that I was using Maven 2.2.1 already.

Resources