Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/actions/maven-publish/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ runs:
env:
JAVA_HOME: ${{ env.JAVA_HOME }}

- name: Publish Android/Java Packages to Maven
- name: Publish Java Packages to Maven
shell: bash
run: ./gradlew publish -PisSnapshot=false --stacktrace
run: ./gradlew publishToSonatype closeSonatypeStagingRepository -PisSnapshot=false --stacktrace
env:
JAVA_HOME: ${{ env.JAVA_HOME }}
MAVEN_USERNAME: ${{ inputs.ossr-username }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: gradle/wrapper-validation-action@8d49e559aae34d3e0eb16cde532684bc9702762b # pin@v1.0.6
- uses: gradle/actions/wrapper-validation@v5

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pin to a particular hash. Else this will be flagged by security team

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, the has

15 changes: 14 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
}

allprojects {
group = 'com.auth0'
Expand All @@ -7,3 +9,14 @@ allprojects {
mavenCentral()
}
}

nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri('https://ossrh-staging-api.central.sonatype.com/service/local/'))
snapshotRepositoryUrl.set(uri('https://central.sonatype.com/repository/maven-snapshots/'))
username.set(System.getenv("MAVEN_USERNAME"))
password.set(System.getenv("MAVEN_PASSWORD"))
}
}
}
35 changes: 5 additions & 30 deletions gradle/maven-publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,18 @@ artifacts {
archives sourcesJar, javadocJar
}


final releaseRepositoryUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
final snapshotRepositoryUrl = "https://oss.sonatype.org/content/repositories/snapshots/"

publishing {
publications {
mavenJava(MavenPublication) {
from components.java

groupId = GROUP
artifactId = POM_ARTIFACT_ID
version = getVersionName()

artifact("$buildDir/libs/${project.name}-${version}.jar")
artifact sourcesJar
artifact javadocJar

groupId = GROUP
artifactId = POM_ARTIFACT_ID
version = project.version

pom {
name = POM_NAME
packaging = POM_PACKAGING
Expand Down Expand Up @@ -68,27 +64,6 @@ publishing {
connection = POM_SCM_CONNECTION
developerConnection = POM_SCM_DEV_CONNECTION
}

pom.withXml {
def dependenciesNode = asNode().appendNode('dependencies')

project.configurations.implementation.allDependencies.each {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
}
}
repositories {
maven {
name = "sonatype"
url = version.endsWith('SNAPSHOT') ? snapshotRepositoryUrl : releaseRepositoryUrl
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
1 change: 1 addition & 0 deletions lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ plugins {
id 'jacoco'
id 'checkstyle'
id 'me.champeau.gradle.japicmp' version '0.4.1'
id 'maven-publish'
}

sourceSets {
Expand Down
Loading