Reputation: 8009
I can execute a pom.xml with goals using AntBuilder like so.
def ant = new AntBuilder()
ant.sequential {
exec(executable:'mvn') {
arg(value:'clean')
arg(value:'install')
}
}
But how do I specify the execution directory to the AntBuilder? I'd like to just pass an absolute path.
For the record I've tried.
ant.project.setProperty('basedir', "${serviceRootDir}/")
and
ant.sequential {
mkdir(dir:"${serviceRootDir}/")...
You'd think this would be clear in the doc.
Upvotes: 1
Views: 821
Reputation: 9868
This works for me:
ant.exec(executable:"ls", dir:"/your/desired/directory")
It executes ls
in the given directory, so mvn
should work.
Upvotes: 2