I'm using below configuration to copy the system dependencies in maven.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/lib</outputDirectory>
<includeScope>system</includeScope>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
</plugin>
on "mvn package goal" , the strange thing is happening .
I can see all the system dependencies in "${project.build.directory}/${project.build.finalName}/WEB-INF/lib" target directory as configured in maven-dependency-plugin. But those dependencies are missing in war file.
Can someone please share the ideas ?
Try configuring the maven-war-plugin
like this:
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<packagingIncludes>WEB-INF/lib/*.jar</packagingIncludes>
</configuration>
</plugin>
If doesn't help, then I guess Kristoffer E is right: your war is packaged before the dependencies are copied. In that case you should change the phase from package
to process-sources
in the maven-dependency-plugin
so it will be executed earlier.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With