当我开始执行以下命令时,要检测重复的依赖项
mvn dependency:analyze-duplicate
Maven返回以下错误消息
[ERROR] Could not find goal 'analyze-duplicate' in plugin org.apache.maven.plugins:maven-dependency-plugin:2.1 among available goals unpack-dependenci
es, go-offline, copy-dependencies, analyze-dep-mgt, list, purge-local-repository, help, get, build-classpath, sources, analyze-report, analyze, tree,
unpack, resolve, copy, analyze-only, resolve-plugins -> [Help 1]
我很惊讶地读到插件版本为2.1
的消息,因为在我的POM中有以下几行,您可以看到该版本为3.1.1
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<id>copy</id>
<phase>generate-sources</phase>
<goals>
<goal>copy</goal>
</goals>
</execution>
</executions>
<configuration>
<artifactItems>
<artifactItem>
<groupId>com.company.xsd</groupId>
<artifactId>tlga-tests</artifactId>
<type>xsd</type>
<outputDirectory>
${xsd.external.location}
</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
<!-- other configurations here -->
</plugin>
我已经安装了Maven 3.5.4。在我的PC上。
怎么了?
我已经在我的POM中添加了一个目标元素
<goal>analyze-duplicate</goal>
但没有任何改变。