是否可以构建一个包含 jar 和依赖项的 zip 发行版?
我想为我的项目生成一个二进制 zip 发行版,其中包含一个 uber jar 和一组脚本。现在,我使用两个描述符,第一个用于 uber jar,第二个用于包含 uberjar + 额外脚本和文档的 zip。问题是这两个都部署到 Maven 存储库,而我实际上不需要 uberjar,只需要发行版。有没有办法:
- 使用一个描述符创建发行版或
- 避免部署 uberjar?
I would like to produce a binary zip distribution of my project that would contain an uber jar and a set of scripts. Right now, I am using two descritors, first one for the uber jar, and the second for the zip that contains the uberjar + extra scripts and documentation. The problem is that both of these get deployed to maven repo, while I don't actually need the uberjar, only the distro. Is there any way to either:
- create the distro using one descriptor or
- avoid the uberjar being deployed?
Edit: I found this question regarding part 2, but perhaps there is an easier way to do it...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在我看来,最简单的方法是在一个模块中创建 uberjar(设置
skip
maven-deploy-plugin 配置中的可选参数,以在deploy
期间绕过它)并在另一个模块中创建 zip 发行版(使用对先前创建的程序集的依赖关系,如 通过程序集依赖关系组装程序集)。这与您已经拥有的非常接近,这是个好消息。In my opinion, the easiest way is to create the uberjar in one module (set the
skip
optional parameter in the maven-deploy-plugin configuration to bypass it duringdeploy
) and to create the zip distribution in another module (using a dependency on the previously created assembly as described in Assembling Assemblies via Assembly Dependencies). And that's very close to what you already have which is good news.