Skip to content

Commit

Permalink
Remove dependencyManagement node of the generated POM file
Browse files Browse the repository at this point in the history
Closes gh-4
  • Loading branch information
rainboyan committed Nov 4, 2024
1 parent 5f8972e commit 6bfd64a
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,28 @@ publishing {
url = 'https://github.com/graceframework/grace-geb'
}
}

pom.withXml {
def pomNode = asNode()
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 6bfd64a

Please sign in to comment.