【问题标题】:Create every package as one jar file using maven in pom.xml i want source code使用 pom.xml 中的 maven 将每个包创建为一个 jar 文件我想要源代码
【发布时间】:2013-12-06 13:24:10
【问题描述】:

我需要为选定的包生成 jar 文件我是 maven 新手我可以为 src 文件夹创建 jar 但无法使用

  <include> 

  <exclude> 

标签。我花了将近 3 天的时间我没有得到解决方案。请通过提供好的解决方案或 pom.xml 文件帮助我。我想要示例代码

【问题讨论】:

  • 据我了解您的问题,您需要将某些软件包排除在编译和捆绑之外。根据我目前的理解,这是不可能的。您只能将 exclude/include 标记与“resources”一起使用,而不能与“sourceDirectory”一起使用。
  • 为什么要排除要打包成jar的包?为什么这些包中的类不相关?

标签: maven pom.xml


【解决方案1】:

查看Maven shaded plugin。尤其是指定 uber jar 内容的配置。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-05-16
    • 1970-01-01
    • 2016-08-21
    • 1970-01-01
    • 2012-04-19
    • 2021-04-01
    • 2022-07-19
    • 1970-01-01
    相关资源
    最近更新 更多