[JIRA] (JENKINS-61177) "Accessing steps" again. Now "No tool named Maven found"

6 views
Skip to first unread message

rostergek@gmail.com (JIRA)

unread,
Feb 21, 2020, 6:02:03 AM2/21/20
to jenkinsc...@googlegroups.com
gek created an issue
 
Jenkins / Bug JENKINS-61177
"Accessing steps" again. Now "No tool named Maven found"
Issue Type: Bug Bug
Assignee: Unassigned
Components: workflow-cps-global-lib-plugin
Created: 2020-02-21 11:01
Priority: Minor Minor
Reporter: gek

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?

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

rostergek@gmail.com (JIRA)

unread,
Feb 21, 2020, 6:16:02 AM2/21/20
to jenkinsc...@googlegroups.com

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

rostergek@gmail.com (JIRA)

unread,
Feb 21, 2020, 8:26:02 AM2/21/20
to jenkinsc...@googlegroups.com
gek edited a comment on Bug JENKINS-61177
looks like it must not be a
{quote}{color:#008000} {color:#660e7a} steps{color}.sh {color:#008000}"{color}$\{steps.tool {color:#008000}'Maven'\{color}}/bin/mvn -o {color}${args}{color:#008000}"{color}
{ color}{ quote}
{color:#172b4d}but{color}
{quote}{color:#172b4d}
{color:#660e7a} this.{color}{color:#008000} {color:#008000}{color:#660e7a} steps{color}.sh {color:#008000}"{color}$\{steps.tool {color:#008000}'Maven'\{color}}/bin/mvn -o {color}${args}{color:#008000}"{color} {color}{color}{color}
{quote}
{color:#172b4d}or, in my case{color}
{quote}{color:#172b4d}
{color:#660e7a} this.{color}{color:#008000} {color:#008000}{color:#660e7a} steps{color}.git {color}{color}{color}
{quote}

*there is need to fix documentation.*

rostergek@gmail.com (JIRA)

unread,
Feb 21, 2020, 8:27:02 AM2/21/20
to jenkinsc...@googlegroups.com
gek updated an issue
 
Change By: gek
I trying to use an [ example | from [ docs| https://jenkins.io/doc/book/pipeline/shared-libraries/#accessing-steps] ]from docs . Copy and paste both of
{quote}{color:#000043}class {color}Utilities {color:#000043}implements {color}Serializable {
     {color:#000043}def {color}{color:#660e7a}steps
{color}     Utilities(steps) {{color:#000043}this{color}.{color:#660e7a}steps {color}= steps}
     {color:#000043}def {color}mvn(args) {
     {color:#660e7a}steps{color}.sh {color:#008000}"{color}$\{steps.tool {color:#008000}'Maven'{color}}{color:#008000}/bin/mvn -o {color}${args}{color:#008000}"
{color}     }
}{quote}
{quote}and{quote}
{quote}{color:#808000}@{color}Library({color:#008000}'lib@trunk/pipelines/jlib/trunk'{color}) _
{color:#000043}import {color}derivative.Utilities
{color:#000043}def {color}utils = {color:#000043}new {color}Utilities({color:#000043}this{color})
{color:#808080}
{color}node {
     stage ({color:#008000}'some'{color}) {
     utils.mvn {color:#008000}'clean package'
{color}    }
}{quote}

and then get the following output:
{quote}ERROR: No tool named Maven found
{quote}

I have tried to susbstitute 'Maven' to 'git' , because i'd like to pass git into shared lib. But getting same message:
{quote}ERROR: No tool named git found
{quote}
I cannot understand, what exactly is {color:#660e7a}steps{color}.sh? Is it bash script?
Reply all
Reply to author
Forward
0 new messages