Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions gradle/maven/defaults-maven.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,38 @@ configure(subprojects.findAll { it.path in rootProject.published }) { prj ->
artifact javadocJar

pom(configurePom)

// Remove the internal :platform dependency from dependencyManagement in POMs
pom.withXml {
def root = asNode()
def depMgmt = root.dependencyManagement
if (depMgmt) {
depMgmt.each { dmNode ->
def deps = dmNode.dependencies
if (deps) {
Comment on lines +158 to +159
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor syntax recommendation but I love Groovy's elvis operator. Using it would remove an indentation level (lowering cyclomatic complexity) while keeping null-safety. Same above at depMgmt. I used to write a lot of Groovy back in the day.

deps.each { depsNode ->
// Collect dependencies to remove (can't modify while iterating)
def toRemove = []
depsNode.dependency.each { dep ->
def groupId = dep.groupId?.text()
def artifactId = dep.artifactId?.text()
if (groupId == 'org.apache' && artifactId == 'platform') {
toRemove.add(dep)
}
}
// Remove the collected dependencies
toRemove.each { dep ->
depsNode.remove(dep)
}
// Remove dependencyManagement section if it's now empty
if (depsNode.dependency.isEmpty()) {
root.remove(dmNode)
}
}
}
}
}
}
}
}
}
Expand Down
12 changes: 2 additions & 10 deletions solr/modules/jwt-auth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,9 @@ apply plugin: 'java-library'

description = 'JWT / OpenID Connect / OAuth2 authentication plugin'

// This is a hacky way to use permitTestUnusedDeclared with bom declared dependencies.
// See https://github.com/gradle-dependency-analyze/gradle-dependency-analyze/issues/108
configurations {
constraintsOnly
permitTestUnusedDeclared.extendsFrom constraintsOnly
implementation.extendsFrom constraintsOnly
}

dependencies {
constraintsOnly platform(project(':platform'))
constraintsOnly platform(libs.fasterxml.jackson.bom)
implementation platform(project(':platform'))
implementation platform(libs.fasterxml.jackson.bom)

implementation project(':solr:core')
implementation project(':solr:solrj')
Expand Down
Loading