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

POM_VERSION sometimes not setted

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • maven-plugin
    • Jenkins 2.150.1
      Maven-plugin v2.3
      Maven 3.5.3
      jdk1.8.0_101

      Sometime the POM_VERSION is not setted inside a maven project. 

      e.g. 

      A build that works fine : 
      ...
      Set build name.
      New build name is '#58 - 0.9.1-SNAPSHOT'
      ...

      A bad build : 
      ...

      Set build name.

      Unrecognized macro 'POM_VERSION' in '#56 - ${POM_VERSION}'

      ...

       

      For information : 
      The Maven builds are the same job and we remove the workspace before each build. 
      The version inside the pom.xml is not updated. 

      This is really annoying cause we use this variable to name the build but also to give this information to a docker build in another job that cause a failing delivery. 

      I have a workaround for my parameter with these commands line in a pre-step execute shell : 

      echo POM_VERSION=$(mvn help:evaluate -Dexpression=project.version | fgrep -v '[INFO]') > pom_file
      echo POM_ARTIFACTID=$(mvn help:evaluate -Dexpression=project.groupId | fgrep -v '[INFO]') >> pom_file
      echo POM_GROUPID=$(mvn help:evaluate -Dexpression=project.artifactId | fgrep -v '[INFO]') >> pom_file

      and inject the pom_file info inside the Jenkins Build... but it's really ugly for me. 

      When the POM_VERSION is not setted, I have also notice that I don't have Fingerprints. Like the job is not reconized as a maven project. 

      Could you help me ?

            olamy Olivier Lamy
            xter Benjamin Dewez
            Votes:
            4 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: