Question

this is similar to this question but with a twist.

I have a jar in a remote maven repository. This jar is actually a applet that gets run in the web browser. So it needs to get copied into webapp/resources/ directory.

I'm trying to use the maven-war-plugin to copy it and I'm so close but I can't seem to get the syntax quite right since the jar is just in the local m2 directory and not really inside the build directory at all (although I believe it is in the resulting war.)

Was it helpful?

Solution

The dependency plugin can copy artifacts by maven coordinate from a repository (local or remote) to arbitrary directories. Just add an execution of it somewhere before your war is built to copy the jar to an appropriate place.

OTHER TIPS

Try the copy task of the maven resources plugin. This will let you call out your jar just like you do a dependency, but it will copy it wherever you like so that it can be included in your war.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top