You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by szefo <sz...@o2.pl> on 2006/11/06 23:18:15 UTC

maven2+subclipse+svn+m2eclipse plugin

Hi,
Can someone give me any clues how to integrate
maven2+subclipse+svn+m2eclipse plugin ?
I have a multi-module project, stored in one repository.
The problem is that when I checkout this project from repo using subclipse
it is seen by eclipse as single project...
I can go to the folder of the project and run "mvn eclipse:eclipse" but it
doesn't help...
Thanks in advance...
Tom

-- 
View this message in context: http://www.nabble.com/maven2%2Bsubclipse%2Bsvn%2Bm2eclipse-plugin-tf2585482s177.html#a7208510
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: maven2+subclipse+svn+m2eclipse plugin

Posted by Max Cooper <ma...@maxcooper.com>.
Each of your maven modules will be a separate Eclipse project. Eclipse 
does not support hierarchical project structures (#), so if you want to 
be able to edit the parent pom in Eclipse, you will need to move it into 
a module also. Here's my recommendation, based on how my project team 
uses maven and eclipse:

* Put your parent pom in a module, rather than in the root directory of 
your project. Ours is in a module named "maven".

* I recommend checking out your project tree using svn (or SmartCVS, 
Tortoise, etc.), apart from where your Eclipse workspace is.

* Then run 'mvn -DdownloadSources=true eclipse:eclipse'. Do this from 
the "build root" of your project (which may now be the maven directory), 
so that project-to-project dependencies are created properly.

* Then create an Eclipse workspace in a directory that does not overlap 
with where you checked out your project. Don't forget to setup the 
M2_REPO classpath variable.

* The use the File -> Import -> "General/Existing projects into 
workspace"  command in Eclipse, select the root directory of where you 
checked out your project. Click the "Select All" button, and then finish 
the operation.

Each module in your project will be a separate Eclipse project, but they 
will have proper project-to-project dependencies.

We don't use the m2eclipse plugin. It sounds interesting, but I haven't 
tried it yet. My (perhaps erroneous) understanding is that for a given 
project, you can effectively use m2eclipse or 'mvn eclipse:eclipse', but 
not both.

This page has a short tutorial on how to use maven with eclipse, 
including the "flat project layout" that I outlined above:
http://maven.apache.org/guides/mini/guide-ide-eclipse.html

If you don't plan to put the .project, .classpath, and .settings files 
in subversion, add them to svn:ignore so they don't show up as unknown 
files. However, for the most part, you really can check these in. The 
only non-sharable aspect that I am aware of relates to the version of 
Eclipse WTP, but I've never explicitly overridden the default (and I 
don't think anyone else on my team has, either), so this probably isn't 
a concern for my project, and it may not be an issue for yours, either. 
Checking them in would allow developers on your team to setup a 
workspace and checkout your project modules in one place, without using 
a separate subversion client. And when someone on the team changes a 
dependency, they will run 'mvn eclipse:eclipse' and commit the change to 
the pom.xml and .classpath files together. The rest of the team will get 
the change the next time they update, which will save time on the 
project when compared to everyone running 'mvn eclipse;eclipse' 
individually, after someone tells them that the deps have changed, or 
they scratch their head in wonder at some compile errors showing up in 
Eclipse. You might want to try having your Eclipse .project, .classpath, 
and .settings files in subversion, as it does change the process for 
setting up a workspace and modifying dependencies. I think the m2eclipse 
plugin also shares some of these advantages.

-Max

(#) There is a trick that was discussed on this list a while back to 
allow you to have overlapping projects in Eclipse. This allows you to 
have one "root" project that contains your whole project directory, in 
addition to separate projects for each module under the root. IMO, this 
is less acceptable than moving your parent pom into a module, so I don't 
use this trick.

Tomasz Pik wrote:
> On 11/6/06, szefo <sz...@o2.pl> wrote:
>>
>> Hi,
>> Can someone give me any clues how to integrate
>> maven2+subclipse+svn+m2eclipse plugin ?
>> I have a multi-module project, stored in one repository.
>> The problem is that when I checkout this project from repo using 
>> subclipse
>> it is seen by eclipse as single project...
>> I can go to the folder of the project and run "mvn eclipse:eclipse" 
>> but it
>> doesn't help...
> 
> and then go to 'File' menu and 'Import' as 'Existing project into 
> workspace'
> subdirectories.
> 
> Regards,
> Tomek
> 
>> Thanks in advance...
>> Tom
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: maven2+subclipse+svn+m2eclipse plugin

Posted by Tomasz Pik <to...@gmail.com>.
On 11/6/06, szefo <sz...@o2.pl> wrote:
>
> Hi,
> Can someone give me any clues how to integrate
> maven2+subclipse+svn+m2eclipse plugin ?
> I have a multi-module project, stored in one repository.
> The problem is that when I checkout this project from repo using subclipse
> it is seen by eclipse as single project...
> I can go to the folder of the project and run "mvn eclipse:eclipse" but it
> doesn't help...

and then go to 'File' menu and 'Import' as 'Existing project into workspace'
subdirectories.

Regards,
Tomek

> Thanks in advance...
> Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org