Skip to content

Commit

Permalink
Merge pull request #908 from jhouserizer/apply_proper_maven_scopes
Browse files Browse the repository at this point in the history
Apply overrides for maven scopes on dependencies, fixes #306
  • Loading branch information
jhouserizer authored Apr 20, 2023
2 parents 0d2862e + 360f810 commit 29970c1
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ allprojects {
}

publishing {
configurations {
provided
runtimeClasspath.extendsFrom(provided)
}
publications {
maven(MavenPublication) {
pom {
Expand All @@ -62,7 +66,24 @@ allprojects {
}
}
}

from components.java
pom.withXml {
asNode()
.dependencies
.dependency
.findAll { dependency ->
// Patch up dependency scopes per expectations of maven users
(dependency.groupId.text() == 'com.mchange' ||
dependency.groupId.text() == 'com.zaxxer' ||
dependency.artifactId.text() == 'slf4j-log4j12' ||
dependency.groupId.text() == 'javax.xml' )
}
.each { dependency ->
// Set scope value to compile.
dependency.scope*.value = 'provided'
}
}
}
}
}
Expand Down

0 comments on commit 29970c1

Please sign in to comment.