You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Mark Struberg <st...@yahoo.de> on 2009/01/17 14:27:08 UTC

dependencyManagement do not work for attached artifacts

Hi!

I'm not sure if this behaviour is by design or a bug.

The situation:

I have 2 modules in my project

1.) openwebbeans-impl
2.) openwebbeans-tck (there is a reason for having this in a separate module currently)

The impl contains test code (e.g. MockManager) which I like to use in the tck module, so I used the maven-jar-plugin:test-jar to additionally create an attached artifact with classifier "tests"

Now my problem:

The dependencyManagement in the parent pom contains the version for openwebbeans-impl, but this version doesn't work for all attached items of this artifact. So maven is complaining about not finding the version of openwebbeans-impl:tests.

I'd expect maven to use the version of the main artifact if no special version is defined for an attached artifact.
Otherwise I'd have to maintain the version of impl twice in my dependencyManagement section

WDYT? bug or by design?

txs and LieGrue,
strub


      

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


RE: dependencyManagement do not work for attached artifacts

Posted by Mark Struberg <st...@yahoo.de>.
Thanks Brian!

I know about this approach, but I'm not sure if the maven-release-plugin can handle this case properly! So if I do a full release, will the versions of _both_ references in the dependencyManagement section be updated correctly, or only the one without classifier?

Regarding the property: the property-expansion takes place before the project tree is built, isn't? If so, this should work (assuming a yes in above case) since the maven-release-plugin would get the proper version string filled in before.

txs,
strub

--- Brian E. Fox <br...@reply.infinity.nu> schrieb am Sa, 17.1.2009:

> Von: Brian E. Fox <br...@reply.infinity.nu>
> Betreff: RE: dependencyManagement do not work for attached artifacts
> An: "Maven Users List" <us...@maven.apache.org>
> Datum: Samstag, 17. Januar 2009, 19:33
> Specify another dependencyManagement and specify the
> classifier "tests" and it will work. Classifier is
> part of the coordinates and if you skip it, it's assumed
> to be null. If you want to keep both entries in sync, then
> define a property for the version.
> 
> -----Original Message-----
> From: Mark Struberg [mailto:struberg@yahoo.de] 
> Sent: Saturday, January 17, 2009 5:27 AM
> To: users@maven.apache.org
> Subject: dependencyManagement do not work for attached
> artifacts
> 
> Hi!
> 
> I'm not sure if this behaviour is by design or a bug.
> 
> The situation:
> 
> I have 2 modules in my project
> 
> 1.) openwebbeans-impl
> 2.) openwebbeans-tck (there is a reason for having this in
> a separate module currently)
> 
> The impl contains test code (e.g. MockManager) which I like
> to use in the tck module, so I used the
> maven-jar-plugin:test-jar to additionally create an attached
> artifact with classifier "tests"
> 
> Now my problem:
> 
> The dependencyManagement in the parent pom contains the
> version for openwebbeans-impl, but this version doesn't
> work for all attached items of this artifact. So maven is
> complaining about not finding the version of
> openwebbeans-impl:tests.
> 
> I'd expect maven to use the version of the main
> artifact if no special version is defined for an attached
> artifact.
> Otherwise I'd have to maintain the version of impl
> twice in my dependencyManagement section
> 
> WDYT? bug or by design?
> 
> txs and LieGrue,
> strub
> 
> 
>       
> 
> ---------------------------------------------------------------------
> 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: dependencyManagement do not work for attached artifacts

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
Specify another dependencyManagement and specify the classifier "tests" and it will work. Classifier is part of the coordinates and if you skip it, it's assumed to be null. If you want to keep both entries in sync, then define a property for the version.

-----Original Message-----
From: Mark Struberg [mailto:struberg@yahoo.de] 
Sent: Saturday, January 17, 2009 5:27 AM
To: users@maven.apache.org
Subject: dependencyManagement do not work for attached artifacts

Hi!

I'm not sure if this behaviour is by design or a bug.

The situation:

I have 2 modules in my project

1.) openwebbeans-impl
2.) openwebbeans-tck (there is a reason for having this in a separate module currently)

The impl contains test code (e.g. MockManager) which I like to use in the tck module, so I used the maven-jar-plugin:test-jar to additionally create an attached artifact with classifier "tests"

