• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Libraries not visible under projects java build path in eclipse

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Eclipse Galileo: 3.5.0
Apache Maven:2.2.0
JDK1.6.0_11

I am creating a multiple module project using maven externally. My parent project ejb3-enterprise consists of three underlying modules:
ejb3-enterprise-ear
ejb3-enterprise-ejb
ejb3-enterprise-webapp

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.

Regards,
Shane.
 
Shane Lee
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Note:
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.
Example:
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Shane Lee
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Peter,
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!
See:http://maven.apache.org/plugins/index.html

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?
 
Peter Johnson
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What I do is create a new Maven project with the desired archetype. With m2eclipse installed into Eclipse, I do: File | New | Maven | Maven Project and follow the Maven project wizard.
reply
    Bookmark Topic Watch Topic
  • New Topic