Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-56006

Jenkins breaks when you specify a Maven root pom file with a name other than "pom.xml".

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • maven-plugin
    • None
    • Docker, standard Jenkins container image

      Jenkins version: Jenkins ver. 2.150.2 via current Docker LTS release

      I have multiple aggregate pom files at the root of my source tree to allow different subsets of the whole tree to be built. They have names like "pom_foo.xml" and "pom_bar.xml". For development, we often create a symlink named "pom.xml" pointing to one of these to avoid having to specify the pom file name when running Maven. This is a standard Maven practice as far as I know.

      When I attempt to have Jenkins build my project by specifying one of these specific pom file names in the Build->Root Pom configuration field in Jenkins, the build almost succeeds. Jenkins causes Maven to successfully build my source tree. But then, at the end of the build, I get this:

       

      [JENKINS] Archiving /var/jenkins_home/workspace/deploy_fetcherproxy/poms/pom.xml to org.springframework.boot/poms/2.1.1.RELEASE/poms-2.1.1.RELEASE.pom
      [JENKINS] Archiving /var/jenkins_home/workspace/deploy_fetcherproxy/common/common-jutil/pom.xml to com.inlet/common-jutil/1.0-SNAPSHOT/common-jutil-1.0-SNAPSHOT.pom
      [JENKINS] Archiving /var/jenkins_home/workspace/deploy_fetcherproxy/common/common-jutil/target/common-jutil-1.0-SNAPSHOT.jar to com.inlet/common-jutil/1.0-SNAPSHOT/common-jutil-1.0-SNAPSHOT.jar
      ERROR: Failed to parse POMs
      java.nio.file.NoSuchFileException: /var/jenkins_home/workspace/deploy_fetcherproxy/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)

       

      In this case, the pom file I specified is /var/jenkins_home/workspace/pom_fetcherproxy.xml.  If I add a symlink "pom.xml -> pom_fetcherproxy.xml" to the root of my source tree and specify my pom name to be either "pom_fetcherproxy.xml" or "pom.xml" (or leave that field blank), then the build works fine. It seems evident that Jenkins is at some point forgetting my custom pom file name and is instead looking for the standard "pom.xml" file either at the root of the source tree or in the same location as my specified pom (those are the same in this case).

      Is this a known NO NO in Jenkins? If it is, then it's at least a bug in that the field that accepts the "Root POM" should not allow specification of the pom file name, but only the directory containing a "pom.xml" file, and should be clearer about what can go there. The help text attached to that field might be saying that the name has to be "pom.xml", but it isn't very clear. Also, I expect that this behavior is unexpected or undesirable given that Jenkins makes it most of the way through as though specifying a non-standard pom file name is just fine.

      To be clear, here's how I'm specifying the pom file name:

            Unassigned Unassigned
            steve_johnson Steve Johnson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: