I am creating a multiple module project using maven externally. My parent project ejb3-enterprise consists of three underlying modules:
I want to import my project in eclipse, so i followed the directives in using maven eclipse plugin:
Run command mvn eclipse:eclipse install before importing into eclipse workspace
Eclipse needs to know the path to the local maven repository. Therefore the classpath variable M2_REPO has to be set. Execute the following command:
mvn -Declipse.workspace=<path-to-eclipse-workspace> eclipse:add-maven-repo
Any time i add a new dependency in pom.xml and run mvn eclipse:clean and mvn eclipse:eclipse and refresh the project in eclipse i can see the classpathentry in .classpath but not in my projects java build path. If i run some tests outside eclipse using maven they run fine even though i have compilation errors complaining about not resolving certain classes im calling in eclipse.
is this down to the version of eclipse im using or why is my project not displaying the new jar files in build path.
Joined: Mar 19, 2005
If i create a single project via maven and import into eclipse i can add dependencies as i please in the pom.xml and maven eclipse will pick them up.
It is my understanding that using "mvn eclipse:eclipse" has been deprecated. What I would do is use m2eclipse to create new projects and then copy over the contents of the old projects into the new ones. Then use the m2eclipse tools to keep the pom up-to-date.
Maven has a list of available plugins, including eclipse version 2.8 which was released 2010-02-25. So i do not think it is deprecated just not working properly!
Maven eclipse plugin actually does have a goal called eclipse:m2eclipse that generates the Eclipse configuration files that are already configured for M2Eclipse. But this does not work either. It still does not recognise my underlying module projects, i would have to create new maven module projects instead from scratch.
NB: You have to revert to maven eclipse plugin version 2.7 to call goal m2eclipse.
Im considering now what is the best way to create an enterprise application project inside eclipse that is maven driven. Any ideas?