Skip to main content



      Home
Home » Newcomers » Newcomers » Multiple projects once more
Multiple projects once more [message #88198] Thu, 21 July 2005 07:30 Go to next message
Eclipse UserFriend
Hello,

I'm wondering what are the best practices when working with
big multimodule project using Eclipse.

There has been some talk about it on the newsgroup but I did
not find the answer (sorry if I missed something).

Our project is stored in a single CVS tree but contains a number of
dependent modules.
Hierarchy looks more or less like below:

PROJECTX
Doc
Src
Code
some_common_stuff_for_all_Code
ejbs
some_common_stuff_for_ejbs
EJBModule1
EJBModule2
...
jars
some_common_stuff_for_jars
JARModule1
JARModule2
...
ears
EARModule1
...

Currently I work with it, checkouting whole PROJECTX directory
as a single Eclipse Project. The main drawback of this approach is I cannot
specify real dependencies between modules (every modules see each other).

I'd like to have each module as separate Eclipse Project but the problem
appears with resources which do not belong to one module but are shared
between some of them (the some_common_stuff_* resources).

Is this problem workaroundable or eclipse just have design flaw concerning
such project layout?

--
Best regards, Lukasz Osipiuk
Re: Multiple projects once more [message #88259 is a reply to message #88198] Thu, 21 July 2005 10:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse3.rizzoweb.com

Łukasz Osipiuk wrote:
> Hello,
>
> I'm wondering what are the best practices when working with
> big multimodule project using Eclipse.
>
> There has been some talk about it on the newsgroup but I did
> not find the answer (sorry if I missed something).
>
> Our project is stored in a single CVS tree but contains a number of
> dependent modules.
> Hierarchy looks more or less like below:
>
> PROJECTX
> Doc
> Src
> Code
> some_common_stuff_for_all_Code
> ejbs
> some_common_stuff_for_ejbs
> EJBModule1
> EJBModule2
> ...
> jars
> some_common_stuff_for_jars
> JARModule1
> JARModule2
> ...
> ears
> EARModule1
> ...
>
> Currently I work with it, checkouting whole PROJECTX directory
> as a single Eclipse Project. The main drawback of this approach is I cannot
> specify real dependencies between modules (every modules see each other).
>
> I'd like to have each module as separate Eclipse Project but the problem
> appears with resources which do not belong to one module but are shared
> between some of them (the some_common_stuff_* resources).
>
> Is this problem workaroundable or eclipse just have design flaw concerning
> such project layout?
>

It all depends on what you want to do. Eclipse can deal with almost any
structure you want, as long as you understand its concepts and how to
configure different projects with respect to CVS and inter-dependencies.
Have you gone through the Help topic titled "Project configuration
tutorial"? That will help you get familiar with the concepts.

My first suggestion would be to check out each module as a separate
Eclipse project (Java Project). It is then just a matter of setting up
their dependencies so that, for example, the EJB projects can use the
stuff in the Common project. In some cases, you may want to have an Ant
build that produces a JAR and puts it into the dependent project's lib,
rather than depend on the common code Project directly - it is rare and
complicates things a little, but I've done that once or twice.
Generally, though, you can just get each Project set up so it compiles
one at a time, starting with the "common" stuff and working your way
down to the Projects that depend on that.
Feel free to post back with specific questions.

HTH,
Eric
Re: Multiple projects once more [message #88468 is a reply to message #88259] Fri, 22 July 2005 08:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: lucash.tls.pl

Eric Rizzo wrote:
> Łukasz Osipiuk wrote:
>
>> Hello,
>>
>> I'm wondering what are the best practices when working with
>> big multimodule project using Eclipse.
>>
>> There has been some talk about it on the newsgroup but I did not find
>> the answer (sorry if I missed something).
>>
>> Our project is stored in a single CVS tree but contains a number of
>> dependent modules.
>> Hierarchy looks more or less like below:
>>
>> PROJECTX
>> Doc
>> Src
>> Code
>> some_common_stuff_for_all_Code
>> ejbs
>> some_common_stuff_for_ejbs
>> EJBModule1
>> EJBModule2
>> ...
>> jars
>> some_common_stuff_for_jars
>> JARModule1
>> JARModule2
>> ...
>> ears
>> EARModule1
>> ...
>> Currently I work with it, checkouting whole PROJECTX directory

< ...cut... >

>
> It all depends on what you want to do. Eclipse can deal with almost any
> structure you want, as long as you understand its concepts and how to
> configure different projects with respect to CVS and inter-dependencies.
> Have you gone through the Help topic titled "Project configuration
> tutorial"? That will help you get familiar with the concepts.

I read it some time ago. It contains only basic information. I'm not new
to Eclipse. I'm using it at work for two years now.

> My first suggestion would be to check out each module as a separate
> Eclipse project (Java Project).

I know this is suggested approach, but there are some problems with it.
The common* modules in example above are usually not java modules.

The "some_common_stuff_for_ejbs" can contain for example 2 files
(abstract maven.xml and project.properties). This files are located
directly in ejbs directory.

If even it is possible to create separate Eclipse project for this two
files it would create lots of mess. In real life I would need ~20 such
project and it would be a bit unusable (separate CVS synchronization of
each project etc..).

The ideal for me would be single project (single CVS repository tree)
with internal java dependencies (I guess IntelliJ Idea uses such concept).

I guess it is not possible in Eclipse but I'd like to be sure of it, to
stop wasting time, trying to make it work ;)

--
Thanks for answer,
Lukasz
Re: Multiple projects once more [message #88529 is a reply to message #88468] Fri, 22 July 2005 11:29 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse3.rizzoweb.com

Łukasz Osipiuk wrote:
> Eric Rizzo wrote:
>
>>My first suggestion would be to check out each module as a separate
>>Eclipse project (Java Project).
>
>
> I know this is suggested approach, but there are some problems with it.
> The common* modules in example above are usually not java modules.
>
> The "some_common_stuff_for_ejbs" can contain for example 2 files
> (abstract maven.xml and project.properties). This files are located
> directly in ejbs directory.
>
> If even it is possible to create separate Eclipse project for this two
> files it would create lots of mess. In real life I would need ~20 such
> project and it would be a bit unusable (separate CVS synchronization of
> each project etc..).

You can create as many projects (Java and non-Java) as you want/need; as
you say, having more than a handful can be a pain to manage. But I would
suggest there is a comfortable medium between one big project with
everything, and 20 tiny little projects. That happy medium is what you
are looking for.


> The ideal for me would be single project (single CVS repository tree)
> with internal java dependencies (I guess IntelliJ Idea uses such concept).

You can do it that way in Eclipse, and use separate source locations and
build output locations. But I don't think that will be the most usable.
The strategy I've used several times with success is to create one or
two "common" projects that include Java code, config files, libraries,
and anything else that is shared between several applications or modules
of an application. One or maybe two of such projects.
Then I create a separate Project for each logical "thing" that would
depend on the common project(s). Sometimes that is one project per
application; sometimes it is multiple projects for one application, one
per logical "component" or "layer."
Eclipse is very flexible in how you set up dependencies, so it can
support all of these scenarios quite well. I've yet to find a
project/dependency structure that I could not get set up well in Eclipse
(other than one or two that were just completely bizarre, non-intuitive,
and opposite of best-practices for project layout).


> I guess it is not possible in Eclipse but I'd like to be sure of it, to
> stop wasting time, trying to make it work ;)

I would not give up, since getting this kind of setup right can make
your work a lot easier. Unfortunately, it is hard for outsiders to offer
assistance without seeing the particulars of your directory structures
and dependencies and build scripts. [Sometimes I think about starting an
Eclipse consulting business where I help clients work out their Projects
in Eclipse and use it more effectively - but then my good paying, good
benefits, near-guaranteed job pops back into my mind... :-) ]

HTH,
Eric
Previous Topic:Query
Next Topic:Compiling a Java application without running it.
Goto Forum:
  


Current Time: Tue Jul 22 14:50:52 EDT 2025

Powered by FUDForum. Page generated in 0.31822 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top