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

In Maven2 jobs, parsing POM is done *before* calling pre-build steps (using M2-extra-steps-plugin)

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • maven-plugin
    • None

      Currently, the behavior of the Maven plugin is to first parse the main pom, then execute pre-build if available.
      In our case, this causes a problem because we don't store pom.xml directly in our scm, it needs to be instanciated from a template.

      We would need to be able to execute pre-build before parsing the POM.

      Judging from hudson.maven.MavenModuleSetBuild class it seems easy enough to do.

          [JENKINS-5428] In Maven2 jobs, parsing POM is done *before* calling pre-build steps (using M2-extra-steps-plugin)

          Andrew Bayer added a comment -

          Changing this to an improvement request, since I don't actually consider the current behavior to be a bug. It's that way by design - the POM parsing happens before everything else build-related. That may be something we could consider changing, but it's not a bug.

          Andrew Bayer added a comment - Changing this to an improvement request, since I don't actually consider the current behavior to be a bug. It's that way by design - the POM parsing happens before everything else build-related. That may be something we could consider changing, but it's not a bug.

          Actually I hesitated when opening this about improvement/bug. But since it is by design, definitely improvement.

          I don't really see what brings parsing of POMs before pre-build. Are there use cases where pre-builds needs the information obtained from POM parsing ?

          Vincent Latombe added a comment - Actually I hesitated when opening this about improvement/bug. But since it is by design, definitely improvement. I don't really see what brings parsing of POMs before pre-build. Are there use cases where pre-builds needs the information obtained from POM parsing ?

          That patch solves the problem for me.

          Vincent Latombe added a comment - That patch solves the problem for me.

          Any hope of this getting this integrated? Sorry for being a bit pushy, but i'm depending on this to enable maven2 mode on my projects and I would prefer staying on the mainline rather than deploying a private version just for this patch.

          Vincent Latombe added a comment - Any hope of this getting this integrated? Sorry for being a bit pushy, but i'm depending on this to enable maven2 mode on my projects and I would prefer staying on the mainline rather than deploying a private version just for this patch.

          mmorizot added a comment -

          i'd be interrested too, in a "create my release" job:

          • idea is to sed /SNAPSHOT/MYRELEASEVERSION/g on all the poms,
          • run the clean install task.

          (the release:perform does too much stuff for me, on which i'd like to keep control, like svn interraction)

          currently this kindda fails for me, because it seems like the "maven reactor" is keeping in memory the initial parsing of the poms (with the -SNAPSHOT), hense when i upload my artifacts to our artifact repo (artifactory, with the artifactory plugin), the build info keeps the SNAPSHOT version...

          mmorizot added a comment - i'd be interrested too, in a "create my release" job: idea is to sed /SNAPSHOT/MYRELEASEVERSION/g on all the poms, run the clean install task. (the release:perform does too much stuff for me, on which i'd like to keep control, like svn interraction) currently this kindda fails for me, because it seems like the "maven reactor" is keeping in memory the initial parsing of the poms (with the -SNAPSHOT), hense when i upload my artifacts to our artifact repo (artifactory, with the artifactory plugin), the build info keeps the SNAPSHOT version...

          Code changed in hudson
          User: : vlatombe
          Path:
          trunk/hudson/main/maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
          http://jenkins-ci.org/commit/29609
          Log:
          [FIXED JENKINS-5428] In Maven2 jobs, parsing POM is done before calling pre-build steps (using M2-extra-steps-plugin)

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : vlatombe Path: trunk/hudson/main/maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java http://jenkins-ci.org/commit/29609 Log: [FIXED JENKINS-5428] In Maven2 jobs, parsing POM is done before calling pre-build steps (using M2-extra-steps-plugin)

            vlatombe Vincent Latombe
            vlatombe Vincent Latombe
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: