用同一个Maven项目生成两个jar [英] Generate two jar with the same maven project

查看:103
本文介绍了用同一个Maven项目生成两个jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当执行mvn全新安装时,我想从同一个maven项目中生成两个jar. 这两个罐子之间的唯一区别是 META-INF 文件夹中的内容.

I would like to generate two jars from the same maven project when executing a mvn clean install. The only difference between the two jars, will be the content of the META-INF folder.

目前,我已经 my-app.jar ,我现在想拥有 my-jar-xxx.jar my-jar -yyy.jar . 我该如何实现?

For the moment, I've my-app.jar, I would like to have now my-jar-xxx.jar and my-jar-yyy.jar. How can I achieve this ?

致谢.

推荐答案

您不应从同一个Maven项目创建两个Maven jar.为什么?

You should not be creating two maven jars from the same maven project. Why? This sonatype blog post should explain.

同一篇文章还说明了您仍然可以通过两种方法进行操作

The same article also explains two ways in which you can still do it, if you want to

  • 使用个人资料
  • 通过执行两次maven jar插件

这也是与相关的 stackoverflow帖子.

Here is the related stackoverflow post as well.

这篇关于用同一个Maven项目生成两个jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