maven:如何将输出jar放入另一个文件夹 [英] maven: how to place the output jar into another folder
本文介绍了maven:如何将输出jar放入另一个文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将输出jar和jar-with-dependencies放入另一个文件夹(不在 target /
中,但在 ../ libs /
)
I'd like to place my output jar and jar-with-dependencies into another folder (not in target/
but in ../libs/
)
我该怎么做?
推荐答案
为此,您可以使用maven-jar-plugin的 outputDirectory 参数:
You can use the outputDirectory parameter of the maven-jar-plugin for this purpose:
<project>
...
<build>
<plugins>
...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<outputDirectory>../libs</outputDirectory>
</configuration>
</plugin>
...
</plugins>
</build>
...
</project>
但是正如cdegroot写的那样,你最好不要对抗maven方式。
But as cdegroot wrote, you should probably better not fight the maven way.
这篇关于maven:如何将输出jar放入另一个文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文