Sorry that this discussion is somewhat off-topic, but I hope that it is
okay since there are so many people trying to get
hierarchically-organized Maven projects to work well in Eclipse...
I setup a workspace using the procedure outlined in this thread. The end
result that I get has the root and modules in a flat layout (not
hierarchical) like this:
root
module1
module2
module3
At first I thought that it didn't work for me, but I suspect that this
was the same result that others got. I was expecting a hierarchical
layout in Eclipse, but I see now that this is really just a trick that
allows you to create overlapping Eclipse projects. Normally, Eclipse
would not allow you to add both "root" and "module1" projects to the
same workspace, since they overlap.
This does have a few advantages over the method I was using before:
1. The import process is a convenient way to create an Eclipse project
for each Maven module in one step. Previously, I was adding each one
individually. (This also works if you have checked out your project from
the root outside of the workspace.)
2. You can have your parent pom.xml in the root directory of your
project, AND still be able to edit it in Eclipse. Previously, I was
forced to put the parent pom in subdir under root.
3. You can commit changes in multiple modules/projects in one
transaction, by committing the changes from root project. (However, I
see now that the Subversive subversion plugin supports "cross project
atomic commits", which sounds like it will work even if you don't have
your project root setup as an Eclipse project.)
But it is still lacking in several respects:
1. If one team member adds a module, every person on the team has to do
some fiddling to setup their workspace.
2. The display in Eclipse is still flat, rather than hierarchical,
making it impractical to have more than one multi-module project in the
same workspace (since there is no indication which "root" project owns
"moduleX").
3. You are limited to one level of inheritance in your project
hierarchy. Or maybe not, if you do the same .project-hide and import
trick more than once. Whatever the case, it still flattens the view.
4. All of your files show up twice (or worse, if your project hierarchy
has more than one level) -- once as root/moduleX/file and again as
moduleX/file. This can be confusing. The double-display of file
modification label decorations is annoying. I suspect that it also has a
significant negative impact on Eclipse performance.
-Max
Barrie Treloar wrote:
On 8/16/06, Barrie Treloar <[EMAIL PROTECTED]> wrote:
I thought that the snapshot version of the eclipse:eclipse plugin had
the functionality to do this for me, but it is not working how I
expect. I assume I am doing something wrong. Should mvn
eclipse:eclipse at the project root do what I expect?
With the help of Nicolas' mail, these are the steps.
Checkout your project root.
Run mvn -DuseProjectReferences=false eclipse:eclipse at the project
root. (I recommend not using project references so that you get
repository copies and only when you need to work on related projects
that you are changing sources files for at the same time to switch to
project references)
Rename the ROOT/.project file to something else
File -> Import -> General -> Existing Projects and browse to your
workspace and the project root.
Because there is no .project file eclipse will show all the
subprojects as being available. Select them and click ok.
Now rename the ROOT/.project file back.
Press F5 to refresh your Navigator view.
You should have all your projects links up hierarchically!
Weeeeee
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]