我有Maven Eclipse Java项目。我想要求 maven 将所有必需的库复制到aaa
文件夹中Eclipse->Run->Run as->Maveven build-> package
过程中。我为此目的配置了插件:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/aaa</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
</executions>
</plugin>
但看起来添加此插件在打包过程中不执行任何操作,也不会创建文件夹和文件。如何解决这个问题?
配置看起来不错。确保它位于 POM 的<build><plugins>
区域,而不是在<pluginManagement>
中。