You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Nicolas De Loof <ni...@cgey.com> on 2003/11/20 10:28:36 UTC

how to use multi-projects with eclipse

Hi all,

I'm using maven on a project involving two jars and I understood to late I should use multi-projects to do that. Not a
big problem, but I would like some suggestions for the next project that will use mave :

We use eclipse for java developments. I would like to define a multi-project this way :

(root)
    /project.xml
    /maven.xml
    /project.properties

    /subproject1 (an ejb for example)
        /src/java
        /src/test
        /project.xml (extends ../project.xml)

    /subproject2 (webapp for example)
        /src/java
        /src/test
        /src/web
        /project.xml (extends ../project.xml)

(If something seems stupid, please tell me !)


On eclipse, I would like to import "root" project from CVS  *AND* child projects so that  independant eclipse
.classpath/.project can be defined for subprojects.

Without that, I'm sure I'll find some code in ejb project that uses webapp classes, for example date or format utils.

Do you have any suggestion on the way to make all of this work on eclipse with *as simple as possible* configuration ?

Nico.





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


Re: how to use multi-projects with eclipse

Posted by Jeffrey Bonevich <je...@bonevich.com>.

Nicolas De Loof wrote:
> Thank's for reply.
> 
> Using this, how do you use multiproject goals ?
> 
> Is it enough to set maven.multiproject.includes=../subproject1/project.xml, ../subproject2/project.xml  ?

Yep, although I customize a lot in project.properties (particularly you 
can set 'goal=' and multiproject:goal will run that set of goals for 
each project).  I used to hack maven.xml a bit too, but multiproject 
just makes it all too damn easy ;-)

> 
> Nico.
> 


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


Re: How can I specify the that $HOME should be in the classpath

Posted by di...@multitask.com.au.
"Vidhya CS" <vi...@siptech.co.in> wrote on 24/11/2003 10:01:19 PM:

> 
> > dion@multitask.com.au wrote:
> >> With maven you declare your dependency on specific files (jars etc)
> >> rather
> >> than anything found in a directory.
> >
> > Yep.
> >
> >> Does this help? If not, give us some more info on what you need to 
do.
> >
> > Not really. It my fault for not giving a full picture of what
> > I'm trying to do. Here's the story.
> >
> > There are various property and xml files that my project requires at
> > runtime. Examples include log4j.xml, hibernate.xml etc. These files
> > do not live in the source tree (src/java) so as to prevent developers
> > commiting their preferences to CVS. Instead, each developer must
> > put, for example, log4j.xml in their $HOME directory and tweak it
> > according to their taste.
> >
> > So the problem I have is that I would like maven to include $HOME
> > in the path when it's running unit tests (in order to ensure that
> > the various property/xml files are loaded). Since we also use

If you want to have files on the classpath for tests, use the <resources> 
element of the <unitTest> element in your POM.

See http://maven.apache.org/reference/project-descriptor.html#resources

--
dIon Gillard, Multitask Consulting
Blog:      http://blogs.codehaus.org/people/dion/





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


Re: How can I specify the that $HOME should be in the classpath

Posted by Vidhya CS <vi...@siptech.co.in>.
> dion@multitask.com.au wrote:
>> With maven you declare your dependency on specific files (jars etc)
>> rather
>> than anything found in a directory.
>
> Yep.
>
>> Does this help? If not, give us some more info on what you need to do.
>
> Not really. It my fault for not giving a full picture of what
> I'm trying to do. Here's the story.
>
> There are various property and xml files that my project requires at
> runtime. Examples include log4j.xml, hibernate.xml etc. These files
> do not live in the source tree (src/java) so as to prevent developers
> commiting their preferences to CVS. Instead, each developer must
> put, for example, log4j.xml in their $HOME directory and tweak it
> according to their taste.
>
> So the problem I have is that I would like maven to include $HOME
> in the path when it's running unit tests (in order to ensure that
> the various property/xml files are loaded). Since we also use
> Eclipse, it would be convenient if $HOME could be expressed as
> a <dependency> so that the Eclipse plugin would add it to the
> project classpath. In this way the same properties would apply
> regardless of whether the unit tests are being run from the
> command line or within Eclipse

