我在显示/更新版本时尝试排除包失败,但我不明白为什么。
我有一个项目:
<groupId>my.group</groupId>
<artifactId>parent-pom</artifactId>
<packaging>pom</packaging>
<version>1.0</version>
在 pluginManagement 部分声明:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<excludes>
<exclude>com.atlassian.confluence:confluence:*</exclude>
</excludes>
<generateBackupPoms>false</generateBackupPoms>
<allowSnapshots>false</allowSnapshots>
</configuration>
</plugin>
第二个插件将上述内容作为父级:
<parent>
<groupId>my.group</groupId>
<artifactId>parent-pom</artifactId>
<version>1.0</version>
</parent>
但是当我调用 mvn versions:display-dependencies-update 时,它仍然报告
com.atlassian.confluence:confluence ..... 5.10.1 -> 6.0.0-viqueen-m001
如果我在配置中使用规则集,则会收到找不到文件的错误(因为它位于父 pom 文件夹中)并且无法复制/共享导致父级打包 pom.xml 文件。
我既不能使用 -DexcludesList 也不能<excludes>
用<excludesList>
. 我只能假设我在 group:artifact 中有错字,但我已经复制了很多次以避免这种情况。
除了在网络中有规则集之外还有什么想法吗?
编辑:根据评论有效 pom 是
<pluginManagement>
.
.
.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<includes>
<include>my.group</include>
</includes>
<excludes>
<exclude>com.atlassian.confluence:confluence:*</exclude>
</excludes>
<generateBackupPoms>false</generateBackupPoms>
<allowSnapshots>false</allowSnapshots>
</configuration>
</plugin>
</pluginManagement>
并且版本在其他任何地方都没有提到