Skip to content

Commit

Permalink
Fix POM contents for proper Maven publication
Browse files Browse the repository at this point in the history
  • Loading branch information
gbrail committed Jan 3, 2025
1 parent 8069f43 commit 0dcc00f
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 92 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
ORG_GRADLE_PROJECT_SIGNINGKEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }}
ORG_GRADLE_PROJECT_SIGNINGPASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }}
run: >-
./gradlew publish
./gradlew publish -Dorg.gradle.parallel=false
13 changes: 13 additions & 0 deletions buildSrc/src/main/groovy/rhino.library-conventions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
plugins {
id 'rhino.java-conventions'
id 'maven-publish'
id 'signing'
id 'jacoco'
id 'net.ltgt.errorprone'
}
Expand Down Expand Up @@ -98,6 +99,18 @@ task sourceJar(type: Jar) {
}
}

signing {
if (project.hasProperty('SIGNINGKEY')) {
// Check for ORG_GRADLE_PROJECT_SIGNINGKEY environment variable for use in CI system.
// Otherwise, do not sign.
def signingKey = getProperty('SIGNINGKEY')
def signingPassword = getProperty('SIGNINGPASSWORD')
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications
}
}


publishing {
if (project.hasProperty("mavenPassword")) {
repositories {
Expand Down
43 changes: 24 additions & 19 deletions rhino-all/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,30 @@ publishing {
publications {
rhinoall(MavenPublication) {
from components.java
artifacts = [jar]
pom {
description = "Rhino JavaScript all-in-one JAR, not for use with modular Java projects"
url = "https://mozilla.github.io/rhino/"
licenses {
license {
name = "Mozilla Public License, Version 2.0"
url = "http://www.mozilla.org/MPL/2.0/index.txt"
}
}
scm {
connection = "scm:git:git@github.com:mozilla/rhino.git"
developerConnection = "scm:git:git@github.com:mozilla/rhino.git"
url = "git@github.com:mozilla/rhino.git"
}
organization {
name = "The Mozilla Foundation"
url = "http://www.mozilla.org"
}
artifacts = [jar, sourceJar, javadocJar]
pom.withXml {
def root = asNode()

root.appendNode('description', "Rhino JavaScript all-in-one JAR, not for use with modular Java projects")
root.appendNode("url", "https://mozilla.github.io/rhino/")

def p = root.appendNode("parent")
p.appendNode("groupId", "org.sonatype.oss")
p.appendNode("artifactId", "oss-parent")
p.appendNode("version", "7")

def l = root.appendNode("licenses").appendNode("license")
l.appendNode("name", "Mozilla Public License, Version 2.0")
l.appendNode("url", "http://www.mozilla.org/MPL/2.0/index.txt")

def scm = root.appendNode("scm")
scm.appendNode("connection", "scm:git:git@github.com:mozilla/rhino.git")
scm.appendNode("developerConnection", "scm:git:git@github.com:mozilla/rhino.git")
scm.appendNode("url", "git@github.com:mozilla/rhino.git")

def o = root.appendNode("organization")
o.appendNode("name", "The Mozilla Foundation")
o.appendNode("url", "http://www.mozilla.org")
}
}
}
Expand Down
41 changes: 23 additions & 18 deletions rhino-engine/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,29 @@ publishing {
rhinoengine(MavenPublication) {
from components.java
artifacts = [jar, sourceJar, javadocJar]
pom {
description = "Rhino ScriptEngine implementation"
url = "https://mozilla.github.io/rhino/"
licenses {
license {
name = "Mozilla Public License, Version 2.0"
url = "http://www.mozilla.org/MPL/2.0/index.txt"
}
}
scm {
connection = "scm:git:git@github.com:mozilla/rhino.git"
developerConnection = "scm:git:git@github.com:mozilla/rhino.git"
url = "git@github.com:mozilla/rhino.git"
}
organization {
name = "The Mozilla Foundation"
url = "http://www.mozilla.org"
}
pom.withXml {
def root = asNode()

root.appendNode('description', "Rhino ScriptEngine implementation")
root.appendNode("url", "https://mozilla.github.io/rhino/")

def p = root.appendNode("parent")
p.appendNode("groupId", "org.sonatype.oss")
p.appendNode("artifactId", "oss-parent")
p.appendNode("version", "7")

def l = root.appendNode("licenses").appendNode("license")
l.appendNode("name", "Mozilla Public License, Version 2.0")
l.appendNode("url", "http://www.mozilla.org/MPL/2.0/index.txt")

def scm = root.appendNode("scm")
scm.appendNode("connection", "scm:git:git@github.com:mozilla/rhino.git")
scm.appendNode("developerConnection", "scm:git:git@github.com:mozilla/rhino.git")
scm.appendNode("url", "git@github.com:mozilla/rhino.git")

def o = root.appendNode("organization")
o.appendNode("name", "The Mozilla Foundation")
o.appendNode("url", "http://www.mozilla.org")
}
}
}
Expand Down
41 changes: 23 additions & 18 deletions rhino-tools/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,29 @@ publishing {
rhinotools(MavenPublication) {
from components.java
artifacts = [jar, sourceJar, javadocJar]
pom {
description = "Rhino tools, including shell and debugger"
url = "https://mozilla.github.io/rhino/"
licenses {
license {
name = "Mozilla Public License, Version 2.0"
url = "http://www.mozilla.org/MPL/2.0/index.txt"
}
}
scm {
connection = "scm:git:git@github.com:mozilla/rhino.git"
developerConnection = "scm:git:git@github.com:mozilla/rhino.git"
url = "git@github.com:mozilla/rhino.git"
}
organization {
name = "The Mozilla Foundation"
url = "http://www.mozilla.org"
}
pom.withXml {
def root = asNode()

root.appendNode('description', "Rhino tools, including shell and debugger")
root.appendNode("url", "https://mozilla.github.io/rhino/")

def p = root.appendNode("parent")
p.appendNode("groupId", "org.sonatype.oss")
p.appendNode("artifactId", "oss-parent")
p.appendNode("version", "7")

def l = root.appendNode("licenses").appendNode("license")
l.appendNode("name", "Mozilla Public License, Version 2.0")
l.appendNode("url", "http://www.mozilla.org/MPL/2.0/index.txt")

def scm = root.appendNode("scm")
scm.appendNode("connection", "scm:git:git@github.com:mozilla/rhino.git")
scm.appendNode("developerConnection", "scm:git:git@github.com:mozilla/rhino.git")
scm.appendNode("url", "git@github.com:mozilla/rhino.git")

def o = root.appendNode("organization")
o.appendNode("name", "The Mozilla Foundation")
o.appendNode("url", "http://www.mozilla.org")
}
}
}
Expand Down
41 changes: 23 additions & 18 deletions rhino-xml/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,29 @@ publishing {
rhinoxml(MavenPublication) {
from components.java
artifacts = [jar, sourceJar, javadocJar]
pom {
description = "Rhino XML support"
url = "https://mozilla.github.io/rhino/"
licenses {
license {
name = "Mozilla Public License, Version 2.0"
url = "http://www.mozilla.org/MPL/2.0/index.txt"
}
}
scm {
connection = "scm:git:git@github.com:mozilla/rhino.git"
developerConnection = "scm:git:git@github.com:mozilla/rhino.git"
url = "git@github.com:mozilla/rhino.git"
}
organization {
name = "The Mozilla Foundation"
url = "http://www.mozilla.org"
}
pom.withXml {
def root = asNode()

root.appendNode('description', "Rhino XML support")
root.appendNode("url", "https://mozilla.github.io/rhino/")

def p = root.appendNode("parent")
p.appendNode("groupId", "org.sonatype.oss")
p.appendNode("artifactId", "oss-parent")
p.appendNode("version", "7")

def l = root.appendNode("licenses").appendNode("license")
l.appendNode("name", "Mozilla Public License, Version 2.0")
l.appendNode("url", "http://www.mozilla.org/MPL/2.0/index.txt")

def scm = root.appendNode("scm")
scm.appendNode("connection", "scm:git:git@github.com:mozilla/rhino.git")
scm.appendNode("developerConnection", "scm:git:git@github.com:mozilla/rhino.git")
scm.appendNode("url", "git@github.com:mozilla/rhino.git")

def o = root.appendNode("organization")
o.appendNode("name", "The Mozilla Foundation")
o.appendNode("url", "http://www.mozilla.org")
}
}
}
Expand Down
45 changes: 27 additions & 18 deletions rhino/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,33 @@ publishing {
rhino(MavenPublication) {
from components.java
artifacts = [jar, sourceJar, javadocJar]
pom {
description = "Rhino JavaScript runtime jar, excludes XML, tools ScriptEngine wrapper"
url = "https://mozilla.github.io/rhino/"
licenses {
license {
name = "Mozilla Public License, Version 2.0"
url = "http://www.mozilla.org/MPL/2.0/index.txt"
}
}
scm {
connection = "scm:git:git@github.com:mozilla/rhino.git"
developerConnection = "scm:git:git@github.com:mozilla/rhino.git"
url = "git@github.com:mozilla/rhino.git"
}
organization {
name = "The Mozilla Foundation"
url = "http://www.mozilla.org"
}
// We need to use the "withXml" method here, rather than the
// "pom" element in Gradle, because we can't add the "parent"
// attribute otherwise, and without it Maven Central verification
// will fail.
pom.withXml {
def root = asNode()

root.appendNode('description', "Rhino JavaScript runtime jar, excludes XML, tools, and ScriptEngine wrapper")
root.appendNode("url", "https://mozilla.github.io/rhino/")

def p = root.appendNode("parent")
p.appendNode("groupId", "org.sonatype.oss")
p.appendNode("artifactId", "oss-parent")
p.appendNode("version", "7")

def l = root.appendNode("licenses").appendNode("license")
l.appendNode("name", "Mozilla Public License, Version 2.0")
l.appendNode("url", "http://www.mozilla.org/MPL/2.0/index.txt")

def scm = root.appendNode("scm")
scm.appendNode("connection", "scm:git:git@github.com:mozilla/rhino.git")
scm.appendNode("developerConnection", "scm:git:git@github.com:mozilla/rhino.git")
scm.appendNode("url", "git@github.com:mozilla/rhino.git")

def o = root.appendNode("organization")
o.appendNode("name", "The Mozilla Foundation")
o.appendNode("url", "http://www.mozilla.org")
}
}
}
Expand Down

0 comments on commit 0dcc00f

Please sign in to comment.