Search code examples
jenkinsjenkins-pluginsmaven-3jenkins-pipelinemaven-plugin

Maven failed to parse POMs at Jenkins


I am getting the artifact in my remote repository after deploying but still I'm getting error in the build "Failed to parse POMs"

Could you please help me what is the mistake I've done. This is very basic maven project which I tried to pull the code from GitHub and trying to build and deploy the jar file in Nexus repository. Since its deploying the code in nexus once we run the job but still I'm getting error in Jenkins.

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.560 s
[INFO] Finished at: 2018-07-11T08:02:36Z
[INFO] ------------------------------------------------------------------------
Waiting for Jenkins to finish collecting data
[JENKINS] Archiving /var/lib/jenkins/workspace/Demo_maven/helloworld/pom.xml to com.indmax.app/helloworld/3.1-SNAPSHOT/helloworld-3.1-SNAPSHOT.pom
[JENKINS] Archiving /var/lib/jenkins/workspace/Demo_maven/helloworld/target/helloworld-3.1-SNAPSHOT.jar to com.indmax.app/helloworld/3.1-SNAPSHOT/helloworld-3.1-SNAPSHOT.jar
/var/lib/jenkins/workspace/Demo_maven/helloworld/pom.xml is not inside /var/lib/jenkins/workspace/Demo_maven/var/lib/jenkins/workspace/Demo_maven/helloworld/; will archive in a separate pass
/var/lib/jenkins/workspace/Demo_maven/helloworld/target/helloworld-3.1-SNAPSHOT.jar is not inside /var/lib/jenkins/workspace/Demo_maven/var/lib/jenkins/workspace/Demo_maven/helloworld/; will archive in a separate pass
ERROR: Failed to parse POMs
java.nio.file.NoSuchFileException: /var/lib/jenkins/workspace/Demo_maven/var/lib/jenkins/workspace/Demo_maven/helloworld/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:1991)
    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:1815)
    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
Finished: FAILURE

Solution

  • Actually I was trying with the wrong command in maven plugins.

    mvn clean deploy 
    

    The issue with mvn command. The logic is we are executing the command in maven plugin and the prefix makes the build fail. Hence I figured out and it works with

    clean deploy
    

    Thanks!