如何为特定包创建jar?

发布于 2024-12-25 20:15:13 字数 83 浏览 6 评论 0原文

我有一个 Maven 桌面项目,它由多个包组成,我想知道是否可以将其中一个包提取为单独的 jar,这样我就可以重用它,而不是创建一个仅包含该包的新项目?

i have a maven desktop project, and it consists of several packages, and i was wondering if it's possible to extract one of the packages as a separate jar, so i can reuse it, instead of making a new project that contains only this package ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

も星光 2025-01-01 20:15:13

您可以在 中使用 includes 参数maven jar 插件来实现这一点。事实上 使用页面 有一个关于如何执行此操作的示例。

您可以在配置文件中执行此操作,以便您可以继续使用所有类构建正常项目。

You could use the includes parameter in the maven jar plugin to achieve this. In fact the usage page has an example on how to do this.

You could do this within a profile so that you can continue to build the normal project with all classes.

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