You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Todd Huss <th...@greatschools.net> on 2005/01/13 19:29:45 UTC

Duplicate project dependenices

I have a mydata project which publishes mydata.jar to my maven repository
when I do "maven jar:install". mydata.jar also requires hibernate.jar to be
of any use to other projects.

My myweb project creates myweb.war which includes mydata.jar through a
dependency. However, I'm currently specifying the dependency on
hibernate.jar in both myweb/project.xml and mydata/project.xml which isn't
very elegant.

Is there a way in myweb/project.xml to have it include all of mydata.jar's
dependencies in the war without having duplicate dependency statements in
both projects?

Thanks,
Todd



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


RE: Duplicate project dependenices

Posted by Steve Molloy <sm...@convera.com>.
I think there's room for discussion on this and not everyone will give
you the same answer. The way I have done it here is that I have the same
folder structure in CVS as my project hierarchy. That is, if Project B
and C are children of A and D is child of B, I get:

A:
    B:
        D:
    C:

All projects except A extend the parent one. Then you checkout A and get
everything configured. The trouble part usually comes when people want
to use it in Eclipse, which we also do. The way I got around that
problem is checking out module A in a separate workspace, run eclipse on
all relevant subprojects (I wrote a small plugin to navigate through the
hierarchy and only run eclipse goal on projects which do not have child
projects...). Then, from your real workspace, you can use the Eclipse
multi-project import plugin pointing to the workspace where A is and
you'll see all subprojects and be able to work on them separately
(including checking in and out since the CVS info is still there...).

Now as I said, you might get a different answer from someone else...

Steve Molloy
On Thu, 2005-01-13 at 11:04 -0800, Todd Huss wrote:

> Thanks Steve! In your experience, is it better to have the parent project as
> a separate project all-together or include it? For example I tried it both
> ways and both approaches work technically:
> 
> Mydata
>  project.xml (extends conf/project-dependencies.xml)
>  conf/project-dependencies.xml (hibernate dependency declared)
> Myweb
>  project.xml (extends Mydata/conf/project-dependencies.xml)
> 
> Or:
> 
> Mywebdata
>   project.xml (hibernate dependency)
> Mydata 
>   project.xml (extends Mywebdata/project.xml)
> Myweb
>   project.xml (extends Mywebdata/project.xml)
> 
> The downside I see with the latter approach is that a developer then has to
> checkout 3 CVS modules where one module basically has one file in it. Also
> if I later created a "Mywebservices" project that depends on Mydata it would
> then need to extend "Mywebdata/project.xml" as well for it to get the
> hibernate dependency.
> 
> The first approach feels a touch kludgy though because I had to put
> project-dependencies.xml in a sub-directory so that projects extending it
> did not also inherit Mydata/maven.xml.
> 
> I don't have a lot of experience with Maven yet though so I'm hoping other
> people have run into this and can share their experiences!
> 
> Thanks,
> Todd
> 
> -----Original Message-----
> From: Steve Molloy [mailto:smolloy@convera.com] 
> Sent: Thursday, January 13, 2005 10:39 AM
> To: Maven Users List
> Subject: Re: Duplicate project dependenices
> 
> Make a parent project with hibernate dependency so you can use
> inheritance... 
> 
> Steve Molloy
> 
> On Thu, 2005-01-13 at 10:29 -0800, Todd Huss wrote:
> 
> > I have a mydata project which publishes mydata.jar to my maven repository
> > when I do "maven jar:install". mydata.jar also requires hibernate.jar to
> be
> > of any use to other projects.
> > 
> > My myweb project creates myweb.war which includes mydata.jar through a
> > dependency. However, I'm currently specifying the dependency on
> > hibernate.jar in both myweb/project.xml and mydata/project.xml which isn't
> > very elegant.
> > 
> > Is there a way in myweb/project.xml to have it include all of mydata.jar's
> > dependencies in the war without having duplicate dependency statements in
> > both projects?
> > 
> > Thanks,
> > Todd
> > 
> > 
> > 
> > ---------------------------------------------------------------------
> > 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: Duplicate project dependenices

Posted by Todd Huss <th...@greatschools.net>.
Thanks Steve! In your experience, is it better to have the parent project as
a separate project all-together or include it? For example I tried it both
ways and both approaches work technically:

Mydata
 project.xml (extends conf/project-dependencies.xml)
 conf/project-dependencies.xml (hibernate dependency declared)
Myweb
 project.xml (extends Mydata/conf/project-dependencies.xml)

Or:

Mywebdata
  project.xml (hibernate dependency)
Mydata 
  project.xml (extends Mywebdata/project.xml)
Myweb
  project.xml (extends Mywebdata/project.xml)

The downside I see with the latter approach is that a developer then has to
checkout 3 CVS modules where one module basically has one file in it. Also
if I later created a "Mywebservices" project that depends on Mydata it would
then need to extend "Mywebdata/project.xml" as well for it to get the
hibernate dependency.

The first approach feels a touch kludgy though because I had to put
project-dependencies.xml in a sub-directory so that projects extending it
did not also inherit Mydata/maven.xml.

I don't have a lot of experience with Maven yet though so I'm hoping other
people have run into this and can share their experiences!

Thanks,
Todd

-----Original Message-----
From: Steve Molloy [mailto:smolloy@convera.com] 
Sent: Thursday, January 13, 2005 10:39 AM
To: Maven Users List
Subject: Re: Duplicate project dependenices

Make a parent project with hibernate dependency so you can use
inheritance... 

Steve Molloy

On Thu, 2005-01-13 at 10:29 -0800, Todd Huss wrote:

> I have a mydata project which publishes mydata.jar to my maven repository
> when I do "maven jar:install". mydata.jar also requires hibernate.jar to
be
> of any use to other projects.
> 
> My myweb project creates myweb.war which includes mydata.jar through a
> dependency. However, I'm currently specifying the dependency on
> hibernate.jar in both myweb/project.xml and mydata/project.xml which isn't
> very elegant.
> 
> Is there a way in myweb/project.xml to have it include all of mydata.jar's
> dependencies in the war without having duplicate dependency statements in
> both projects?
> 
> Thanks,
> Todd
> 
> 
> 
> ---------------------------------------------------------------------
> 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: Duplicate project dependenices

Posted by Steve Molloy <sm...@convera.com>.
Make a parent project with hibernate dependency so you can use
inheritance... 

Steve Molloy

On Thu, 2005-01-13 at 10:29 -0800, Todd Huss wrote:

> I have a mydata project which publishes mydata.jar to my maven repository
> when I do "maven jar:install". mydata.jar also requires hibernate.jar to be
> of any use to other projects.
> 
> My myweb project creates myweb.war which includes mydata.jar through a
> dependency. However, I'm currently specifying the dependency on
> hibernate.jar in both myweb/project.xml and mydata/project.xml which isn't
> very elegant.
> 
> Is there a way in myweb/project.xml to have it include all of mydata.jar's
> dependencies in the war without having duplicate dependency statements in
> both projects?
> 
> Thanks,
> Todd
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>