File tree 1 file changed +25
-0
lines changed
build-logic/publishing/src/main/kotlin
1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change
1
+ import groovy.util.Node
2
+ import groovy.util.NodeList
3
+
1
4
/*
2
5
* Licensed to the Apache Software Foundation (ASF) under one or more
3
6
* contributor license agreements. See the NOTICE file distributed with
@@ -45,6 +48,28 @@ publishing {
45
48
}
46
49
}
47
50
pom {
51
+ withXml {
52
+ val pom = asNode()
53
+ // Maven does not support dependencyManagement, so remove it anyway
54
+ for (dependencyManagement in (pom[" dependencyManagement" ] as NodeList )) {
55
+ pom.remove(dependencyManagement as Node )
56
+ }
57
+ // Gradle maps test fixtures to optional=true, so we remove those elements form the POM to avoid
58
+ // confusion
59
+ // See https://github.com/gradle/gradle/issues/14936
60
+ // See https://github.com/apache/jmeter/issues/6030
61
+ val dependencies = pom[" dependencies" ] as NodeList
62
+ for (dependenciesNode in dependencies) {
63
+ dependenciesNode as Node
64
+ for (dependency in (dependenciesNode[" dependency" ] as NodeList )) {
65
+ dependency as Node
66
+ if ((dependency[" optional" ] as ? NodeList )?.firstOrNull()?.let { it as ? Node }
67
+ ?.text() == " true" ) {
68
+ dependenciesNode.remove(dependency)
69
+ }
70
+ }
71
+ }
72
+ }
48
73
name.set(" Apache JMeter ${project.name.replaceFirstChar { it.titlecaseChar() }} " )
49
74
// This code might be executed before project-related build.gradle.kts is evaluated
50
75
// So we delay access to project.description
You can’t perform that action at this time.
0 commit comments