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

Ant configuration lost after upgrading to 1.417 and modifying existing job

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • ant-plugin
    • None

      I updated Jenkins from 1.413? to 1.417 and associated static analysis (checkstyle) plugins.
      I changed one of my jobs to report checkstyle.
      When I ran it it told me it couldn't find ant.

      When I checked the job history, the ant version was removed.

      <hudson.tasks.Ant>
      <targets>continuous_integration</targets>

      • <antName>ant_1.7.1</antName>
        <antOpts>-Xms1024m -Xmx1024m</antOpts>
        <buildFile>build.Jenkins.xml</buildFile>

      Looking at the job config page, there is no longer an option to specify which ant version is desired.
      The config Jenkins page still showed the and install being available, but there was no way to re?-pick it for the job.

          [JENKINS-10056] Ant configuration lost after upgrading to 1.417 and modifying existing job

          On the manage Jenkins -> Configure System, there is no longer a way to specify an existing local ant installation (path)!

          Greg Moncreaff added a comment - On the manage Jenkins -> Configure System, there is no longer a way to specify an existing local ant installation (path)!

          We face a similar problem with 1.418.

          In our case, the <antName> information was removed from the jobs's config.xml .

          We have several Ant implementations on the machine,
          and we prever not to set any environment variables pointing at any particular one.

          Jenkins needs to know only one of these, so we configured that.

          Previously, Jenkins found the Ant installation and ran the builds.
          Now, it does no longer find Ant, but gives the error message:

          $ cmd.exe /C '"ant.bat -file build.xml && exit %%ERRORLEVEL%%"'
          'ant.bat' is not recognized as an internal or external command,
          operable program or batch file.
          Build step 'Invoke Ant' marked build as failure

          Our workaround:

          Open the job's config.xml file in an editor
          and add, in our case, the <antName></antName> line:

          <hudson.tasks.Ant>
          <targets></targets>
          <antName>Ant 1.8.2</antName>
          <buildFile>foo/bar/build.xml</buildFile>
          </hudson.tasks.Ant>

          Then reload the configuration from disk.

          Andreas Krüger added a comment - We face a similar problem with 1.418. In our case, the <antName> information was removed from the jobs's config.xml . We have several Ant implementations on the machine, and we prever not to set any environment variables pointing at any particular one. Jenkins needs to know only one of these, so we configured that. Previously, Jenkins found the Ant installation and ran the builds. Now, it does no longer find Ant, but gives the error message: $ cmd.exe /C '"ant.bat -file build.xml && exit %%ERRORLEVEL%%"' 'ant.bat' is not recognized as an internal or external command, operable program or batch file. Build step 'Invoke Ant' marked build as failure Our workaround: Open the job's config.xml file in an editor and add, in our case, the <antName></antName> line: <hudson.tasks.Ant> <targets></targets> <antName>Ant 1.8.2</antName> <buildFile>foo/bar/build.xml</buildFile> </hudson.tasks.Ant> Then reload the configuration from disk.

          Jenkins 1.415 does not have this problem.

          Andreas Krüger added a comment - Jenkins 1.415 does not have this problem.

            Unassigned Unassigned
            moncreaff Greg Moncreaff
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: