diff --git a/gradle/maven/defaults-maven.gradle b/gradle/maven/defaults-maven.gradle index 7e4954a0498..fa47290feef 100644 --- a/gradle/maven/defaults-maven.gradle +++ b/gradle/maven/defaults-maven.gradle @@ -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) { + 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) + } + } + } + } + } + } } } } diff --git a/solr/modules/jwt-auth/build.gradle b/solr/modules/jwt-auth/build.gradle index 7cc4afb007e..7cf05aa2cef 100644 --- a/solr/modules/jwt-auth/build.gradle +++ b/solr/modules/jwt-auth/build.gradle @@ -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')