github.com/jaylevin/jenkins-library@v1.230.4/documentation/docs/steps/mavenExecute.md (about) 1 # ${docGenStepName} 2 3 ## ${docGenDescription} 4 5 ## ${docGenParameters} 6 7 !!! note "Breaking change in `goals`, `defines` and `flags` parameters" 8 The `goals`, `defines` and `flags` parameters of the step need to be lists of strings with each element being one item. 9 10 As an example consider this diff, showing the old api deleted and the new api inserted: 11 12 ```diff 13 -goals: 'org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate', 14 -defines: "-Dexpression=$pomPathExpression -DforceStdout -q", 15 +goals: ['org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate'], 16 +defines: ["-Dexpression=$pomPathExpression", "-DforceStdout", "-q"], 17 ``` 18 19 Additionally please note that in the parameters _must not_ be [shell quoted/escaped](https://www.tldp.org/LDP/Bash-Beginners-Guide/html/sect_03_03.html). 20 What you pass in is literally passed to Maven without any shell interpreter in between. 21 22 The old behavior is still available in version `v1.23.0` and before of project "Piper". 23 24 ## ${docGenConfiguration} 25 26 ## ${docJenkinsPluginDependencies} 27 28 ## Exceptions 29 30 None 31 32 ## Example 33 34 ```groovy 35 mavenExecute script: this, goals: ['clean', 'install'] 36 ``` 37 38 Example for the correct usage of `goals`, `defines` and `flags` in version `v1.24.0` and newer: 39 40 ```groovy 41 mavenExecute( 42 script: script, 43 goals: ['org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate'], 44 defines: ["-Dexpression=$pomPathExpression", "-DforceStdout", "-q"], 45 returnStdout: true 46 ) 47 ``` 48 49 Note that it does not work to put multiple arguments into one element of a list, so `defines: ["-Dexpression=$pomPathExpression -DforceStdout -q"]` does **not** work.