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

withAnt - automatically use correct shell

    Details

    • Type: Improvement
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: ant-plugin, pipeline
    • Labels:
      None
    • Environment:
      Jenkins 2.226
    • Similar Issues:

      Description

      The declarative pipeline offers the withAnt build step. Unfortunately this only sets up the Ant environment and then uses a shell (bat / sh) to execute Ant within that environment.

      While the work-around as documented on https://plugins.jenkins.io/ant/ works:

      withAnt(installation: 'myinstall') {
          dir("scoring") {
          if (isUnix()) {
            sh "ant mytarget"
          } else {
            bat "ant mytarget"
          }
      }
      

      Needing to detect the operating system for a tool that works on all operating systems is plain clunky and immediately raises the difficulty bar when migrating from freestyle jobs. Freestyle jobs allow you to simply use Ant without you having to worry about which operating system is being used.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              smd Stefan Drissen
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: