0

When building maven - based jobs in Jenkins, Jenkins want's to copy the pom into the Jenkins workspace .. sometimes - which is resulting in a file -not found exception (trace attached) and a failure of the job (though maven build succeeds). Analog job configuration won't trigger this copy and ends with successful. Any idea? Both in Jenkins 1.5.62 as well as 1.5.40, Maven 3.1.1

Additional Information: The builds are not triggered via svn or any other revision control system. I figured out that the directory substructur in workspace does not exist, but after creating it the file didn't get copied. still the only solution I found yet is to copy the pom.xml manually at the expected location. Maven does not fail, of course, because the path to the original pom.xml is at the expected location. So I guess I was wrong about expecting Jenkins to do the file copy. The funny part: Not every job with exactly this setup (pom not in the workspace ) does fail.

Stacktrace :

Archiving /home/workspaces/cpp/NXP/Utilities/target/Utilities-1.0-SNAPSHOT.jar to com.nxp.native.utilities/Utilities/1.0-20140508.155024-45/Utilities-1.0-20140508.155024-45.nar
/home/workspaces/4/NXP/Utilities/pom.xml is not inside /var/lib/jenkins/jobs/NXP C++ Development Linux 64bit Utilities/workspace/home/workspaces/cpp/NXP/Utilities/; will archive in a separate pass
/home/workspaces/4/NXP/Utilities/target/Utilities-1.0-SNAPSHOT.jar is not inside /var/lib/jenkins/jobs/NXP C++ Development Linux 64bit Utilities/workspace/home/workspaces/cpp/NXP/Utilities/; will archive in a separate pass
channel stopped

ERROR: Failed to parse POMs
java.io.FileNotFoundException: /var/lib/jenkins/jobs/NXP C++ Development Linux 64bit Utilities/workspace/home/workspaces/cpp/NXP/Utilities/pom.xml (No such file or directory)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:146)
    at hudson.FilePath.read(FilePath.java:1637)
    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:862)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:518)
    at hudson.model.Run.execute(Run.java:1704)
    at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:519)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:231)
4
  • Thank your for editing. Looks better formatted and clearer to read.
    – Peter
    May 8, 2014 at 8:09
  • How is your jenkins setup. Is the build on a slave or is everything on the master.? Why is there explicit reference to /var/lib/jenkins as opposed to the workspace? May 8, 2014 at 9:02
  • This was one of the questions I was asking myself. :D
    – Peter
    May 8, 2014 at 10:10
  • Edited the question. I was expecting jenkins to copy the project from the location it resides in into the workspace of the job. This was wrong, I guess.
    – Peter
    May 8, 2014 at 10:20

2 Answers 2

0

Maven fails as there is no pom.xml in the root of your project containing som ebasic informationen. Are you sure that "/home/workspaces/4/NXP/Utilities/pom.xml" exists?

So That maybe is the reason for failing...

However: Do you want the analog job to trigger this missing pom or not? And is this analog job contining it own pom or not?

1
  • Yes. The file exists.
    – Peter
    May 8, 2014 at 10:10
0

This normally happens when the POM file is not well formed. Some of the maven tasks gets executed even with a non -well formed pom while some complains without a proper error message. I had the same issue and finally resolved it by ensuring that POM.xml is well formed. A very common issue could be :

. . .
                           <version>2.18.1</version>
                     </plugin>
              </plugins>
       </reporting>
</project>
</project>    **<<< remove this extra closing tag from the pom.xml file.**

Remember such a POM file with an extra enclosing project will run successfully via eclipse but will complain when running through Jenkins as part of Maven project

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.