I have a (custom) embedded jetty launcher which I had been using to develop/test my web application (before moving to maven).
I am able to trick m2eclipse into putting the maven managed dependencies to libraries for the war file onto the launcher classpath (when run from eclipse). I did this by creating two dependencies for the same artifact: one of the type "war" and one the type "jar" ("jar" dependence tricks m2eclipse into doing what I want).
However the maven-assembly-plugin for the launcher fails when it cannot find the jar for the war project.
Q: Can I tell maven to ignore the jar dependency when running the package goal?
more detailed background: I have a webapp.war project and a jetty-launcher project, before moving to maven; I had an eclipse project dependency so that the launcher had all the war dependencies at runtime. Everything ran right out of the ide (with no re-build of the warfile) needed to test changes.
After moving to maven, this approach was outsmarted since m2eclipse knows not to include the libraries that the jar depends on (since they are war scoped).
It's probably too late, but this can be helpful for someone:
So, add
<optional>true</optional>
to your pom.xmlI got around this by using a seperate .m2/settings-eclipse.xml (for eclipse) where I over-ride the default type of dependency. so in my launcher POM, I have:
I still would like to know if there is a direct way to approach the original problem.