Road to Grails 2.3: Improved Dependency Resolution
During the various Grails conferences last year (2GX, Gr8conf, Grails Exchange etc.) there were significant numbers of people who commented that dependency resolution was their biggest problem with Grails.
We’ve made improvements in this area already, in Grails 2.1 we introduced proper Maven support, but that still requires you to use the Maven build tool. Folks using the normal Grails command line have been stuck with Ivy. Starting with the upcoming Grails 2.3 release you will be able to switch to Aether as the default dependency manager by adding the following line to your BuildConfig:
grails.project.dependency.resolver = “maven”
What is Aether? Aether is the dependency resolution library used by Maven itself for resolution. What this means is that several problems users have had with Ivy go away, including:
- Problematic snapshot handling (Ivy doesn’t deal with snapshots the same as Maven)
- Issues with different packaging types used in POMs
- Lack of support for repository URLs in POMs (although this is discouraged)
- Problems with complex POMs and classifiers
In addition to this, to help users diagnose dependency resolution failures we have shamelessly borrowed/stolen Gradle’s dependency graph output for Grails’ dependency-report command:
And when you get dependency resolution failures you get nice output highlighting the dependency that failed to resolve:
There have been numerous internal framework improvements as well to reduce the number of dependency, cleanup Grails’ transitive dependencies and ensure issues like 2 plugins with the same version conflicting don’t happen.
Of course, we still have on the roadmap to move to Gradle in Grails 3.0, but in the meantime Grails 2.x users should have something to look forward to ease any dependency resolution woes.