Bug 757732 - Provide a way to use versions to resolve artifacts
Summary: Provide a way to use versions to resolve artifacts
Alias: None
Product: Fedora
Classification: Fedora
Component: maven
Version: rawhide
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Stanislav Ochotnicky
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2011-11-28 14:34 UTC by Stanislav Ochotnicky
Modified: 2012-01-31 15:21 UTC (History)
4 users (show)

Clone Of:
Last Closed: 2012-01-31 15:21:39 UTC

Attachments (Terms of Use)

Description Stanislav Ochotnicky 2011-11-28 14:34:54 UTC
Currently our resolver ignores versions completely and returns unversioned jar all the time.

The change should make it possible to differentiate. So when package A requests gid:aid:version but we don't have that same exact version installed it will return unversioned jar as before.

If however, package B_v2 provides gid:aid:version requested by package A our resolver should prefer jar from this rpm to default unversioned one.

This feature will probably require change to %add_maven_depmap macro as well

Comment 1 Alexander Kurtakov 2011-11-28 14:51:56 UTC
Hmm, if this is implemented the provides generator should really be changed to add the versions to the provide otherwise we will get 2 packages providing the same without anyway for rpm/yum to choose between them.

Comment 2 Stanislav Ochotnicky 2012-01-31 15:21:39 UTC
OK, so I implemented a simple version of this in 3.0.4-1:

Let's say package asks for this:

We normally look into depmap in /usr/share/maven-fragments which contains:

Because of this we used look for pom files (ignoring versions)
and jar file

New maven first looks for:

And only falls back to unversioned jars/poms if exact version is not found.

This means it's possible to package rpm with alternative version by simply naming jar/pom name in the same way + the version. Advantage of this is that it doesn't require any big changes and it is fast.

It might be a good idea to have a guidelines update that would describe how to package such alternative rpms.

Note You need to log in before you can comment on or make changes to this bug.