I think a property like src.dir pointing to your $HOME/file.xml can be
defined in build.properties or project.properties and specify the property
in project.xml .so that any files notin the source tree canused .




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


-- 
Vidhya CS
SIP Technologies
Core Technology Group (CTG)
Elnet Software city ,
Taramani
Chennai 600 113
Ph # : 044 22541473 ext 312

The most important part of communication is
listening to what isnt being said .

. 


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


Re: How can I specify the that $HOME should be in the classpath

Posted by Ciaran Treanor <ci...@capetechnologies.com>.
dion@multitask.com.au wrote:
> With maven you declare your dependency on specific files (jars etc) rather 
> than anything found in a directory.

Yep.

> Does this help? If not, give us some more info on what you need to do.

Not really. It my fault for not giving a full picture of what
I'm trying to do. Here's the story.

There are various property and xml files that my project requires at
runtime. Examples include log4j.xml, hibernate.xml etc. These files
do not live in the source tree (src/java) so as to prevent developers
commiting their preferences to CVS. Instead, each developer must
put, for example, log4j.xml in their $HOME directory and tweak it
according to their taste.

So the problem I have is that I would like maven to include $HOME
in the path when it's running unit tests (in order to ensure that
the various property/xml files are loaded). Since we also use
Eclipse, it would be convenient if $HOME could be expressed as
a <dependency> so that the Eclipse plugin would add it to the
project classpath. In this way the same properties would apply
regardless of whether the unit tests are being run from the
command line or within Eclipse.

I guess this is related to the whole are of runtime dependencies.

Any ideas?

Thanks,
ct



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


Re: How can I specify the that $HOME should be in the classpath

Posted by di...@multitask.com.au.
Ciaran Treanor <ci...@capetechnologies.com> wrote on 21/11/2003 
12:15:23 AM:

> Hi,
> I'm wondering how I can specify that $HOME should be added to
> the classpath before running unit tests and when generating
> the project files using the eclipse plugin.
You don't do things this way with Maven.

With maven you declare your dependency on specific files (jars etc) rather 
than anything found in a directory.

Does this help? If not, give us some more info on what you need to do.
--
dIon Gillard, Multitask Consulting
Blog:      http://blogs.codehaus.org/people/dion/



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


How can I specify the that $HOME should be in the classpath

Posted by Ciaran Treanor <ci...@capetechnologies.com>.
Hi,
I'm wondering how I can specify that $HOME should be added to
the classpath before running unit tests and when generating
the project files using the eclipse plugin.

Thanks,
ct



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


Re: how to use multi-projects with eclipse

Posted by di...@multitask.com.au.
"Nicolas De Loof" <ni...@cgey.com> wrote on 20/11/2003 11:33:58 
PM:

> Thank's for reply.
> 
> Using this, how do you use multiproject goals ?
> 
> Is it enough to set maven.multiproject.includes=..
> /subproject1/project.xml, ../subproject2/project.xml  ?
> 
> Nico.

We do that, as well as exclude the 'master-project/project.xml'.


