Skip to content

[JENKINS-61177] "Accessing steps" again. Now "No tool named Maven found" #380

Description

@jenkins-infra-bot

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

class Utilities implements Serializable {
     def steps     Utilities(steps) {{color:#43}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?


Originally reported by gek, imported from: "Accessing steps" again. Now "No tool named Maven found"
  • status: Open
  • priority: Minor
  • component(s): workflow-cps-global-lib-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 20251212-090250
Raw content of original issue

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions