-
Bug
-
Resolution: Fixed
-
Minor
-
Pipeline: Model Definition 1.1.4
I have a parameter called JDK_TOOL and would like to use the parameter inside of my declarative pipeline tools definition but this script does not work:
pipeline { agent any tools { jdk "${params.JDK_TOOL}" } stages { stage('Example') { steps { sh 'jdk --version' } } } }
I get an error which says:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: WorkflowScript: 7: Tool type "jdk" does not have an install of ""${params.JDK_TOOL}"" configured - did you mean "TEST2"? @ line 7, column 5. jdk "${params.JDK_TOOL}"
so it does not seem to actually parse the variable at all(and adds the " as well)
- links to