开发者

Running mvn exec:java from a remote directory not containing the pom.xml

开发者 https://www.devze.com 2023-01-20 09:38 出处:网络
I have a maven project built in \'/some/where\' which I wish to run/execute from another directory \'/foo/bar\'. I am currently running commands such as:

I have a maven project built in '/some/where' which I wish to run/execute from another directory '/foo/bar'. I am currently running commands such as:

cd /some/where
mvn exec:java -Dexec.mainClass=org.xmlcml.cml.rest.Client 

with

/some/where/pom.xml

I wish to do something like:

cd /foo/bar
mvn -p /some/where/pom.xml exec:java -Dexec.mainClass=org.xmlcml.cml.rest.Client 

but don't kno开发者_StackOverflow中文版w the syntax or whether it is allowed.

If it is allowed where are relative filenames referenced to (a) the directory containing the pom.xml , i.e. /some/where or (b) the current directory /foo/bar


Try this:

mvn -f /some/where/pom.xml exec:java -Dexec.mainClass=org.xmlcml.cml.rest.Client

To find out the maven command line options:

mvn --help

If it is allowed where are relative filenames referenced to (a) the directory containing the pom.xml , i.e. /some/where or (b) the current directory /foo/bar

Relative pathnames in POM file are resolved relative to the directory containing the POM.

0

精彩评论

暂无评论...
验证码 换一张
取 消