views:

64

answers:

1

I have an eclipse WTP app using the M2 plugin. I exported it and it runs fine on my machine, but I believe this is because it references my local maven repo.

How can I get it to bundle the jars from the maven repo into the war file ?

Is there a simple way to do this in eclipse with the M2 plugin >? Im afraid that if I muck with the pom.xml, which works so beautifully right now, that I will get sucked into a black hole of maven mysteries....

+2  A: 

Your pom.xml should contain:

<packaging>war</packaging>

This makes maven bundle all the dependencies* get bundled in WEB-INF/lib of the war.

Then you run mvn:package and the resultant war is placed in the /target folder of your project.

*some dependencies with scopes different from the default aren't included

Bozho
*Your POM* or *Your `pom.xml`* but not *Your `.pom`* :) Anyway, `mvn package` is the way to go. +1
Pascal Thivent
blah.. stupid mistake :) thanks.
Bozho