Writes a
Maven project
file. That for example was previously read by readMavenPom
.
model
:
The Model
object to write.
file
:
Optional path to a file in the workspace to write to.
If left empty the step will write to pom.xml
in the current working directory.
Example:
def pom = readMavenPom file: 'pom.xml'
//Do some manipulation
writeMavenPom model: pom
Avoid using this step and readMavenPom
.
It is better to use the sh
step to run mvn
goals:
For example:
sh 'mvn versions:set-property -Dproperty=some-key -DnewVersion=some-value -DgenerateBackupPoms=false'