我尝试使用maven-depdency-plugin
列出在POM的dependencyManagement
部分中声明的依赖项。
示例:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<excludeTypes>war</excludeTypes>
<includeScope>runtime</includeScope>
<excludeScope>provided</excludeScope>
</configuration>
<executions>
<execution>
<id>list</id>
<phase>validate</phase>
<goals>
<goal>list</goal>
</goals>
<configuration>
<sort>true</sort>
<outputFile>${project.build.directory}/dependencies.txt</outputFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
但是当我运行mvn validate
时,生成的文件为空:
The following files have been resolved:
none
该插件仅适用于POM的dependencies
部分?