Maven插件及其在父pom中定义的依赖关系,我不希望我的孩子pom包含该插件依赖项。
例如,如果有1个父级和100个子级,则99使用该插件并希望在一个子级中排除该插件。
我们怎样才能实现这一目标?
答案 0 :(得分:0)
I found the answer. In parent pom, we should include child details as in below to remove this plugin dependency in child.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<configuration>
<classpathDependencyExcludes>
<classpathDependencyExclude>${child-dependency-groupId}:${child-dependency-artifactId}</classpathDependencyExclude>
</classpathDependencyExcludes>
</configuration>
</plugin>
</plugins>
答案 1 :(得分:0)
您应该在<plugins>
<pluginManagement>
部分配置插件
有关详细信息,请参阅https://maven.apache.org/pom.html#Plugin_Management