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

M2 extra steps plugin post step executed before the build

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Component/s: m2-extra-steps-plugin
    • Labels:
      None
    • Environment:
      Hudson 1.381, M2 extra steps 1.1.3
    • Similar Issues:
      Show 5 results

      Description

      When adding some post steps for a Maven 2 build, they are executed before the build.

      Output from the log:
      > [Project_Trunk] $ /bin/sh -xe /tmp/hudson4332229457250043200.sh
      > + echo '[INFO] Prebuild step'

      This works ok, it's a pre build step.

      > [trunk] $ /home/axhudson/tools/maven/apache-maven-2.2.1/bin/mvn -Dmaven.repo.local=/home/axhudson/hudson/workspace/Project_Trunk/.repository - B -U -e com.axway.maven2.plugins:axway-arti-staging-plugin:1.1.1:stage -DdeployList -Dintegration -Dwebliv

      This doesn't, it's the post build step.

      Of course, later on this happens:
      org.apache.maven.lifecycle.LifecycleExecutionException: /home/axhudson/hudson/workspace/Project_Trunk/trunk/all-project/patcher/target/patcher-3.7.0-SNAPSHOT-proguard.jar not found.
      Since the post build step needs a build artifact.

      The relevant config.xml section:
      <hudson.plugins.m2extrasteps.M2ExtraStepsWrapper>
      <preBuildSteps>
      <hudson.tasks.Shell>
      <command>echo "[INFO] Prebuild step"</command>
      </hudson.tasks.Shell>
      </preBuildSteps>
      <postBuildSteps>
      <hudson.tasks.Maven>
      <targets>-B -U -e com.axway.maven2.plugins:axway-arti-staging-plugin:1.1.1:stage -DdeployList -Dintegration -Dwebliv</targets>
      <mavenName>MAVEN_221</mavenName>
      <usePrivateRepository>true</usePrivateRepository>
      </hudson.tasks.Maven>
      <hudson.tasks.Shell>
      <command>$

      {JAVA_16_HOME}

      /bin/java -jar $

      {JYTHON}

      /jython.jar $

      {DEPLOY_SCRIPT}

      </command>
      </hudson.tasks.Shell>
      </postBuildSteps>
      <runIfResult>success</runIfResult>
      </hudson.plugins.m2extrasteps.M2ExtraStepsWrapper>

      Any other debug information needed?
      Thanks.

        Attachments

          Activity

          ccaraivan Costin Caraivan created issue -
          ccaraivan Costin Caraivan made changes -
          Field Original Value New Value
          Description When adding some post steps for a Maven 2 build, they are executated before the build.

          Output from the log:
          > [Project_Trunk] $ /bin/sh -xe /tmp/hudson4332229457250043200.sh
          > + echo '[INFO] Prebuild step'

          This works ok, it's a pre build step.

          > [trunk] $ /home/axhudson/tools/maven/apache-maven-2.2.1/bin/mvn -Dmaven.repo.local=/home/axhudson/hudson
          > /workspace/Project_Trunk/.repository -B -U -e com.axway.maven2.plugins:axway-arti-staging-
          > plugin:1.1.1:stage -DdeployList -Dintegration -Dwebliv

          This doesn't, it's the post build step.

          Of course, later on this happens:
          org.apache.maven.lifecycle.LifecycleExecutionException: /home/axhudson/hudson/workspace/Project_Trunk/trunk/all-project/patcher/target/patcher-3.7.0-SNAPSHOT-proguard.jar not found.
          Since the post build step needs a build artifact.

          The relevant config.xml section:
              <hudson.plugins.m2extrasteps.M2ExtraStepsWrapper>
                <preBuildSteps>
                  <hudson.tasks.Shell>
                    <command>echo &quot;[INFO] Prebuild step&quot;</command>
                  </hudson.tasks.Shell>
                </preBuildSteps>
                <postBuildSteps>
                  <hudson.tasks.Maven>
                    <targets>-B -U -e com.axway.maven2.plugins:axway-arti-staging-plugin:1.1.1:stage -DdeployList -Dintegration -Dwebliv</targets>
                    <mavenName>MAVEN_221</mavenName>
                    <usePrivateRepository>true</usePrivateRepository>
                  </hudson.tasks.Maven>
                  <hudson.tasks.Shell>
                    <command>${JAVA_16_HOME}/bin/java -jar ${JYTHON}/jython.jar ${DEPLOY_SCRIPT}</command>
                  </hudson.tasks.Shell>
                </postBuildSteps>
                <runIfResult>success</runIfResult>
              </hudson.plugins.m2extrasteps.M2ExtraStepsWrapper>

          Any other debug information needed?
          Thanks.

          When adding some post steps for a Maven 2 build, they are executated before the build.

          Output from the log:
          > [Project_Trunk] $ /bin/sh -xe /tmp/hudson4332229457250043200.sh
          > + echo '[INFO] Prebuild step'

          This works ok, it's a pre build step.

          > [trunk] $ /home/axhudson/tools/maven/apache-maven-2.2.1/bin/mvn -Dmaven.repo.local=/home/axhudson/hudson/workspace/Project_Trunk/.repository - B -U -e com.axway.maven2.plugins:axway-arti-staging-plugin:1.1.1:stage -DdeployList -Dintegration -Dwebliv

          This doesn't, it's the post build step.

          Of course, later on this happens:
          org.apache.maven.lifecycle.LifecycleExecutionException: /home/axhudson/hudson/workspace/Project_Trunk/trunk/all-project/patcher/target/patcher-3.7.0-SNAPSHOT-proguard.jar not found.
          Since the post build step needs a build artifact.

          The relevant config.xml section:
              <hudson.plugins.m2extrasteps.M2ExtraStepsWrapper>
                <preBuildSteps>
                  <hudson.tasks.Shell>
                    <command>echo &quot;[INFO] Prebuild step&quot;</command>
                  </hudson.tasks.Shell>
                </preBuildSteps>
                <postBuildSteps>
                  <hudson.tasks.Maven>
                    <targets>-B -U -e com.axway.maven2.plugins:axway-arti-staging-plugin:1.1.1:stage -DdeployList -Dintegration -Dwebliv</targets>
                    <mavenName>MAVEN_221</mavenName>
                    <usePrivateRepository>true</usePrivateRepository>
                  </hudson.tasks.Maven>
                  <hudson.tasks.Shell>
                    <command>${JAVA_16_HOME}/bin/java -jar ${JYTHON}/jython.jar ${DEPLOY_SCRIPT}</command>
                  </hudson.tasks.Shell>
                </postBuildSteps>
                <runIfResult>success</runIfResult>
              </hudson.plugins.m2extrasteps.M2ExtraStepsWrapper>

          Any other debug information needed?
          Thanks.

          Hide
          ccaraivan Costin Caraivan added a comment -

          Extra info:
          Hudson master on RHEL Linux 5.5
          Job running on a Debian Lenny slave
          Node connected through Hudson's SSH client.

          What else is needed? I can provide extra information. As far as I can see there's no pattern to this bug- some jobs run the post build step after the build, some don't. ~40 jobs with this configuration, only 4 have this problem. The configuration is the same.

          The workaround is to make the job a freestyle job, or to add the main build as a post build step, but in both cases you lose the advantages of a Maven job...

          Show
          ccaraivan Costin Caraivan added a comment - Extra info: Hudson master on RHEL Linux 5.5 Job running on a Debian Lenny slave Node connected through Hudson's SSH client. What else is needed? I can provide extra information. As far as I can see there's no pattern to this bug- some jobs run the post build step after the build, some don't. ~40 jobs with this configuration, only 4 have this problem. The configuration is the same. The workaround is to make the job a freestyle job, or to add the main build as a post build step, but in both cases you lose the advantages of a Maven job...
          ccaraivan Costin Caraivan made changes -
          Description When adding some post steps for a Maven 2 build, they are executated before the build.

          Output from the log:
          > [Project_Trunk] $ /bin/sh -xe /tmp/hudson4332229457250043200.sh
          > + echo '[INFO] Prebuild step'

          This works ok, it's a pre build step.

          > [trunk] $ /home/axhudson/tools/maven/apache-maven-2.2.1/bin/mvn -Dmaven.repo.local=/home/axhudson/hudson/workspace/Project_Trunk/.repository - B -U -e com.axway.maven2.plugins:axway-arti-staging-plugin:1.1.1:stage -DdeployList -Dintegration -Dwebliv

          This doesn't, it's the post build step.

          Of course, later on this happens:
          org.apache.maven.lifecycle.LifecycleExecutionException: /home/axhudson/hudson/workspace/Project_Trunk/trunk/all-project/patcher/target/patcher-3.7.0-SNAPSHOT-proguard.jar not found.
          Since the post build step needs a build artifact.

          The relevant config.xml section:
              <hudson.plugins.m2extrasteps.M2ExtraStepsWrapper>
                <preBuildSteps>
                  <hudson.tasks.Shell>
                    <command>echo &quot;[INFO] Prebuild step&quot;</command>
                  </hudson.tasks.Shell>
                </preBuildSteps>
                <postBuildSteps>
                  <hudson.tasks.Maven>
                    <targets>-B -U -e com.axway.maven2.plugins:axway-arti-staging-plugin:1.1.1:stage -DdeployList -Dintegration -Dwebliv</targets>
                    <mavenName>MAVEN_221</mavenName>
                    <usePrivateRepository>true</usePrivateRepository>
                  </hudson.tasks.Maven>
                  <hudson.tasks.Shell>
                    <command>${JAVA_16_HOME}/bin/java -jar ${JYTHON}/jython.jar ${DEPLOY_SCRIPT}</command>
                  </hudson.tasks.Shell>
                </postBuildSteps>
                <runIfResult>success</runIfResult>
              </hudson.plugins.m2extrasteps.M2ExtraStepsWrapper>

          Any other debug information needed?
          Thanks.

          When adding some post steps for a Maven 2 build, they are executed before the build.

          Output from the log:
          > [Project_Trunk] $ /bin/sh -xe /tmp/hudson4332229457250043200.sh
          > + echo '[INFO] Prebuild step'

          This works ok, it's a pre build step.

          > [trunk] $ /home/axhudson/tools/maven/apache-maven-2.2.1/bin/mvn -Dmaven.repo.local=/home/axhudson/hudson/workspace/Project_Trunk/.repository - B -U -e com.axway.maven2.plugins:axway-arti-staging-plugin:1.1.1:stage -DdeployList -Dintegration -Dwebliv

          This doesn't, it's the post build step.

          Of course, later on this happens:
          org.apache.maven.lifecycle.LifecycleExecutionException: /home/axhudson/hudson/workspace/Project_Trunk/trunk/all-project/patcher/target/patcher-3.7.0-SNAPSHOT-proguard.jar not found.
          Since the post build step needs a build artifact.

          The relevant config.xml section:
              <hudson.plugins.m2extrasteps.M2ExtraStepsWrapper>
                <preBuildSteps>
                  <hudson.tasks.Shell>
                    <command>echo &quot;[INFO] Prebuild step&quot;</command>
                  </hudson.tasks.Shell>
                </preBuildSteps>
                <postBuildSteps>
                  <hudson.tasks.Maven>
                    <targets>-B -U -e com.axway.maven2.plugins:axway-arti-staging-plugin:1.1.1:stage -DdeployList -Dintegration -Dwebliv</targets>
                    <mavenName>MAVEN_221</mavenName>
                    <usePrivateRepository>true</usePrivateRepository>
                  </hudson.tasks.Maven>
                  <hudson.tasks.Shell>
                    <command>${JAVA_16_HOME}/bin/java -jar ${JYTHON}/jython.jar ${DEPLOY_SCRIPT}</command>
                  </hudson.tasks.Shell>
                </postBuildSteps>
                <runIfResult>success</runIfResult>
              </hudson.plugins.m2extrasteps.M2ExtraStepsWrapper>

          Any other debug information needed?
          Thanks.

          Hide
          evernat evernat added a comment -

          The m2-extra-steps is now deprecated because the functionality is now included in the core. So this certainly works now in the core.

          Show
          evernat evernat added a comment - The m2-extra-steps is now deprecated because the functionality is now included in the core. So this certainly works now in the core.
          evernat evernat made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Cannot Reproduce [ 5 ]

            People

            • Assignee:
              abayer Andrew Bayer
              Reporter:
              ccaraivan Costin Caraivan
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: