On Tue, Feb 5, 2013 at 6:10 AM, Matthew Adams <[email protected]>wrote:

> What I was looking
> for was a way to define a new artifact in a pom that, if used in a
> consuming artifact's <dependencies>, would include all of the dependencies
> in the referenced artifact.


Hello; you can do this today by simply declaring a "normal" dependency on
an artifact of type pom.

So:

<dependency>
  <groupId>your.datanucleus.pom.groupId</groupId>
  <artifactId>your.datanucleus.pom.artifactId</artifactId>
  <version>whatever</version>
  <scope>compile</scope>
  <type>pom</type>
</dependency>


You should not feel like you missed something; this is not really explained
well anywhere.  You kind of have to infer it from other parts of the Maven
documentation.

There are several side effects to doing things this way, which may or may
not matter to you.

First, the dependencies are "one level down"--that is, you didn't include
your pom artifact's dependencies directly, you included them transitively.
 This might have a bearing on what versions of a given dependency "win" in
a complex inherited pom scenario.

Second, I'm just frankly not sure how (or if) the
dependencyManagementsection in the pom-as-dependency will work, if at
all.

I hope this helps.

Best,
Laird

-- 
http://about.me/lairdnelson

Reply via email to