Skip to content

Commit 0dcc00f

Browse files
committed
Fix POM contents for proper Maven publication
1 parent 8069f43 commit 0dcc00f

File tree

7 files changed

+134
-92
lines changed

7 files changed

+134
-92
lines changed

.github/workflows/publish-maven.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ jobs:
2727
ORG_GRADLE_PROJECT_SIGNINGKEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }}
2828
ORG_GRADLE_PROJECT_SIGNINGPASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }}
2929
run: >-
30-
./gradlew publish
30+
./gradlew publish -Dorg.gradle.parallel=false

buildSrc/src/main/groovy/rhino.library-conventions.gradle

+13
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
plugins {
77
id 'rhino.java-conventions'
88
id 'maven-publish'
9+
id 'signing'
910
id 'jacoco'
1011
id 'net.ltgt.errorprone'
1112
}
@@ -98,6 +99,18 @@ task sourceJar(type: Jar) {
9899
}
99100
}
100101

102+
signing {
103+
if (project.hasProperty('SIGNINGKEY')) {
104+
// Check for ORG_GRADLE_PROJECT_SIGNINGKEY environment variable for use in CI system.
105+
// Otherwise, do not sign.
106+
def signingKey = getProperty('SIGNINGKEY')
107+
def signingPassword = getProperty('SIGNINGPASSWORD')
108+
useInMemoryPgpKeys(signingKey, signingPassword)
109+
sign publishing.publications
110+
}
111+
}
112+
113+
101114
publishing {
102115
if (project.hasProperty("mavenPassword")) {
103116
repositories {

rhino-all/build.gradle

+24-19
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,30 @@ publishing {
3939
publications {
4040
rhinoall(MavenPublication) {
4141
from components.java
42-
artifacts = [jar]
43-
pom {
44-
description = "Rhino JavaScript all-in-one JAR, not for use with modular Java projects"
45-
url = "https://mozilla.github.io/rhino/"
46-
licenses {
47-
license {
48-
name = "Mozilla Public License, Version 2.0"
49-
url = "http://www.mozilla.org/MPL/2.0/index.txt"
50-
}
51-
}
52-
scm {
53-
connection = "scm:git:[email protected]:mozilla/rhino.git"
54-
developerConnection = "scm:git:[email protected]:mozilla/rhino.git"
55-
url = "[email protected]:mozilla/rhino.git"
56-
}
57-
organization {
58-
name = "The Mozilla Foundation"
59-
url = "http://www.mozilla.org"
60-
}
42+
artifacts = [jar, sourceJar, javadocJar]
43+
pom.withXml {
44+
def root = asNode()
45+
46+
root.appendNode('description', "Rhino JavaScript all-in-one JAR, not for use with modular Java projects")
47+
root.appendNode("url", "https://mozilla.github.io/rhino/")
48+
49+
def p = root.appendNode("parent")
50+
p.appendNode("groupId", "org.sonatype.oss")
51+
p.appendNode("artifactId", "oss-parent")
52+
p.appendNode("version", "7")
53+
54+
def l = root.appendNode("licenses").appendNode("license")
55+
l.appendNode("name", "Mozilla Public License, Version 2.0")
56+
l.appendNode("url", "http://www.mozilla.org/MPL/2.0/index.txt")
57+
58+
def scm = root.appendNode("scm")
59+
scm.appendNode("connection", "scm:git:[email protected]:mozilla/rhino.git")
60+
scm.appendNode("developerConnection", "scm:git:[email protected]:mozilla/rhino.git")
61+
scm.appendNode("url", "[email protected]:mozilla/rhino.git")
62+
63+
def o = root.appendNode("organization")
64+
o.appendNode("name", "The Mozilla Foundation")
65+
o.appendNode("url", "http://www.mozilla.org")
6166
}
6267
}
6368
}

rhino-engine/build.gradle

+23-18
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,29 @@ publishing {
1111
rhinoengine(MavenPublication) {
1212
from components.java
1313
artifacts = [jar, sourceJar, javadocJar]
14-
pom {
15-
description = "Rhino ScriptEngine implementation"
16-
url = "https://mozilla.github.io/rhino/"
17-
licenses {
18-
license {
19-
name = "Mozilla Public License, Version 2.0"
20-
url = "http://www.mozilla.org/MPL/2.0/index.txt"
21-
}
22-
}
23-
scm {
24-
connection = "scm:git:[email protected]:mozilla/rhino.git"
25-
developerConnection = "scm:git:[email protected]:mozilla/rhino.git"
26-
url = "[email protected]:mozilla/rhino.git"
27-
}
28-
organization {
29-
name = "The Mozilla Foundation"
30-
url = "http://www.mozilla.org"
31-
}
14+
pom.withXml {
15+
def root = asNode()
16+
17+
root.appendNode('description', "Rhino ScriptEngine implementation")
18+
root.appendNode("url", "https://mozilla.github.io/rhino/")
19+
20+
def p = root.appendNode("parent")
21+
p.appendNode("groupId", "org.sonatype.oss")
22+
p.appendNode("artifactId", "oss-parent")
23+
p.appendNode("version", "7")
24+
25+
def l = root.appendNode("licenses").appendNode("license")
26+
l.appendNode("name", "Mozilla Public License, Version 2.0")
27+
l.appendNode("url", "http://www.mozilla.org/MPL/2.0/index.txt")
28+
29+
def scm = root.appendNode("scm")
30+
scm.appendNode("connection", "scm:git:[email protected]:mozilla/rhino.git")
31+
scm.appendNode("developerConnection", "scm:git:[email protected]:mozilla/rhino.git")
32+
scm.appendNode("url", "[email protected]:mozilla/rhino.git")
33+
34+
def o = root.appendNode("organization")
35+
o.appendNode("name", "The Mozilla Foundation")
36+
o.appendNode("url", "http://www.mozilla.org")
3237
}
3338
}
3439
}

rhino-tools/build.gradle

+23-18
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,29 @@ publishing {
1111
rhinotools(MavenPublication) {
1212
from components.java
1313
artifacts = [jar, sourceJar, javadocJar]
14-
pom {
15-
description = "Rhino tools, including shell and debugger"
16-
url = "https://mozilla.github.io/rhino/"
17-
licenses {
18-
license {
19-
name = "Mozilla Public License, Version 2.0"
20-
url = "http://www.mozilla.org/MPL/2.0/index.txt"
21-
}
22-
}
23-
scm {
24-
connection = "scm:git:[email protected]:mozilla/rhino.git"
25-
developerConnection = "scm:git:[email protected]:mozilla/rhino.git"
26-
url = "[email protected]:mozilla/rhino.git"
27-
}
28-
organization {
29-
name = "The Mozilla Foundation"
30-
url = "http://www.mozilla.org"
31-
}
14+
pom.withXml {
15+
def root = asNode()
16+
17+
root.appendNode('description', "Rhino tools, including shell and debugger")
18+
root.appendNode("url", "https://mozilla.github.io/rhino/")
19+
20+
def p = root.appendNode("parent")
21+
p.appendNode("groupId", "org.sonatype.oss")
22+
p.appendNode("artifactId", "oss-parent")
23+
p.appendNode("version", "7")
24+
25+
def l = root.appendNode("licenses").appendNode("license")
26+
l.appendNode("name", "Mozilla Public License, Version 2.0")
27+
l.appendNode("url", "http://www.mozilla.org/MPL/2.0/index.txt")
28+
29+
def scm = root.appendNode("scm")
30+
scm.appendNode("connection", "scm:git:[email protected]:mozilla/rhino.git")
31+
scm.appendNode("developerConnection", "scm:git:[email protected]:mozilla/rhino.git")
32+
scm.appendNode("url", "[email protected]:mozilla/rhino.git")
33+
34+
def o = root.appendNode("organization")
35+
o.appendNode("name", "The Mozilla Foundation")
36+
o.appendNode("url", "http://www.mozilla.org")
3237
}
3338
}
3439
}

rhino-xml/build.gradle

+23-18
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,29 @@ publishing {
1111
rhinoxml(MavenPublication) {
1212
from components.java
1313
artifacts = [jar, sourceJar, javadocJar]
14-
pom {
15-
description = "Rhino XML support"
16-
url = "https://mozilla.github.io/rhino/"
17-
licenses {
18-
license {
19-
name = "Mozilla Public License, Version 2.0"
20-
url = "http://www.mozilla.org/MPL/2.0/index.txt"
21-
}
22-
}
23-
scm {
24-
connection = "scm:git:[email protected]:mozilla/rhino.git"
25-
developerConnection = "scm:git:[email protected]:mozilla/rhino.git"
26-
url = "[email protected]:mozilla/rhino.git"
27-
}
28-
organization {
29-
name = "The Mozilla Foundation"
30-
url = "http://www.mozilla.org"
31-
}
14+
pom.withXml {
15+
def root = asNode()
16+
17+
root.appendNode('description', "Rhino XML support")
18+
root.appendNode("url", "https://mozilla.github.io/rhino/")
19+
20+
def p = root.appendNode("parent")
21+
p.appendNode("groupId", "org.sonatype.oss")
22+
p.appendNode("artifactId", "oss-parent")
23+
p.appendNode("version", "7")
24+
25+
def l = root.appendNode("licenses").appendNode("license")
26+
l.appendNode("name", "Mozilla Public License, Version 2.0")
27+
l.appendNode("url", "http://www.mozilla.org/MPL/2.0/index.txt")
28+
29+
def scm = root.appendNode("scm")
30+
scm.appendNode("connection", "scm:git:[email protected]:mozilla/rhino.git")
31+
scm.appendNode("developerConnection", "scm:git:[email protected]:mozilla/rhino.git")
32+
scm.appendNode("url", "[email protected]:mozilla/rhino.git")
33+
34+
def o = root.appendNode("organization")
35+
o.appendNode("name", "The Mozilla Foundation")
36+
o.appendNode("url", "http://www.mozilla.org")
3237
}
3338
}
3439
}

rhino/build.gradle

+27-18
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,33 @@ publishing {
1111
rhino(MavenPublication) {
1212
from components.java
1313
artifacts = [jar, sourceJar, javadocJar]
14-
pom {
15-
description = "Rhino JavaScript runtime jar, excludes XML, tools ScriptEngine wrapper"
16-
url = "https://mozilla.github.io/rhino/"
17-
licenses {
18-
license {
19-
name = "Mozilla Public License, Version 2.0"
20-
url = "http://www.mozilla.org/MPL/2.0/index.txt"
21-
}
22-
}
23-
scm {
24-
connection = "scm:git:[email protected]:mozilla/rhino.git"
25-
developerConnection = "scm:git:[email protected]:mozilla/rhino.git"
26-
url = "[email protected]:mozilla/rhino.git"
27-
}
28-
organization {
29-
name = "The Mozilla Foundation"
30-
url = "http://www.mozilla.org"
31-
}
14+
// We need to use the "withXml" method here, rather than the
15+
// "pom" element in Gradle, because we can't add the "parent"
16+
// attribute otherwise, and without it Maven Central verification
17+
// will fail.
18+
pom.withXml {
19+
def root = asNode()
20+
21+
root.appendNode('description', "Rhino JavaScript runtime jar, excludes XML, tools, and ScriptEngine wrapper")
22+
root.appendNode("url", "https://mozilla.github.io/rhino/")
23+
24+
def p = root.appendNode("parent")
25+
p.appendNode("groupId", "org.sonatype.oss")
26+
p.appendNode("artifactId", "oss-parent")
27+
p.appendNode("version", "7")
28+
29+
def l = root.appendNode("licenses").appendNode("license")
30+
l.appendNode("name", "Mozilla Public License, Version 2.0")
31+
l.appendNode("url", "http://www.mozilla.org/MPL/2.0/index.txt")
32+
33+
def scm = root.appendNode("scm")
34+
scm.appendNode("connection", "scm:git:[email protected]:mozilla/rhino.git")
35+
scm.appendNode("developerConnection", "scm:git:[email protected]:mozilla/rhino.git")
36+
scm.appendNode("url", "[email protected]:mozilla/rhino.git")
37+
38+
def o = root.appendNode("organization")
39+
o.appendNode("name", "The Mozilla Foundation")
40+
o.appendNode("url", "http://www.mozilla.org")
3241
}
3342
}
3443
}

0 commit comments

Comments
 (0)