package root setting [message #291037] |
Tue, 06 September 2005 12:24  |
Eclipse User |
|
|
|
Originally posted by: johan.elmstrom.edb.se
Hi all...
I've just installed eclipse, and I am having a slight problem with setting
up multiple projects from a shared
directory structure.
We are developing an application consisting of several modules in the same
suite, thise all share a root namespace, com.x.y.z. Under z there are
several modules that are autonomous.
I'd like to be able to open all of these in separate projects in eclipse,
since they have different imports and dependencies, but i am having
serious problems setting it up. When i create my 'CustomerModule'
project, and use the existing folder (CVS repository), the compiler
complains that the
package com.x.y.z is invalid and that my class should be defined in the
CustomerModule namespace.
I want to tell the compiler that even though these files appear to be in
the root directory, it should accept the 'com.x.y.z' prefix and compile
the
XCustomer.java file into com.x.y.z.CustomerModule.XCustomer.class
I haven't found any way to achieve this.
The reason i want to try and separate it like this is that we have
serverside modules in the same structure, and I really want them separated
in the
development environment, even though they are in the same CVS structure.
Is there a setting I have not discovered yet?
Is there a plugin available for this?
Appreciate any help
/Johan
|
|
|
|
|
|
|
|
Re: package root setting [message #291081 is a reply to message #291068] |
Wed, 07 September 2005 11:06  |
Eclipse User |
|
|
|
Originally posted by: eclipse3.rizzoweb.com
Johan wrote:
> I think i will have to admit defeat here then, I haven't really found
> any tool that can do what i want (it can't be that difficult).
>
> It would have been really nice to keep it in a nice clean structure then
> just point at the source.
>
> Thaks for your help!
Well, I think the problem and reason you haven't found a tool to do what
you want is because it is not what most people would call a "clean
structure."
You are thinking in the right way in terms of keeping client and server
modules separate, but you're trying to organize the source for the
different modules under one root, which doesn't jibe with keeping the
modules separate.
It is OK (and considered a good practice) to have multiple Projects with
multiple source roots, even if they share part of the package names in
common. For example, com.foo.common.* for shared or "common" code that
is used by all modules - that would be one project with one source root
in it. One of the client module's packages might be com.foo.client1.*
and would be a separate Project with its own source root.
This will not only make it easier to organize Eclipse projects, but also
make it easier to build the various modules separately (for example,
into separate JARs or WARs).
HTH,
Eric
|
|
|
Powered by
FUDForum. Page generated in 0.04289 seconds