>> To answer your original question... I'm not sure I'd recommend this
approach, but (I just tried it and) it works... you can create a
project with <packaging>pom which has dependencies, and then have your
project _depend_ on that pom, so that you pick up those dependencies
transitively. <<

Not only does this technique work, but I think it's both sensible and
useful, any time you want separately characterize or expose a separate type
of dependencies. In particular, I've found it helpful for the
currently-not-really-addressed-in-Maven-2 use case of packaging wars in an
ear, with (most) dependent jars packaged in the ear. You make a dependency
project for the things you want packaged in the ear, and have the war
project and the ear project depend on the dependency project. The only
difficulty with this is that the exclusion of the jars from the war is an
awkward business, because you only have includes and excludes to work with,
with only * as wildcards. Regular expressions would clean that right up, and
I've requested such a change here: http://jira.codehaus.org/browse/MWAR-81 

I've found other uses for this too. I think it's a neat trick.

-- Bryan

-----Original Message-----
From: Wendy Smoak [mailto:[EMAIL PROTECTED] 
Sent: Friday, December 22, 2006 5:34 PM
To: Maven Users List
Subject: Re: Dependency groups?

On 12/22/06, MikeKey <[EMAIL PROTECTED]> wrote:
>
> Forgive a likely newbie question but I've not found anything outside a
hacked
> parent pom to get something like this to work.
>
> Is there any way to setup a pre-defined set of dependencies to include in
a
> given pom?  For example, Hibernate requires several jars to be included as
> dependencies to a project using it...is there a sane way in maven to
define
> a hibernate-dependencies.pom or something like that and include it in my
> pom.xml?  To make a reusable set of dependencies?

Without seeing the project, it's hard to make a recommendation.  If
you're finding that you have the same dependencies in a lot of places,
is it possible that some code could be moved into a separate module?
Then you'd depend on that jar, and get thost dependencies
transitively.

To answer your original question... I'm not sure I'd recommend this
approach, but (I just tried it and) it works... you can create a
project with <packaging>pom which has dependencies, and then have your
project _depend_ on that pom, so that you pick up those dependencies
transitively.  For example

    <dependency>
      <groupId>net.wsmoak</groupId>
      <artifactId>dependencies-only</artifactId>
      <version>1.0-SNAPSHOT</version>
      <type>pom</type>
   </dependency>

-- 
Wendy

---------------------------------------------------------------------
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]

Reply via email to