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

Windows: Maven executable not found: mvn.bat

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      I am running Jenkins windows slave and have installed maven 3.5.2 but when switching to this version in Jenkins, the job fails with the following error

      Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.4.2:prepare (default-cli) on project dp-svc-pom: Failed to invoke Maven build. Error configuring command-line. Reason: Maven executable not found at: D:\jenkins\tools\maven\apache-maven-jenkins-3.5.2\bin\mvn.bat
      

      The problem seems to be that latest maven ships with windows script files ending with .cmd rather than .bat so that's why the plugin does not find the mvn.bat. Changing the file extension from .cmd to .bat fixes the problem.

      However I think it would be good if the plugin checks for both .bat and .cmd in case .bat is not found.

        Attachments

          Activity

          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          IIUC it is not related to the Jenkins' Maven Plugin.
          You just need to define a newer version of Maven Release Plugin in your pom.xml: https://stackoverflow.com/questions/29755620/failed-to-execute-goal-maven-releaseprepare

          Show
          oleg_nenashev Oleg Nenashev added a comment - IIUC it is not related to the Jenkins' Maven Plugin. You just need to define a newer version of Maven Release Plugin in your pom.xml: https://stackoverflow.com/questions/29755620/failed-to-execute-goal-maven-releaseprepare
          Hide
          papanito Adrian Wyssmann added a comment -

          Oleg Nenashev yes you are right, thanks for the reference

          Show
          papanito Adrian Wyssmann added a comment - Oleg Nenashev yes you are right, thanks for the reference

            People

            • Assignee:
              Unassigned
              Reporter:
              papanito Adrian Wyssmann
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: