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

Maven release plugin cannot find mvn command

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Labels:
      None
    • Environment:
      Ubuntu 10.04 64bit, Tomcat6, Sun Java 6

      Description

      Hudson is configured to use a JDK installation (Sun Java 6) and a Maven installation (2.2.1). I have seen these under the $HUDSON_HOME/tools directories. I have a release project that uses the Hudson maven release plugin. However the build fails as follows:

      [HUDSON] Archiving /opt/hudson_home/jobs/myproj (release)/workspace/pom.xml to /opt/hudson_home/jobs/myproj (release)/modules/com.mycorp$myproj/builds/2010-11-12_23-54-29/archive/com.mycorp/myproj/1.0.11-SNAPSHOT/pom.xml
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] Failed to invoke Maven build.

      Maven executable not found at: /opt/hudson_home/jobs/myproj (release)/workspace/bin/mvn

      For sure "/opt/hudson_home/jobs/myproj (release)/workspace/bin/mvn" is the wrong path. The correct path would be "/opt/hudson_home/tools/Maven_2.2.1/bin/mvn".

      Perhaps I have something mis-configured. Or is there a work-around?

      I tried upgrading from 0.6.1 to 0.7.0 but I get the same result.

      1. help-effective-pom.txt
        12 kB
        hdave42
      2. help-system.txt
        6 kB
        hdave42

        Issue Links

          Activity

          Hide
          teilo James Nord added a comment -

          can atach the output of mvn help:effective-pom and the node environment varibles from Hudson

          Show
          teilo James Nord added a comment - can atach the output of mvn help:effective-pom and the node environment varibles from Hudson
          Hide
          hdave42 hdave42 added a comment -

          Here is the output of help:effective-pom and help:system. Let me know if there is anything else you need. I've obfuscated the name of my company and product, but it shouldn't make any difference I think.

          Show
          hdave42 hdave42 added a comment - Here is the output of help:effective-pom and help:system. Let me know if there is anything else you need. I've obfuscated the name of my company and product, but it shouldn't make any difference I think.
          Hide
          teilo James Nord added a comment -
          Show
          teilo James Nord added a comment - There is no 0.7.0 yet - just a snapshot did you get it from http://ci.hudson-labs.org/job/plugins_m2release/lastStableBuild/org.jvnet.hudson.plugins.m2release$m2release/artifact/org.jvnet.hudson.plugins.m2release/m2release/0.7.0-SNAPSHOT/ What version of HUdson are you using?
          Hide
          hdave42 hdave42 added a comment -

          Hudson 1.384. Obtained a 0.7.0 hpi file from the link you mentioned. It was a Nov 10th Snapshot build.

          Show
          hdave42 hdave42 added a comment - Hudson 1.384. Obtained a 0.7.0 hpi file from the link you mentioned. It was a Nov 10th Snapshot build.
          Hide
          teilo James Nord added a comment -

          Something fishy...

          Show
          teilo James Nord added a comment - Something fishy...
          Hide
          teilo James Nord added a comment -

          from the system dump maven.home is being set correctly which should get passed to the release plugin to control the forked maven executor..

          maven.home=/opt/hudson_home/tools/Maven_2.2.1

          http://maven.apache.org/plugins/maven-release-plugin/perform-mojo.html#mavenHom
          it even looks like java.home is set correctly...

          Show
          teilo James Nord added a comment - from the system dump maven.home is being set correctly which should get passed to the release plugin to control the forked maven executor.. maven.home=/opt/hudson_home/tools/Maven_2.2.1 http://maven.apache.org/plugins/maven-release-plugin/perform-mojo.html#mavenHom it even looks like java.home is set correctly...
          Hide
          hdave42 hdave42 added a comment -

          Any progress on this? Anything else I can do to help? I really want to get this working! Thanks!!

          Show
          hdave42 hdave42 added a comment - Any progress on this? Anything else I can do to help? I really want to get this working! Thanks!!
          Hide
          teilo James Nord added a comment -

          I haven't been able to reproduce this on CentOS 5.3 with a very similar setup.

          I don't yet have an Ubuntu setup in which to test.

          Is this something that used to work for you and now doesn't or is this your first attempts at using m2release?

          have you disabled the tomcat security policy?

          Show
          teilo James Nord added a comment - I haven't been able to reproduce this on CentOS 5.3 with a very similar setup. I don't yet have an Ubuntu setup in which to test. Is this something that used to work for you and now doesn't or is this your first attempts at using m2release? have you disabled the tomcat security policy?
          Hide
          hdave42 hdave42 added a comment -

          It has never worked for me. This is a new Hudson install and I am just trying to get it working.

          I am running the Tomcat from the Ubuntu repositories. I have disabled the security manager (tried it both ways)....

          I do not have the M2_HOME env variable set anywhere....was assuming that Hudson sets the properly. I am using Hudson's installation of Maven 2.2.1 and all of my Maven builds on this machine work fine.

          Show
          hdave42 hdave42 added a comment - It has never worked for me. This is a new Hudson install and I am just trying to get it working. I am running the Tomcat from the Ubuntu repositories. I have disabled the security manager (tried it both ways).... I do not have the M2_HOME env variable set anywhere....was assuming that Hudson sets the properly. I am using Hudson's installation of Maven 2.2.1 and all of my Maven builds on this machine work fine.
          Hide
          teilo James Nord added a comment -

          I have managed to reproduce this if hudson installs maven.

          The quick workaround would be to install your own maven, however now I can reproduce the issue I will hopefully be able to get a quick fix.

          Show
          teilo James Nord added a comment - I have managed to reproduce this if hudson installs maven. The quick workaround would be to install your own maven, however now I can reproduce the issue I will hopefully be able to get a quick fix.
          Hide
          hdave42 hdave42 added a comment -

          Glad to hear it. I'll wait for the fix and test it as soon as a development build is available.

          Show
          hdave42 hdave42 added a comment - Glad to hear it. I'll wait for the fix and test it as soon as a development build is available.
          Hide
          teilo James Nord added a comment -

          I could only reproduce this if I have maven on the path or had set M2_HOME explictly.

          Show
          teilo James Nord added a comment - I could only reproduce this if I have maven on the path or had set M2_HOME explictly.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: James Nord
          Path:
          changelog.html
          maven-plugin/src/main/java/hudson/maven/MavenBuild.java
          maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
          http://jenkins-ci.org/commit/core/b0b06b515ba4471a1ec6fec77d96efc71935b2b9
          Log:
          [FIXED JENKINS-8092]
          Set M2_Home for maven builds and add maven to the path so if the build
          needs to run maven from maven (or maven from ant from maven) it can.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: James Nord Path: changelog.html maven-plugin/src/main/java/hudson/maven/MavenBuild.java maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java http://jenkins-ci.org/commit/core/b0b06b515ba4471a1ec6fec77d96efc71935b2b9 Log: [FIXED JENKINS-8092] Set M2_Home for maven builds and add maven to the path so if the build needs to run maven from maven (or maven from ant from maven) it can.
          Hide
          dogfood dogfood added a comment -

          Integrated in jenkins_main_trunk #542
          [FIXED JENKINS-8092]

          James Nord : b0b06b515ba4471a1ec6fec77d96efc71935b2b9
          Files :

          • maven-plugin/src/main/java/hudson/maven/MavenBuild.java
          • changelog.html
          • maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
          Show
          dogfood dogfood added a comment - Integrated in jenkins_main_trunk #542 [FIXED JENKINS-8092] James Nord : b0b06b515ba4471a1ec6fec77d96efc71935b2b9 Files : maven-plugin/src/main/java/hudson/maven/MavenBuild.java changelog.html maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: James Nord
          Path:
          changelog.html
          maven-plugin/src/main/java/hudson/maven/MavenBuild.java
          maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
          http://jenkins-ci.org/commit/core/b0b06b515ba4471a1ec6fec77d96efc71935b2b9
          Log:
          [FIXED JENKINS-8092]
          Set M2_Home for maven builds and add maven to the path so if the build
          needs to run maven from maven (or maven from ant from maven) it can.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: James Nord Path: changelog.html maven-plugin/src/main/java/hudson/maven/MavenBuild.java maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java http://jenkins-ci.org/commit/core/b0b06b515ba4471a1ec6fec77d96efc71935b2b9 Log: [FIXED JENKINS-8092] Set M2_Home for maven builds and add maven to the path so if the build needs to run maven from maven (or maven from ant from maven) it can.
          Hide
          teilo James Nord added a comment -

          hdave42 - can you confirm the fix is working?

          Show
          teilo James Nord added a comment - hdave42 - can you confirm the fix is working?
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: James Nord
          Path:
          src/main/java/hudson/maven/MavenBuild.java
          src/main/java/hudson/maven/MavenModuleSetBuild.java
          http://jenkins-ci.org/commit/maven-plugin/4e6dd1d545862ad2ae1f1d1ec17351235f64ad19
          Log:
          [FIXED JENKINS-8092]
          Set M2_Home for maven builds and add maven to the path so if the build
          needs to run maven from maven (or maven from ant from maven) it can.

          Originally-Committed-As: b0b06b515ba4471a1ec6fec77d96efc71935b2b9

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: James Nord Path: src/main/java/hudson/maven/MavenBuild.java src/main/java/hudson/maven/MavenModuleSetBuild.java http://jenkins-ci.org/commit/maven-plugin/4e6dd1d545862ad2ae1f1d1ec17351235f64ad19 Log: [FIXED JENKINS-8092] Set M2_Home for maven builds and add maven to the path so if the build needs to run maven from maven (or maven from ant from maven) it can. Originally-Committed-As: b0b06b515ba4471a1ec6fec77d96efc71935b2b9

            People

            • Assignee:
              teilo James Nord
              Reporter:
              hdave42 hdave42
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: