Sort maven dependencies in generated pom files

Previously the maven dependencies were specified in an arbitrary order
which made comparing the poms against other versions difficult.

This commit sorts the dependencies by scope, group id, and then
artifact id.
This commit is contained in:
Rob Winch
2013-01-28 10:28:14 -06:00
parent 8d927dffb3
commit ac88106676

View File

@@ -13,6 +13,11 @@ def customizePom(pom, gradleProject) {
dep.scope == "test"
}
// sort to make pom dependencies order consistent to ease comparison of older poms
generatedPom.dependencies = generatedPom.dependencies.sort { dep ->
"$dep.scope:$dep.groupId:$dep.artifactId"
}
// add all items necessary for maven central publication
generatedPom.project {
name = gradleProject.description