Maven:指定 outputDirectory 仅用于打包 jar? [英] Maven: specify the outputDirectory only for packaging a jar?
本文介绍了Maven:指定 outputDirectory 仅用于打包 jar?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何仅指定用于打包 jar 的 outputDirectory?
How can I specify the outputDirectory only for packaging a jar?
http://maven.apache.org/plugins/maven-jar-plugin/jar-mojo.html 这显示了所有参数,但我如何在命令行或 pom.xml 中设置它们?
http://maven.apache.org/plugins/maven-jar-plugin/jar-mojo.html this shows all parameters, but how can I set them in the commandline or pom.xml?
推荐答案
在命令行
-DoutputDirectory=<path>
在 pom.xml 中
and in pom.xml
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<outputDirectory>/my/path</outputDirectory>
</configuration>
</plugin>
</plugins>
</build>
这篇关于Maven:指定 outputDirectory 仅用于打包 jar?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文