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

"Accessing steps" again. Now "No tool named Maven found"

    Details

    • Similar Issues:

      Description

      I trying to use an example from docs . Copy and paste both of

      class Utilities implements Serializable {
           def steps     Utilities(steps) {{color:#000043}this.steps = steps}
           def mvn(args) {
           steps.sh "${steps.tool 'Maven'{color}}/bin/mvn -o ${args}"     }
      }

      and

      @Library('lib@trunk/pipelines/jlib/trunk') _
      import derivative.Utilities
      def utils = new Utilities(this)
      node {
           stage ('some') {
           utils.mvn 'clean package'    }
      }

      and then get the following output:

      ERROR: No tool named Maven found

      I have tried to susbstitute 'Maven' to 'git' , because i'd like to pass git into shared lib. But getting same message:

      ERROR: No tool named git found

      I cannot understand, what exactly is steps.sh? Is it bash script?

        Attachments

          Activity

          Hide
          gek gek added a comment - - edited

          looks like it must not be a

          steps.sh "${steps.tool 'Maven'{color}}/bin/mvn -o ${args}"

          but

          this.steps.sh "${steps.tool 'Maven'{color}}/bin/mvn -o ${args}"

          or, in my case

          this.steps.git

          there is need to fix documentation.

          Show
          gek gek added a comment - - edited looks like it must not be a steps .sh " ${steps.tool 'Maven'{color}}/bin/mvn -o ${args} " but this. steps .sh " ${steps.tool 'Maven'{color}}/bin/mvn -o ${args} " or, in my case this. steps .git there is need to fix documentation.

            People

            • Assignee:
              Unassigned
              Reporter:
              gek gek
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: