Skip to content

Commit

Permalink
Merge pull request #769 from desiderantes/master
Browse files Browse the repository at this point in the history
Do not add a dependencies block if it's already there
  • Loading branch information
johnrengelman authored Jul 20, 2022
2 parents 225285b + 6b7bb9b commit 38566d5
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class ShadowExtension {

publication.pom { MavenPom pom ->
pom.withXml { xml ->
def dependenciesNode = xml.asNode().appendNode('dependencies')

def dependenciesNode = xml.asNode().get('dependencies')?.get(0) ?: xml.asNode().appendNode('dependencies')
dependenciesNode.value = ""
project.configurations.shadow.allDependencies.each {
if ((it instanceof ProjectDependency) || ! (it instanceof SelfResolvingDependency)) {
def dependencyNode = dependenciesNode.appendNode('dependency')
Expand Down

0 comments on commit 38566d5

Please sign in to comment.