> 
> 
> ----- Original Message ----- 
> From: "Jeffrey Bonevich" <je...@bonevich.com>
> To: "Maven Users List" <us...@maven.apache.org>
> Sent: Thursday, November 20, 2003 11:25 AM
> Subject: Re: how to use multi-projects with eclipse
> 
> 
> > eclipse don't workm that way (unless root is the eclipse project and 
the
> > subprojects are just directories under that, in which case you would
> > only end up with one jar file, one .classpath, one .project).  I do 
this
> > like so:
> >
> > (workspace)
> >    |--master-project
> >    |    |-project.xml etc.
> >    |--subproject1
> >    |    |-project.xml (extends 
${basedir}/../master-project/project.xml
> >    |--subproject2
> >    |    |-project.xml (extends 
${basedir}/../master-project/project.xml
> >
> > This is pretty simple and works well.  You can easily add a third
> > subproject for common utilities shared by both the other 
subprojects...
[snip]
--
dIon Gillard, Multitask Consulting
Blog:      http://blogs.codehaus.org/people/dion/





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


Re: how to use multi-projects with eclipse

Posted by Nicolas De Loof <ni...@cgey.com>.
Thank's for reply.

Using this, how do you use multiproject goals ?

Is it enough to set maven.multiproject.includes=../subproject1/project.xml, ../subproject2/project.xml  ?

Nico.


----- Original Message ----- 
From: "Jeffrey Bonevich" <je...@bonevich.com>
To: "Maven Users List" <us...@maven.apache.org>
Sent: Thursday, November 20, 2003 11:25 AM
Subject: Re: how to use multi-projects with eclipse


> eclipse don't workm that way (unless root is the eclipse project and the
> subprojects are just directories under that, in which case you would
> only end up with one jar file, one .classpath, one .project).  I do this
> like so:
>
> (workspace)
>    |--master-project
>    |    |-project.xml etc.
>    |--subproject1
>    |    |-project.xml (extends ${basedir}/../master-project/project.xml
>    |--subproject2
>    |    |-project.xml (extends ${basedir}/../master-project/project.xml
>
> This is pretty simple and works well.  You can easily add a third
> subproject for common utilities shared by both the other subprojects...
>
> jeff
>
> Nicolas De Loof wrote:
> > Hi all,
> >
> > I'm using maven on a project involving two jars and I understood to late I should use multi-projects to do that. Not
a
> > big problem, but I would like some suggestions for the next project that will use mave :
> >
> > We use eclipse for java developments. I would like to define a multi-project this way :
> >
> > (root)
> >     /project.xml
> >     /maven.xml
> >     /project.properties
> >
> >     /subproject1 (an ejb for example)
> >         /src/java
> >         /src/test
> >         /project.xml (extends ../project.xml)
> >
> >     /subproject2 (webapp for example)
> >         /src/java
> >         /src/test
> >         /src/web
> >         /project.xml (extends ../project.xml)
> >
> > (If something seems stupid, please tell me !)
> >
> >
> > On eclipse, I would like to import "root" project from CVS  *AND* child projects so that  independant eclipse
> > .classpath/.project can be defined for subprojects.
> >
> > Without that, I'm sure I'll find some code in ejb project that uses webapp classes, for example date or format
utils.
> >
> > Do you have any suggestion on the way to make all of this work on eclipse with *as simple as possible* configuration
?
> >
> > Nico.
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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


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


Re: how to use multi-projects with eclipse

Posted by Jeffrey Bonevich <je...@bonevich.com>.
eclipse don't workm that way (unless root is the eclipse project and the 
subprojects are just directories under that, in which case you would 
only end up with one jar file, one .classpath, one .project).  I do this 
like so:

(workspace)
   |--master-project
   |    |-project.xml etc.
   |--subproject1
   |    |-project.xml (extends ${basedir}/../master-project/project.xml
   |--subproject2
   |    |-project.xml (extends ${basedir}/../master-project/project.xml

This is pretty simple and works well.  You can easily add a third 
subproject for common utilities shared by both the other subprojects...

jeff

Nicolas De Loof wrote:
> Hi all,
> 
> I'm using maven on a project involving two jars and I understood to late I should use multi-projects to do that. Not a
> big problem, but I would like some suggestions for the next project that will use mave :
> 
> We use eclipse for java developments. I would like to define a multi-project this way :
> 
> (root)
>     /project.xml
>     /maven.xml
>     /project.properties
> 
>     /subproject1 (an ejb for example)
>         /src/java
>         /src/test
>         /project.xml (extends ../project.xml)
> 
>     /subproject2 (webapp for example)
>         /src/java
>         /src/test
>         /src/web
>         /project.xml (extends ../project.xml)
> 
> (If something seems stupid, please tell me !)
> 
> 
> On eclipse, I would like to import "root" project from CVS  *AND* child projects so that  independant eclipse
> .classpath/.project can be defined for subprojects.
> 
> Without that, I'm sure I'll find some code in ejb project that uses webapp classes, for example date or format utils.
> 
> Do you have any suggestion on the way to make all of this work on eclipse with *as simple as possible* configuration ?
> 
> Nico.
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> 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