Issue Details (XML | Word | Printable)

Key: MNG-2757
Type: Wish Wish
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Brett Porter
Reporter: Matt Raible
Votes: 3
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Maven 2 & 3

Allow dependency properties to be overriden by projects that use them

Created: 11/Jan/07 04:28 PM   Updated: 18/Dec/08 08:19 AM   Resolved: 18/Dec/08 08:19 AM
Return to search
Component/s: Dependencies
Affects Version/s: 2.0.4
Fix Version/s: None

Time Tracking:
Not Specified

Complexity: Intermediate



Jason van Zyl made changes - 05/Jun/07 12:05 PM
Field Original Value New Value
Assignee Jason van Zyl [ jason ]
Dan Allen added a comment - 13/Jun/07 08:37 PM

Damn, I just bumped in to this problem only to find that there is still no solution. I am trying to do a very similar thing. When one of my libraries depends on hibernate, for example, I am using properties in the deployed pom file to specify which version should be used by default if a person where to use my jar file in their project. However, if they don't want that version of hibernate, they theoretically would set the same property in their own pom.xml file. Only, just as Matt has pointed out, the dependency pom is taking precedence over the user's pom.xml. This behavior makes absolutely no sense, especially since it is possible to achieve this override from the commandline. The perfectly logical order would be: dependency pom -> user pom -> commandline flag.

Here is some XML to demonstrate what I am doing:

some-cool-library.pom

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>${hibernate.version}</version>
</dependency>
<properties>
<hibernate.version>3.2.1.ga</hibernate.version>
</properties>

user's pom.xml

<properties>
<hibernate.version>3.2.4.sp1</hibernate.version>
</properties>

result: no dice.


Jason van Zyl made changes - 14/Jun/07 11:41 PM
Fix Version/s Reviewed [ 13555 ]
Brett Porter added a comment - 18/Dec/08 08:19 AM

this can now be corrected by using the dependency management element for hibernate in your own POM rather than taking a stab at the properties they might have used.


Brett Porter made changes - 18/Dec/08 08:19 AM
Assignee Jason van Zyl [ jason ] Brett Porter [ brettporter ]
Resolution Won't Fix [ 2 ]
Fix Version/s Reviewed Pending Version Assignment [ 13555 ]
Status Open [ 1 ] Closed [ 6 ]