Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

m2eclipse and Eclipse WTP

I have a very large workspace with about 30 projects all together. I am using Eclipse 3.5 with m2eclipse. I check out of my subversion repository using the defaults in order to import the projects into my workspace.

I create a Tomcat server instance, and publish my web project to the tomcat server. Sounds easy enough.

The problem is that it does not appear as though the transitive dependencies for my other projects are being automatically added to the container, so when the container starts up I get classnotfound exceptions, etc.

I go into the web project's properties, and I notice that the Java EE Module Dependencies are NOT checked for some of the transitive dependencies. I check them, and everything seemingly works until I do a project clean build, when the Java EE Module Dependencies are automatically reset by eclipse, so I need to recheck them. This is maddening, and I was hoping there was some way to automatically pull in all of the transitive dependencies when working with Eclipse WTP.

I should mention, using standard maven build works just fine, and everything gets pulled in appropriately into the resulting WAR file. It just doesn't work so good with WTP for some reason.

like image 421
noplay Avatar asked Nov 30 '09 20:11

noplay


People also ask

What is m2e WTP?

m2e-wtp provides a set of m2e connectors used for the configuration of Java EE projects in WTP, brings unique Maven features to your Eclipse IDE and helps you convert your Eclipse projects to Maven.

Which Eclipse IDE is best for Maven project?

Eclipse is one of the most popular IDEs for Java and Android application development. It provides an excellent plugin, M2Eclipse, which integrates Maven and Eclipse. M2Eclipse automatically downloads required dependencies from remote Maven repositories.

What is m2e in Eclipse?

The goal of the Eclipse m2e/m2eclipse™ project is to provide a first-class Apache Maven support in the Eclipse IDE, making it easier to edit Maven's pom. xml, run a build from the IDE and much more.


1 Answers

You need to make sure that you have "Maven integration for WTP" feature from m2eclipse installed. There is a simple tutorial available at http://docs.sonatype.org/display/M2ECLIPSE/WTP+mini+howto

What version of WTP and m2eclipse you are using? Check that dependency version declared in project's pom.xml matches with version declared in workspace project and make sure that workspace dependency resolution is enabled.

Also, you can try to run "Maven / Update project configuration" from the project popup menu and check that there is no errors on Maven console and in Eclipse's own log.

If the above won't help, try to reproduce issue on a smaller project and then submit it with a bug report

like image 72
Eugene Kuleshov Avatar answered Sep 23 '22 19:09

Eugene Kuleshov