Skip to content

Commit 07f111e

Browse files
authored
SOLR-17602 Exclude platform module from generated pom (#4039)
1 parent f61a21c commit 07f111e

2 files changed

Lines changed: 34 additions & 10 deletions

File tree

gradle/maven/defaults-maven.gradle

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,38 @@ configure(subprojects.findAll { it.path in rootProject.published }) { prj ->
148148
artifact javadocJar
149149

150150
pom(configurePom)
151+
152+
// Remove the internal :platform dependency from dependencyManagement in POMs
153+
pom.withXml {
154+
def root = asNode()
155+
def depMgmt = root.dependencyManagement
156+
if (depMgmt) {
157+
depMgmt.each { dmNode ->
158+
def deps = dmNode.dependencies
159+
if (deps) {
160+
deps.each { depsNode ->
161+
// Collect dependencies to remove (can't modify while iterating)
162+
def toRemove = []
163+
depsNode.dependency.each { dep ->
164+
def groupId = dep.groupId?.text()
165+
def artifactId = dep.artifactId?.text()
166+
if (groupId == 'org.apache' && artifactId == 'platform') {
167+
toRemove.add(dep)
168+
}
169+
}
170+
// Remove the collected dependencies
171+
toRemove.each { dep ->
172+
depsNode.remove(dep)
173+
}
174+
// Remove dependencyManagement section if it's now empty
175+
if (depsNode.dependency.isEmpty()) {
176+
root.remove(dmNode)
177+
}
178+
}
179+
}
180+
}
181+
}
182+
}
151183
}
152184
}
153185
}

solr/modules/jwt-auth/build.gradle

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,9 @@ apply plugin: 'java-library'
1919

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

22-
// This is a hacky way to use permitTestUnusedDeclared with bom declared dependencies.
23-
// See https://github.com/gradle-dependency-analyze/gradle-dependency-analyze/issues/108
24-
configurations {
25-
constraintsOnly
26-
permitTestUnusedDeclared.extendsFrom constraintsOnly
27-
implementation.extendsFrom constraintsOnly
28-
}
29-
3022
dependencies {
31-
constraintsOnly platform(project(':platform'))
32-
constraintsOnly platform(libs.fasterxml.jackson.bom)
23+
implementation platform(project(':platform'))
24+
implementation platform(libs.fasterxml.jackson.bom)
3325

3426
implementation project(':solr:core')
3527
implementation project(':solr:solrj')

0 commit comments

Comments
 (0)