我想mvn dependency:analyze从命令行使用来手动检查依赖关系问题。问题是我找不到在pom.xml. 必须在命令行中提供所有参数。
所以我必须总是使用
mvn dependency:analyze -DignoreNonCompile
Run Code Online (Sandbox Code Playgroud)
什么,我缺少的是设定的方式ignoreNonCompile在pom.xml在插件配置。
像这样的东西:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>analyze</id>
<goals>
<goal>analyze</goal>
</goals>
<configuration>
<ignoreNonCompile>true</ignoreNonCompile>
</configuration>
</execution>
</executions>
</plugin>
Run Code Online (Sandbox Code Playgroud)
但这不起作用。
如果我使用
<goal>analyze-only</goal>
Run Code Online (Sandbox Code Playgroud)
然后在构建期间运行插件,并使用配置。但我不想让它在构建中运行,只能手动请求。并且手动运行不会遵守该参数。
我可以在pom.xmlnamed 中设置一个属性ignoreNonCompile,但这将在构建中设置此参数并手动运行。
有没有办法只配置 的行为mvn dependency:analyze?