简体   繁体   English

排除从父 pom 继承的子 pom 中的依赖项

[英]Exclude dependency in child pom inherited from parent pom

In my parent pom xml file I have declared some dependencies that are used in most of the children's poms.在我的父 pom xml 文件中,我声明了一些在大多数孩子的 pom 中使用的依赖项。

However, in one child pom, I don't use these dependencies and I want to find a way in order to exclude them (in order not to be seen as unused dependencies).但是,在一个子 pom 中,我不使用这些依赖项,我想找到一种方法来排除它们(以免被视为未使用的依赖项)。

Right now, in de dependencies section of child pom I have nothing?现在,在子 pom 的 de dependencies 部分我什么都没有? Any ideas?有任何想法吗?

AFAIK there is no way to exclude them. AFAIK 没有办法排除它们。

You can, though, define exceptions in the maven dependency plugin so that they do not appear as "unused".但是,您可以在 maven 依赖插件中定义异常,以便它们不会显示为“未使用”。 For that, see为此,请参阅

http://maven.apache.org/plugins/maven-dependency-plugin/analyze-mojo.html http://maven.apache.org/plugins/maven-dependency-plugin/analyze-mojo.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM