![](/img/trans.png)
[英]maven-jar-plugin: How to create a different artifact name for tests?
[英]I have issues to create a second jar artifact with Maven jar plugin
只需在pom.xml中為要創建的工件(即jar)添加另一個<execution>
部分。 它看起來像這樣:
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<!-- your configuration for the 2nd jar -->
</configuration>
</execution>
</executions>
默認jar仍將與您自定義配置的jar一起構建,至少從文檔看來是如此,請告知我是否存在。
還可以考慮創建2個子項目,每個項目一個,並將代碼分成不同的包。 當您需要2個而不是1個罐子時,通常就是這種情況。 在此sonatype 博客文章中提供了更多信息。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.