Skip to content

Commit

Permalink
Enabled Maven central publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
jiakuan committed Dec 5, 2024
1 parent f18604b commit 9abb20d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,16 @@ publish-local: build
rm -rf $$HOME/.m2/repository/org/docstr/gwt
${PROJECT_DIR}/gradlew publishToMavenLocal --warning-mode all

publish-maven: build
rm -rf $$HOME/.m2/repository/org/docstr/gwt
git checkout tags/${LATEST_TAG}
${PROJECT_DIR}/gradlew publishMavenJavaPublicationToMavenLocal publishMavenJavaPublicationToMavenRepository
git checkout main

publish: build
rm -rf $$HOME/.m2/repository/org/docstr/gwt
${PROJECT_DIR}/gradlew publishPlugins --warning-mode all
git checkout main

site:
cd ${PROJECT_DIR}/doc && docstr site build && cd ${PROJECT_DIR}/../dn-hosting-sites && make deploy-gwtgradle
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,5 @@ gradlew.bat clean build

- Build and test the plugin locally
- Commit all changes to the `main` branch
- Publish the plugin to the Gradle Plugin Portal with `make publish`
- Create a new release on GitHub with `make release`
- Publish the plugin to the Gradle Plugin Portal with `make publish`
26 changes: 17 additions & 9 deletions plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ plugins {
// developing Gradle plugins
id 'java-gradle-plugin'

id 'signing'
id 'maven-publish'

alias(libs.plugins.plugin.publish)
Expand Down Expand Up @@ -52,6 +53,13 @@ gradlePlugin {
}
}

signing {
sign publishing.publications
}

def ossrU = project.hasProperty("ossrhToken") ? ossrhToken : ""
def ossrP = project.hasProperty("ossrhTokenPassword") ? ossrhTokenPassword : ""

publishing {
publications {
mavenJava(MavenPublication) {
Expand Down Expand Up @@ -90,15 +98,15 @@ publishing {
}
repositories {
mavenLocal()
//maven {
// def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
// def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
// url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
// credentials {
// username = ossrU
// password = ossrP
// }
//}
maven {
def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = ossrU
password = ossrP
}
}
}
}

Expand Down

0 comments on commit 9abb20d

Please sign in to comment.