Issue
Background info:
I have a simple maven project on Mac using eclipse, doing ui testing.
setup jenkins server on localhost:8080 (with latest jenkins version)
- configure Root POM as where the pom.xml is located locally(/Users/username/eclipse-workspace/ui-test/pom.xml)
- It can build successfully with maven locally
- also build successfully on Jenkins
However, after the jenkins shows BUILD SUCCESS, it "Waiting for Jenkins to finish collecting data" then displays:
"ERROR: Failed to parse POMs java.nio.file.NoSuchFileException: /Users/username/.jenkins/workspace/UI-Automation-Job/Users/username/eclipse-workspace/ui-test/pom.xml"
I'd appreciate your help. Thanks.
---detailed jenkins log---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 43.119 s
[INFO] Finished at: 2018-03-29T17:19:40-04:00
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[JENKINS] Archiving /Users/username/eclipse-workspace/ui-test/pom.xml to ui-test/ui-test/0.0.1-SNAPSHOT/ui-test-0.0.1-SNAPSHOT.pom
[JENKINS] Archiving /Users/username/eclipse-workspace/ui-test/target/ui-test-0.0.1-SNAPSHOT.jar to ui-test/ui-test/0.0.1-SNAPSHOT/ui-test-0.0.1-SNAPSHOT.jar
/Users/username/eclipse-workspace/ui-test/pom.xml is not inside /Users/username/.jenkins/workspace/UI-Automation-Job/Users/username/eclipse-workspace/ui-test/; will archive in a separate pass
/Users/username/eclipse-workspace/ui-test/target/ui-test-0.0.1-SNAPSHOT.jar is not inside /Users/username/.jenkins/workspace/UI-Automation-Job/Users/username/eclipse-workspace/ui-test/; will archive in a separate pass
ERROR: Failed to parse POMs
java.nio.file.NoSuchFileException: /Users/username/.jenkins/workspace/UI-Automation-Job/Users/username/eclipse-workspace/ui-test/pom.xml
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
at java.nio.file.Files.newByteChannel(Files.java:361)
at java.nio.file.Files.newByteChannel(Files.java:407)
at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
at java.nio.file.Files.newInputStream(Files.java:152)
at hudson.FilePath.read(FilePath.java:1849)
at jenkins.plugins.maveninfo.extractor.properties.PomPropertiesFinder.findProperties(PomPropertiesFinder.java:50)
at jenkins.plugins.maveninfo.extractor.MavenInfoExtractor.extract(MavenInfoExtractor.java:58)
at jenkins.plugins.maveninfo.extractor.MavenInfoEnvironment.tearDown(MavenInfoEnvironment.java:42)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:908)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
at hudson.model.Run.execute(Run.java:1727)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
channel stopped
....
....
Solution
From the error:
/Users/username/eclipse-workspace/ui-test/pom.xml is not inside /Users/username/.jenkins/workspace/UI-Automation-Job/Users/username/eclipse-workspace/ui-test/;
We can learn Jenkins file to find your pom.xml, Please go through your job configuration and find out where did you input this string /Users/username/eclipse-workspace/ui-test/pom.xml
Check below most possible places: Root POM
and Archive files
, Recommend to use relative path, but absolute path.
Jenkins will create a folder on Jenkins Slave(on which you job executing) to place your project source code, stuff generated during job running, etc.
If you use relative path, Jenkins will automatically use Job's workspace folder as parent folder.
Answered By - yong
Answer Checked By - Clifford M. (JavaFixing Volunteer)