Skip to content

Commit ac88106

Browse files
committed
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.
1 parent 8d927df commit ac88106

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

gradle/publish-maven.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ def customizePom(pom, gradleProject) {
1313
dep.scope == "test"
1414
}
1515

16+
// sort to make pom dependencies order consistent to ease comparison of older poms
17+
generatedPom.dependencies = generatedPom.dependencies.sort { dep ->
18+
"$dep.scope:$dep.groupId:$dep.artifactId"
19+
}
20+
1621
// add all items necessary for maven central publication
1722
generatedPom.project {
1823
name = gradleProject.description

0 commit comments

Comments
 (0)