Search code examples
javaeclipsem2eclipseeclipse-3.6

Local Java Project jars aren't added to Maven built war - Eclipse 3.6 Helios


In Helios, the old "EE Module Dependencies" was replaced with "Deployment Assembly" but it still does the same thing, allows for the addition of external projects, in this case, a pure Java Project.

This all works fine locally, but when I have Maven build the war for deployment, a jar is not added for the local java project. The project is not in Maven, but I have turned off the "resolve workspace dependencies" and in Eclipse 3.5, this would allow me to add the projects as described above, and have the jar's show up in the WEB-INF/lib folder.

Any ideas why this isn't working anymore?


Solution

  • In Eclipse 3.7 (Indigo) m2eclipse was renewed and renamed but the behavior of the war plugin did not change imo:

    Simply open your pom.xml and check the dependencies section. Your java project should not be "optional" and should not be a "provided" dependency. The behavior of the war plugin is described here. You can activate "resolve workspace dependencies" but your "plain" Java project should have a pom as well. If the maven build of your war fails (double check that) you should invoke "install" on your other project (or you can install a jar for it manually if you don't want to make a pom.xml for it).