[ http://jira.codehaus.org/browse/MECLIPSE-78?page=comments#action_77182 ] 
            
Rob Baily commented on MECLIPSE-78:
-----------------------------------
Actually, this can be a big help for people who set up their projects with 
Maven.  What happens today is that currently when you use the eclipse:eclipse 
goal to generate your project the .classpath has an entry for each dependency 
like this:

  <classpathentry kind="var" 
path="M2_REPO/net/sf/ehcache/ehcache/1.2/ehcache-1.2.jar" 
sourcepath="M2_REPO/net/sf/ehcache/ehcache/1.2/ehcache-1.2-sources.jar"/>

In order to enable the project as a Maven 2 project in Eclipse you have to 
first select all of dependent libraries, remove them from the build path, then 
enable Maven support.  This doesn't sound like much but when you start to have 
8-10 or more projects this can be very painful.  If you try to enable Maven 2 
without removing these from the build path you get an error message stating 
"Can't enable nature Java Model Exception: Java Model Status [Build path 
contains duplicate entry:xxx" and it is not actually enabled.

I agree that it should use the -D option rather than an entry in the XML file.

> create eclipse projects which are m2eclipse ready
> -------------------------------------------------
>
>                 Key: MECLIPSE-78
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-78
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: New Feature
>         Environment: Fedora Core 3, Sun JDK 1.5.0.06, Eclipse 3.1.1, Maven 
> 2.0.2
>            Reporter: Joshua Nichols
>         Attachments: m2eclipse.patch, m2eclipse.patch
>
>
> WIth the recent development of the m2eclipse plugin, I believe it is useful 
> to create eclipse projects via mvn eclipse:eclipse that use m2eclipse from 
> the start. One of the advantages of using m2eclipse is that you don't have to 
> rerun eclipse:eclipse when you update any dependencies.
> A few things are necessary to accomplish this, in terms of changes to 
> .classpath and .project.
> .project needs a new nature and builder added. For the builder:
>     <buildCommand>
>       <name>org.maven.ide.eclipse.maven2Builder</name>
>       <arguments/>
>     </buildCommand>
> For the nature:
> <nature>org.maven.ide.eclipse.maven2Nature</nature>
> In the .classpath, we need to add:
>   <classpathentry kind="con" 
> path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
> In .classpath, you also don't want entries <classpathentry kind="var" 
> path="M2_REPO/blah/blah/x.y.z/blah-x.y.z.jar"/>, because they would conflict 
> with m2eclipse setting up the classpath.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to