[GRADLE-1992] Support for pinned versions (subset of version ranges) Created: 09/Dec/11  Updated: 10/Feb/17  Resolved: 10/Feb/17

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: None

Type: New Feature
Reporter: Robert Watkins Assignee: Unassigned
Resolution: Won't Fix Votes: 1


 Description   

(This is a subset of the larger dependency management issues discussed in GRADLE-646)

An useful subset of the larger dependency management problem with version ranges is the idea of pinning a dependency down to a specific version. The syntax would look like this:

group: 'net.twasink', name: 'myartifact', version: '[1.0]'

This syntax has the advantage of being compatible with both Ivy and Maven.

Using pinned versions are a very convenient way of dealing with transitive dependencies that bring in newer undesired versions. This can be done manually - using the 'failOnConflict' approach from GRADLE-1899 to detect the conflicts, and then setting up exclusion rules - but that can be a time consuming process, especially for common 3rd-party libraries (e.g. differing, but compatible, versions of commons-lang). It also produces a lot of verbosity. By using this subset of version range matchers, a very common use case ('use exactly this version of that library') is solved. I have a vested interest in this as I have a large set of Maven-based projects that I would love to convert to Gradle, but which use pinned versions for exactly this task.

(Naturally, if the same dependency has multiple pinned versions in the tree, then a conflict would occur)

I've developed a bunch of Cucumber tests to drive Gradle and compare its behaviour to Maven. These tests are available at https://github.com/twasink/GradleDependencyTests - see https://github.com/twasink/GradleDependencyTests/blob/master/features/pinned_dependencies.feature in particular.

The result of the tests (against current Gradle head) is at http://twasink.net/files/gradle_dependency_result_2011_12_09.html



 Comments   
Comment by Benjamin Muschko [ 15/Nov/16 ]

As announced on the Gradle blog we are planning to completely migrate issues from JIRA to GitHub.

We intend to prioritize issues that are actionable and impactful while working more closely with the community. Many of our JIRA issues are inactionable or irrelevant. We would like to request your help to ensure we can appropriately prioritize JIRA issues you’ve contributed to.

Please confirm that you still advocate for your JIRA issue before December 10th, 2016 by:

  • Checking that your issues contain requisite context, impact, behaviors, and examples as described in our published guidelines.
  • Leave a comment on the JIRA issue or open a new GitHub issue confirming that the above is complete.

We look forward to collaborating with you more closely on GitHub. Thank you for your contribution to Gradle!

Comment by Benjamin Muschko [ 10/Feb/17 ]

Thanks again for reporting this issue. We haven't heard back from you after our inquiry from November 15th. We are closing this issue now. Please create an issue on GitHub if you still feel passionate about getting it resolved.

Generated at Wed Jun 30 12:09:52 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.