如何从maven程序集插件中排除依赖项:jar-with-dependencies? [英] How to exclude dependencies from maven assembly plugin : jar-with-dependencies?

查看:2144
本文介绍了如何从maven程序集插件中排除依赖项:jar-with-dependencies?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Maven的程序集插件可以创建一个大jar,包括所有依赖于descriptorRef jar-with-dependencies

Maven's assembly plugin enables the creation of a big jar including all dependencies with descriptorRef jar-with-dependencies.

如何排除某些依赖关系?好像它没有这样的配置?还有其他解决方案吗?

How can one exclude some of these dependencies? It seems like it does not have such a configuration? Is there another solution?

推荐答案

example 表示一种方法:

 <dependencySets>
    <dependencySet>
      ....
      <excludes>
        <exclude>commons-lang:commons-lang</exclude>
        <exclude>log4j:log4j</exclude>
      </excludes>
    </dependencySet>
    ....
  </dependencySets>

基本上我们会使用排除选项在 dependencySet

Essentially we would use the excludes option available in dependencySet.

参见: https://maven.apache.org/plugins/maven-assembly-plugin/assembly-component.html

这篇关于如何从maven程序集插件中排除依赖项:jar-with-dependencies?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