Running mvn exec:java from a remote directory not containing the pom.xml
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.
精彩评论