Skip to content

Commit

Permalink
Switch to Nexus publish plugin (#755)
Browse files Browse the repository at this point in the history
* Switch to Nexus publish plugin

* Change close task in RELEASE.md
  • Loading branch information
VDovidaytis-HORIS committed Apr 7, 2023
1 parent ec22cc0 commit 9ccc4c6
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 66 deletions.
21 changes: 9 additions & 12 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,23 +124,20 @@ Fill `pypi` and `sonatype` sections with credentials.

Publish JVM artifacts from one of build machines:

- `./gradlew publishLetsPlotJvmCommonPublicationToMavenRepository`

- `./gradlew publishLetsPlotJvmJfxPublicationToMavenRepository`

- `./gradlew publishLetsPlotJvmBatikPublicationToMavenRepository`

- `./gradlew publishLetsPlotImageExportPublicationToMavenRepository`

- `./gradlew publishLetsPlotGISPublicationToMavenRepository`

- `./gradlew publishKotlinApiDependenciesToMavenRepository`
```shell
./gradlew publishLetsPlotJvmCommonPublicationToMavenRepository \
publishLetsPlotJvmJfxPublicationToMavenRepository \
publishLetsPlotJvmBatikPublicationToMavenRepository \
publishLetsPlotImageExportPublicationToMavenRepository \
publishLetsPlotGISPublicationToMavenRepository \
publishKotlinApiDependenciesToMavenRepository
```

Check all artifacts were uploaded: https://oss.sonatype.org/#stagingRepositories

Close and release repository to the Maven Central:

`./gradlew closeAndReleaseRepository`
`./gradlew findMavenStagingRepository closeAndReleaseMavenStagingRepository`

This operation can take up to 5 minutes.

Expand Down
30 changes: 11 additions & 19 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
buildscript {
dependencies {
classpath "org.yaml:snakeyaml:1.25"
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.30.0"
}
}

Expand All @@ -10,7 +9,7 @@ plugins {
id "org.jetbrains.kotlin.js" apply false
id "org.jetbrains.gradle.plugin.idea-ext" apply false
id "com.github.johnrengelman.shadow" apply false
id "io.codearte.nexus-staging"
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
}

import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
Expand Down Expand Up @@ -208,15 +207,16 @@ if (project.hasProperty("build_arch")) {
project.ext.localMavenRepository = "$rootDir/.maven-publish-dev-repo"

// define Sonatype nexus repository manager settings:
def sonatypeSnapshotUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
def sonatypeReleaseUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
project.ext.sonatypeUrl = version.contains('SNAPSHOT') ? sonatypeSnapshotUrl : sonatypeReleaseUrl

// nexus-staging plugin settings:
nexusStaging {
packageGroup = 'org.jetbrains'
username = project.buildSettings?.sonatype?.username
password = project.buildSettings?.sonatype?.password
nexusPublishing {
repositories {
maven{
username = project.buildSettings?.sonatype?.username
password = project.buildSettings?.sonatype?.password
stagingProfileId = "11c25ff9a87b89"
nexusUrl.set(uri("https://oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://oss.sonatype.org/content/repositories/snapshots/"))
}
}
}


Expand All @@ -235,7 +235,6 @@ task publishKotlinApiDependenciesToMavenRepository {
group project.letsPlotTaskGroup
}


subprojects {
// Configure Kotlin targets.
if (name in [
Expand Down Expand Up @@ -326,13 +325,6 @@ subprojects {
}
}
repositories {
maven {
url = project.sonatypeUrl
credentials {
username = project.buildSettings?.sonatype?.username
password = project.buildSettings?.sonatype?.password
}
}
mavenLocal {
url = uri(project.localMavenRepository)
}
Expand Down
7 changes: 0 additions & 7 deletions jvm-package/jvm-publish-batik/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,6 @@ publishing {
}
}
repositories {
maven {
url = project.sonatypeUrl
credentials {
username = project.buildSettings?.sonatype?.username
password = project.buildSettings?.sonatype?.password
}
}
mavenLocal {
url = uri(project.localMavenRepository)
}
Expand Down
7 changes: 0 additions & 7 deletions jvm-package/jvm-publish-common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,6 @@ publishing {
}
}
repositories {
maven {
url = project.sonatypeUrl
credentials {
username = project.buildSettings?.sonatype?.username
password = project.buildSettings?.sonatype?.password
}
}
mavenLocal {
url = uri(project.localMavenRepository)
}
Expand Down
7 changes: 0 additions & 7 deletions jvm-package/jvm-publish-gis/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,6 @@ publishing {
}
}
repositories {
maven {
url = project.sonatypeUrl
credentials {
username = project.buildSettings?.sonatype?.username
password = project.buildSettings?.sonatype?.password
}
}
mavenLocal {
url = uri(project.localMavenRepository)
}
Expand Down
7 changes: 0 additions & 7 deletions jvm-package/jvm-publish-jfx/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,6 @@ publishing {
}
}
repositories {
maven {
url = project.sonatypeUrl
credentials {
username = project.buildSettings?.sonatype?.username
password = project.buildSettings?.sonatype?.password
}
}
mavenLocal {
url = uri(project.localMavenRepository)
}
Expand Down
7 changes: 0 additions & 7 deletions plot-image-export/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,6 @@ publishing {
}
}
repositories {
maven {
url = project.sonatypeUrl
credentials {
username = project.buildSettings?.sonatype?.username
password = project.buildSettings?.sonatype?.password
}
}
mavenLocal {
url = uri(project.localMavenRepository)
}
Expand Down

0 comments on commit 9ccc4c6

Please sign in to comment.