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

Windows: Maven executable not found: mvn.bat

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • maven-plugin
    • Windows
      Jenkins 2.89.4
      Maven Integration Plugin: 3.1

      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.

            Unassigned Unassigned
            papanito papanito
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: