force Maven to copy dependencies into target/lib
How do I get my project's runtime dependencies copied into the target/lib
folder?
As it is right now, after mvn clean install
the target
folder contains only my project's jar, but none of the runtime dependencies.
这适用于我:
<project>
...
<profiles>
<profile>
<id>qa</id>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
The best approach depends on what you want to do:
mvn install dependency:copy-dependencies
Works for me with dependencies directory created in target folder. Like it!
链接地址: http://www.djcxy.com/p/53316.html上一篇: 如何在Maven中配置编码?