Now my problem:

The dependencyManagement in the parent pom contains the version for openwebbeans-impl, but this version doesn't work for all attached items of this artifact. So maven is complaining about not finding the version of openwebbeans-impl:tests.

I'd expect maven to use the version of the main artifact if no special version is defined for an attached artifact.
Otherwise I'd have to maintain the version of impl twice in my dependencyManagement section

WDYT? bug or by design?

txs and LieGrue,
strub


      

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


Re: dependencyManagement do not work for attached artifacts

Posted by Jörg Schaible <jo...@gmx.de>.
Mark Struberg wrote:

> Hi Jörg!
> 
>> Typically you will set scope "test" for
>> this artifact in your depMgmnt section ...
> 
> Yup, but this means that the version has to be set twice.
> Also I'm not sure if the maven-release-plugin can handle 2
> dependencyManagement entries for the same module correctly.
> 
> Has anyone tried releasing such a scenario yet?

Yes, it does.

- Jörg


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


Re: dependencyManagement do not work for attached artifacts

Posted by Mark Struberg <st...@yahoo.de>.
Hi Jörg!

> Typically you will set scope "test" for
> this artifact in your depMgmnt section ...

Yup, but this means that the version has to be set twice.
Also I'm not sure if the maven-release-plugin can handle 2 dependencyManagement entries for the same module correctly.

Has anyone tried releasing such a scenario yet?

txs and LieGrue,
strub

--- Jörg Schaible <jo...@gmx.de> schrieb am Sa, 17.1.2009:

> Von: Jörg Schaible <jo...@gmx.de>
> Betreff: Re: dependencyManagement do not work for attached artifacts
> An: users@maven.apache.org
> Datum: Samstag, 17. Januar 2009, 15:53
> Mark Struberg wrote:
> 
> > Hi!
> > 
> > I'm not sure if this behaviour is by design or a
> bug.
> > 
> > The situation:
> > 
> > I have 2 modules in my project
> > 
> > 1.) openwebbeans-impl
> > 2.) openwebbeans-tck (there is a reason for having
> this in a separate
> > module currently)
> > 
> > The impl contains test code (e.g. MockManager) which I
> like to use in the
> > tck module, so I used the maven-jar-plugin:test-jar to
> additionally create
> > an attached artifact with classifier "tests"
> > 
> > Now my problem:
> > 
> > The dependencyManagement in the parent pom contains
> the version for
> > openwebbeans-impl, but this version doesn't work
> for all attached items of
> > this artifact. So maven is complaining about not
> finding the version of
> > openwebbeans-impl:tests.
> > 
> > I'd expect maven to use the version of the main
> artifact if no special
> > version is defined for an attached artifact. Otherwise
> I'd have to
> > maintain the version of impl twice in my
> dependencyManagement section
> > 
> > WDYT? bug or by design?
> 
> By design. Each classifier defines a separate artifact with
> individual
> settings for version and scope. Typically you will set
> scope "test" for
> this artifact in your depMgmnt section ...
> 
> - Jörg
> 
> 


      

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


Re: dependencyManagement do not work for attached artifacts

Posted by Jörg Schaible <jo...@gmx.de>.
Mark Struberg wrote:

> Hi!
> 
> I'm not sure if this behaviour is by design or a bug.
> 
> The situation:
> 
> I have 2 modules in my project
> 
> 1.) openwebbeans-impl
> 2.) openwebbeans-tck (there is a reason for having this in a separate
> module currently)
> 
> The impl contains test code (e.g. MockManager) which I like to use in the
> tck module, so I used the maven-jar-plugin:test-jar to additionally create
> an attached artifact with classifier "tests"
> 
> Now my problem:
> 
> The dependencyManagement in the parent pom contains the version for
> openwebbeans-impl, but this version doesn't work for all attached items of
> this artifact. So maven is complaining about not finding the version of
> openwebbeans-impl:tests.
> 
> I'd expect maven to use the version of the main artifact if no special
> version is defined for an attached artifact. Otherwise I'd have to
> maintain the version of impl twice in my dependencyManagement section
> 
> WDYT? bug or by design?

By design. Each classifier defines a separate artifact with individual
settings for version and scope. Typically you will set scope "test" for
this artifact in your depMgmnt section ...

- Jörg


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