Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Maven 指定Groovy AntBuilder执行目录_Maven_Groovy_Antbuilder - Fatal编程技术网

Maven 指定Groovy AntBuilder执行目录

Maven 指定Groovy AntBuilder执行目录,maven,groovy,antbuilder,Maven,Groovy,Antbuilder,我可以像这样使用AntBuilder执行pom.xml和目标 def ant = new AntBuilder() ant.sequential { exec(executable:'mvn') { arg(value:'clean') arg(value:'install') } } 但是如何为AntBuilder指定执行目录呢?我只想通过一条绝对路径 我已经试过了 ant.project.setProperty('basedir', "${s

我可以像这样使用AntBuilder执行pom.xml和目标

def ant = new AntBuilder()
ant.sequential {
    exec(executable:'mvn') {
        arg(value:'clean')
        arg(value:'install')
    }
}
但是如何为AntBuilder指定执行目录呢?我只想通过一条绝对路径

我已经试过了

ant.project.setProperty('basedir', "${serviceRootDir}/")

你会认为这在文件中会很清楚。

这对我来说很有用:

ant.exec(executable:"ls", dir:"/your/desired/directory")
它在给定目录中执行
ls
,因此
mvn
应该可以工作

ant.exec(executable:"ls", dir:"/your/desired/directory")