我有一个内置在'/ some/where'的maven项目,我希望从另一个目录'/ foo/bar'运行/执行.我目前正在运行如下命令:
cd /some/where
mvn exec:java -Dexec.mainClass=org.xmlcml.cml.rest.Client
Run Code Online (Sandbox Code Playgroud)
同
/some/where/pom.xml
Run Code Online (Sandbox Code Playgroud)
我希望做的事情如下:
cd /foo/bar
mvn -p /some/where/pom.xml exec:java -Dexec.mainClass=org.xmlcml.cml.rest.Client
Run Code Online (Sandbox Code Playgroud)
但不知道语法或是否允许.
如果允许,相对文件名在哪里引用(a)包含pom.xml的目录,即/some/where或(b)当前目录/foo/bar
试试这个:
mvn -f /some/where/pom.xml exec:java -Dexec.mainClass=org.xmlcml.cml.rest.Client
Run Code Online (Sandbox Code Playgroud)
要找出maven命令行选项:
mvn --help
Run Code Online (Sandbox Code Playgroud)
如果允许,相对文件名在哪里引用(a)包含pom.xml的目录,即/ some/where或(b)当前目录/ foo/bar
POM文件中的相对路径名相对于包含POM的目录进行解析.
| 归档时间: |
|
| 查看次数: |
1744 次 |
| 最近记录: |