How do you force maven to copy dependencies into target/lib?
Answer Posted / Shah Faisal Khan
"To force Maven to copy dependencies into the target/lib directory, you can use the "maven-dependency-plugin". Here's an example:
```
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.2</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
```
n
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers