You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Sören Chittka <so...@volkswohl-bund.de> on 2008/06/16 13:28:38 UTC
How to define that a new version of a dependency supersedes another
artifact?
Hi,
currently I am in the process of building an inhouse-maven-repository for the company I am working at.
While doing so I encountered the problem, that sometimes newer versions of dependencies do not only supersede their older version, but even
other artifacts.
One example would be JAXP:
On Java SE 5 JAXP 1.3 is provided, and I have to include a dependency to the StAX-API and an implementation for some applications (or
libraries) that use this functionality.
On Java SE 6 JAXP 1.4 is provided, which already includes the StAX-API and the reference implementation.
So what I would like to do is define a profile "JDK6" in a parent pom, with a dependencyManagement-section which tells Maven, that JAXP 1.4
is provided, which in turn should not only override JAXP 1.3 but also the defined version of the StAX-API and -implementation.
This pattern applies also to Jaxen, which from a specific version on includes the Saxpath-packages.
Is there any way to tell Maven to do what I described?
--
Mit freundlichen Grüßen
V O L K S W O H L B U N D
Lebensversicherung a.G.
Sachversicherung Aktiengesellschaft
Sören Chittka
EDV-Systementwicklung
Telefon: 0231/5433-6521
E-Mail: soeren.chittka@volkswohl-bund.de
VOLKSWOHL BUND LEBENSVERSICHERUNG a.G., Südwall 37 - 41, 44137 Dortmund
Vorstand: Dr. Joachim Maas (Vors.), Dietmar Bläsing, Dr. Ulf-Gerhard Gude, Martin Rohm
Vorsitzender des Aufsichtsrats: Werner Ackermann
Sitz des Unternehmens: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 450
VOLKSWOHL BUND SACHVERSICHERUNG AG, Südwall 37 - 41, 44137 Dortmund
Vorstand: Dr. Joachim Maas (Vors.), Dietmar Bläsing, Martin Rohm
Vorsitzender des Aufsichtsrats: Werner Ackermann
Sitz des Unternehmens: Dortmund, Registergericht: Amtsgericht Dortmund, HRB 3134
Telefon: 0231/5433-0, Telefax: 0231/5433-400, E-Mail: info@volkswohl-bund.de
Internet: www.volkswohl-bund.de
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
RE: How to define that a new version of a dependency supersedes another artifact?
Posted by Jörg Schaible <Jo...@Elsag-Solutions.com>.
Sören Chittka wrote:
> Hi,
>
> currently I am in the process of building an
> inhouse-maven-repository for the company I am working at.
> While doing so I encountered the problem, that sometimes
> newer versions of dependencies do not only supersede their
> older version, but even
> other artifacts.
>
> One example would be JAXP:
> On Java SE 5 JAXP 1.3 is provided, and I have to include a
> dependency to the StAX-API and an implementation for some
> applications (or libraries) that use this functionality.
> On Java SE 6 JAXP 1.4 is provided, which already includes the
> StAX-API and the reference implementation.
>
> So what I would like to do is define a profile "JDK6" in a
> parent pom, with a dependencyManagement-section which tells Maven,
> that JAXP 1.4 is provided, which in turn should not only override
> JAXP 1.3
> but also the defined version of the StAX-API and -implementation.
>
> This pattern applies also to Jaxen, which from a specific
> version on includes the Saxpath-packages.
>
> Is there any way to tell Maven to do what I described?
This is a long standing issue with no easy solution (MNG-177). Currently you will have to create such a profile for each artifact that uses the StaX-API directly and for artifacts that use it via transitive deps, you will have to use exclusions. The later can be declared in profiled dependencyManagement sections of an inherited POM. So, yes, it is possible, but there's a lot of individual POM management.
- Jörg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org