My bad.  I didn't see that you had attached the files.

>From what I understand, the import will only work with the dependency
management (dep. mgmt) section.  My guess is that it's being ignored with
how you have your pom's.  You could remove it and see if you get the same
result.  My mental definitation for the dep. mgmt section is "if you're
going to use this artifact, use this version, scope, exclusions, etc".  I
don't think that transitive dependencies are ever pulled across.

I understand what you're trying to do, but I don't think that it's possible
with maven today.  What you'll have to do is move your dependencies from
your a-pom into the dep mgmt section, import them into the b-pom's dep mgmt
section, and then have them as dependencies by just listing the groupId,
artifactId, and possibly the classifier.

It's not as "neat" in some ways, but it also means that you don't *have* to
pull in a dependency from the a-pom if you don't to use it.

I thought that the dep mgmt import thing was weird / strange at first, but
it's very, very useful.  Cleans the pom's up a bunch too.

Jim


On Thu, May 14, 2009 at 11:19 AM, Nick Stolwijk <[email protected]>wrote:

> On Thu, May 14, 2009 at 5:00 PM, Jim Sellers <[email protected]>
> wrote:
> > Just a note: "import" is a scope used in the dependency management
> section,
> > so I found your original question confusing.
>
> I had attached the a and b pom, but I did import the the pom in the
> dependencies section and it worked mostly. So, why is this only to be
> used in the dependency management section?
>
> What I want to achieve is a coupling of dependencies, so the project
> that depends on these coupling can depend on one dependency, instead
> of the group of dependencies.
>
> So, project A is the coupling project which has dependencies on X, Y and Z.
> Project B needs X, Y and Z, but instead of depending on the three of
> them, I want it as a package, thus A. I have inserted project A as a
> dependency with scope import in B and for most of the dependencies
> defined in A, project B now works, except for the provided dependency.
>
> Is this use case supported?
>
> With regards,
>
> Nick Stolwijk
> ~Java Developer~
>
> Iprofs BV.
> Claus Sluterweg 125
> 2012 WS Haarlem
> www.iprofs.nl
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to