You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Vincent Massol <vm...@pivolis.com> on 2005/10/31 19:48:49 UTC

RE: svn commit: r329875 - /maven/components/trunk/maven-site/src/site/apt/guides/mini/guide-ide-eclipse.apt

Some comments inside.

> -----Original Message-----
> From: jvanzyl@apache.org [mailto:jvanzyl@apache.org]
> Sent: lundi 31 octobre 2005 19:22
> To: commits@maven.apache.org
> Subject: svn commit: r329875 - /maven/components/trunk/maven-
> site/src/site/apt/guides/mini/guide-ide-eclipse.apt

[snip]

>  Guide to using Eclipse with Maven 2.x
> 
> - To generate the Eclipse project files from your POM you execute the
> following command:
> + This mini guide explains howto use Maven 2 in Eclipse IDE.
> 
> + * {{{#Maven 2 repository}Maven 2 repository}}
> +
> + * {{{#Maven as an external tool}Maven as an external tool}}
> +
> + * {{{#Simple Project}Simple Project}}
> +
> + * {{{#Multiple Module Project}Multiple Module Project}}
> +
> +* {Maven 2 repository}
> +
> + 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

I think the eclipse.workspace parameter has to be explained. If you read it
you could be under the impression it specifies the location of the local
maven repository.

It should also be mentioned that this system property is optional and if not
specified the default eclipse workspace is going to be used.

> + You can also define a new classpath variable inside eclipse: From the
> +menu bar, select Window > Preferences.  Select the Java > Build Path >
> +Classpath Variables page.
> +
> + <<Issue:>> The command does not work. Aside from it should not require a
> POM.
> +
> +* {Maven as an external tool}
> +
> + You might want to execute some maven goals from inside eclipse. This
> +is possible by configuring an external launcher. It is best practice
> +to prepare eclipse by adding a variable, which points to your local
> +maven excutable (mvn.bat/mvn). From the menu bar, select Window >
> +Preferences.  Select the Run/Debug > String Substitution. Add a new
> +variable e.g.  <maven_exec>. When you set up a new external launcher
> +(from the menu bar, select Run > External Tools. Select Program) you
> +can refer to <maven_exec> in the location field. Furhtermore refer to
> +<project_loc> as the working directory and specify the maven goals of
> +your choice as arguments, e.g. <eclipse:eclipse>. For further
> +information please refer to the eclipse help.
> +
> + <<Issue:>> Would be nice, if the plugin generates the variable and a
> runner.

Never used that.

> +* {Simple Project}
> +
> + If you have a simple java project which is made up of only one
> +module, using eclipse is very simple. To generate the eclipse project
> +files from your POM you execute the following command:
> +
> ++----+
> +
> +mvn eclipse:eclipse

You should note that will not generate any eclipse project files for
projects with a pom packaging and that this is an issue. The eclipse plugin
should generate the eclipse project files for leaf projects independently of
their packaging.

> + If you have created or checked out the project with eclipse, you only
> +have to refresh the project in your workspace. Otherwise you have to
> +import the project into your eclipse workspace (From the menu bar,
> +select File >Import >Existing Projects into Workspace). In the
> +latter case the project (directory) should not be located in your
> +workspace, because eclipse might come into trouble, especially if you
> +want to use eclipse as the scm client.
> +
> +* {Multiple Module Project}

[snip]

I haven't checked what's below. I just wanted to point out that using
several eclipse projects to represent a full project is not working fine for
me and the only solution that works right now is having a single eclipse
project for all modules.

The problems I have with a multiple eclipse projects approach:

- you have *lot* tedious work to do. You must manually create parent project
and manually link each file, *one by one* to that project

- the files that you link are NOT version-controlled. If you make changes to
them you won't have annotations to tell you you've made changes. You also
won't be able to commit them, nor do any SCM operations on them

- you won't be able to select your whole project and select team>commit...
and have subclipse show the list of all your changes that you can then
select and commit. You'll need to hand pick changes for each module and
commit them separately... So long for atomic commits. Obviously you could
use the synchronization perspective but I've never liked it and it takes way
too long to be usable IMO. You'll need to cerate a working set. But even
that will not work because in the working set you'll have your parent
projects which will fail as they're not SCM-enabled...

Obviously I also understand that having a single big project does not scale
when the project becomes too big. That said this is what works the best for
me for now.... until Eclipse starts supporting overlapping projects as IDEA
does...

YMMV

-Vincent


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