Skip to content

Commit

Permalink
Grace: remove dependencyManagement of POM
Browse files Browse the repository at this point in the history
  • Loading branch information
rainboyan committed Dec 30, 2023
1 parent 4d0108e commit 3babdda
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,29 @@ publishing {
url = 'https://github.com/graceframework/grace-fields/tree/main'
}
}

pom.withXml {
def pomNode = asNode()
pomNode.children().last() + pomInfo
try {
pomNode.dependencyManagement.replaceNode {}
} catch (Throwable e) {
// ignore
}

// simply remove dependencies without a version
// version-less dependencies are handled with dependencyManagement
// see https://github.com/spring-gradle-plugins/dependency-management-plugin/issues/8 for more complete solutions
pomNode.dependencies.dependency.findAll {
it.version.text().isEmpty()
}.each {
try {
it.replaceNode {}
} catch (Throwable e) {
// ignore
}
}
}
}
}
}
Expand Down

0 comments on commit 3babdda

Please sign in to comment.