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

Windows systems need ant.bat and mvn.bat in PATH

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Won't Fix
    • Component/s: other
    • Labels:
      None
    • Environment:
      Platform: All, OS: All
    • Similar Issues:

      Description

      ... or else it fails to find default Ant and Maven.

        Attachments

          Activity

          kohsuke Kohsuke Kawaguchi created issue -
          Hide
          kohsuke Kohsuke Kawaguchi added a comment -

          See http://hudson.sfbay/job/jsr224-2.2/76/ for an instance of such error.
          The symptom is:

          ----------------
          [api] $ cmd.exe /C '"ant.bat revised-dist && exit %%ERRORLEVEL%%"'
          'ant.bat' is not recognized as an internal or external command,
          operable program or batch file.
          ----------------

          This works on Unix, because /files/hudson/tools is in PATH and this contains a
          symlink of ant.

          Show
          kohsuke Kohsuke Kawaguchi added a comment - See http://hudson.sfbay/job/jsr224-2.2/76/ for an instance of such error. The symptom is: ---------------- [api] $ cmd.exe /C '"ant.bat revised-dist && exit %%ERRORLEVEL%%"' 'ant.bat' is not recognized as an internal or external command, operable program or batch file. ---------------- This works on Unix, because /files/hudson/tools is in PATH and this contains a symlink of ant.
          Hide
          kohsuke Kohsuke Kawaguchi added a comment -

          Adding Jitu, the real reporter.

          Show
          kohsuke Kohsuke Kawaguchi added a comment - Adding Jitu, the real reporter.
          Hide
          kohsuke Kohsuke Kawaguchi added a comment -

          No longer maintaining hudson.sfbay

          Show
          kohsuke Kohsuke Kawaguchi added a comment - No longer maintaining hudson.sfbay
          kohsuke Kohsuke Kawaguchi made changes -
          Field Original Value New Value
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Won't Fix [ 2 ]
          Hide
          ostraaten Onno van der Straaten added a comment -

          If we are not going to fix this issue, what is the purpose of specifying Ant installation (ANT_HOME)? It won't be picked up/used so it would be better to remove it?

          I have this problem with Jenkins 1.491 on MS Windows Server 2008 R2

          Show
          ostraaten Onno van der Straaten added a comment - If we are not going to fix this issue, what is the purpose of specifying Ant installation (ANT_HOME)? It won't be picked up/used so it would be better to remove it? I have this problem with Jenkins 1.491 on MS Windows Server 2008 R2
          Hide
          jordi Jordi Gil added a comment -

          Onno,

          I managed to get it working on my environment. Here is what I did:

          1. Added the %ANT_HOME%\bin; into the system path, but added it in the beginning (you can safely add it as the second or third, but I found that appending it at the end of the path didn't work, can't say why.
          2. You can test that works by opening a CMD.exe shell and executing "cmd /C 'ant.bat'" anywhere but in the %ANT_HOME%\bin directory. If it find the ant.bat then you're already 50% there. If not, then the problem is that CMD.exe cannot find the %ANT_HOME%\bin directory. Keep retrying until it gets it right.
          3. If the job keeps complaining it cannot find the ant.bat after this, then remove the slave and add it again. I tried to disconnect it but it didn't work. You can check the system path through the node console println System.getenv("PATH") and make sure that you can see the %ANT_HOME%\bin listed as the first or following, but not at the end of the string.

          Cheers,

          /Jordi

          Show
          jordi Jordi Gil added a comment - Onno, I managed to get it working on my environment. Here is what I did: Added the %ANT_HOME%\bin; into the system path, but added it in the beginning (you can safely add it as the second or third, but I found that appending it at the end of the path didn't work, can't say why. You can test that works by opening a CMD.exe shell and executing "cmd /C 'ant.bat'" anywhere but in the %ANT_HOME%\bin directory. If it find the ant.bat then you're already 50% there. If not, then the problem is that CMD.exe cannot find the %ANT_HOME%\bin directory. Keep retrying until it gets it right. If the job keeps complaining it cannot find the ant.bat after this, then remove the slave and add it again. I tried to disconnect it but it didn't work. You can check the system path through the node console println System.getenv("PATH") and make sure that you can see the %ANT_HOME%\bin listed as the first or following, but not at the end of the string. Cheers, /Jordi
          ircbot Jenkins IRC Bot made changes -
          Component/s other [ 15490 ]
          Component/s hudson.sfbay [ 15590 ]
          rtyler R. Tyler Croy made changes -
          Workflow JNJira [ 132801 ] JNJira + In-Review [ 201675 ]

            People

            • Assignee:
              kohsuke Kohsuke Kawaguchi
              Reporter:
              kohsuke Kohsuke Kawaguchi
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: