我有以下插件配置:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<outputDirectory>${project.build.directory}/alternateLocation</outputDirectory>
</configuration>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
</execution>
</executions>
</plugin>当调用mvn dependency:copy-dependencies依赖项时,确实会在正确的位置(alternateLocation)复制依赖项。但是当我调用mvn package时,什么都不会执行。我错过了什么?
发布于 2021-09-16 20:25:55
根据documentation,您需要将configuration inside execution。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<!-- configure the plugin here -->
</configuration>
</execution>
</executions>
</plugin>发布于 2021-09-17 14:31:13
我们只能看到你的POM的一部分,但我猜你把插件放到了<pluginManagement>中,而不是放到了它所属的<plugins>中。
https://stackoverflow.com/questions/69214678
复制相似问题