如何为特定包创建jar?
我有一个 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在 中使用
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.