是否可以构建一个包含 jar 和依赖项的 zip 发行版?

发布于 2024-08-24 16:26:29 字数 424 浏览 11 评论 0原文

我想为我的项目生成一个二进制 zip 发行版,其中包含一个 uber jar 和一组脚本。现在,我使用两个描述符,第一个用于 uber jar,第二个用于包含 uberjar + 额外脚本和文档的 zip。问题是这两个都部署到 Maven 存储库,而我实际上不需要 uberjar,只需要发行版。有没有办法:

  • 使用一个描述符创建发行版或
  • 避免部署 uberjar?

编辑:我发现这个问题< /a> 关于第 2 部分,但也许有更简单的方法......

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无敌元气妹 2024-08-31 16:26:29

在我看来,最简单的方法是在一个模块中创建 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 during deploy) 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文