Skip to content

Commit

Permalink
Maven publication switched to Maven Central. (#351)
Browse files Browse the repository at this point in the history
* Maven publication switched to the Nexus Repository.

* Added nexus-staging plugin for Maven Central publication.

* Edited RELEASE.md: changed JVM publication process.

* Updated nexus-staging settings.

* Added javadoc artifact for publication.

* Changed nexus-staging plugin declaration.
  • Loading branch information
VDovidaytis-HORIS committed Mar 26, 2021
1 parent d81e6af commit 87ea13d
Show file tree
Hide file tree
Showing 8 changed files with 114 additions and 128 deletions.
19 changes: 11 additions & 8 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,21 @@ run `./gradlew python-package-build:buildManylinuxWheels`

`./gradlew python-package-build:publishProdPythonPackage`

##### 3. JVM artifacts (Bintray/JCenter):
##### 3. JVM artifacts (Sonatype Nexus Repository):

- `./gradlew :jvm-package:jvm-publish-common:bintrayUpload`
- `./gradlew publishLetsPlotJvmCommonPublicationToMavenRepository`

- `./gradlew :jvm-package:jvm-publish-jfx:bintrayUpload`
- `./gradlew publishLetsPlotJvmJfxPublicationToMavenRepository`

- `./gradlew :jvm-package:jvm-publish-batik:bintrayUpload`
- `./gradlew publishLetsPlotJvmBatikPublicationToMavenRepository`

- `./gradlew :plot-image-export:bintrayUpload`

Note that release versions will be uploaded to the `lets-plot-jars` package.
'alpha' and 'RC' versions will be uploaded to the `lets-plot-jars-dev` package.
- `./gradlew publishLetsPlotImageExportPublicationToMavenRepository`

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

Close and release repository to the Maven Central:

`./gradlew closeAndReleaseRepository`

### Add the GitHub release:

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

Expand All @@ -10,6 +11,7 @@ plugins {
id "org.jetbrains.gradle.plugin.idea-ext" apply false
id "com.jfrog.bintray" apply false
id "com.github.johnrengelman.shadow" apply false
id "io.codearte.nexus-staging"
}

def include_sources_letsPlotJvmCommon = [
Expand Down Expand Up @@ -111,12 +113,6 @@ project.ext.buildSettings = settings

// Bintray settings

// define the package name in the Bintray Maven repository depending on the version name
def bintray_mvn_pkg_name = 'lets-plot-jars'
if (version.contains('alpha') || version.contains('rc')) {
bintray_mvn_pkg_name = 'lets-plot-jars-dev'
}

project.ext["bintraySettings"] = [
userOrg : 'jetbrains',
licenses : ['MIT'],
Expand All @@ -126,8 +122,20 @@ project.ext["bintraySettings"] = [
js_repo : "lets-plot",
js_pkg_name : 'lets-plot-js',
js_artifact_version: js_artifact_version,

mvn_repo : 'lets-plot-maven',
mvn_pkg_name : bintray_mvn_pkg_name,
]

// Maven publication settings
// define local Maven Repository path:
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
}
10 changes: 9 additions & 1 deletion build_settings.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,12 @@ pypi:
# -------------------------------------------------------------------
bintray:
user:
key:
key:


# -------------------------------------------------------------------
# Sonatype settings
# -------------------------------------------------------------------
sonatype:
username:
password:
46 changes: 19 additions & 27 deletions jvm-package/jvm-publish-batik/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id "org.jetbrains.kotlin.multiplatform"
id "maven-publish"
id "com.github.johnrengelman.shadow"
id "com.jfrog.bintray"
id "signing"
}

kotlin {
Expand Down Expand Up @@ -88,6 +88,13 @@ task jarLetsPlotJvmBatikSources(type: ShadowJar) {
configurations = [rootProject.configurations.letsPlotJvmBatikSources]
}

task jarLetsPlotJvmJavaDoc(type: Jar) {
group task_group
archiveBaseName = artifactBaseName
archiveVersion = artifactVersion
classifier 'javadoc'
from("$rootDir/README.md")
}

publishing {
publications {
Expand All @@ -98,6 +105,7 @@ publishing {

artifact jarLetsPlotJvmBatikClasses
artifact jarLetsPlotJvmBatikSources
artifact jarLetsPlotJvmJavaDoc

pom {
name = "Lets-Plot for Swing/Batik"
Expand Down Expand Up @@ -151,34 +159,18 @@ publishing {
}
repositories {
maven {
// url = uri("$rootDir/.maven-publish-dev-repo")
url = uri("https://jetbrains.bintray.com/lets-plot-maven")
url = project.sonatypeUrl
credentials {
username = project.buildSettings.sonatype.username
password = project.buildSettings.sonatype.password
}
}
mavenLocal {
url = uri(project.localMavenRepository)
}
}
}

// Provide Bintray-specific Information
def bintray_user = project.buildSettings?.bintray?.user
def bintray_key = project.buildSettings?.bintray?.key

if (bintray_user != null && bintray_key != null) {
bintray {
publications = ['letsPlotJvmBatik']
override = true

user = bintray_user
key = bintray_key
publish = project.bintraySettings.publish

pkg {
repo = project.bintraySettings.mvn_repo
name = project.bintraySettings.mvn_pkg_name
userOrg = project.bintraySettings.userOrg
licenses = project.bintraySettings.licenses
vcsUrl = project.bintraySettings.vcsUrl
version {
name = artifactVersion
}
}
}
signing {
sign publishing.publications.letsPlotJvmBatik
}
46 changes: 19 additions & 27 deletions jvm-package/jvm-publish-common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id "org.jetbrains.kotlin.multiplatform"
id "maven-publish"
id "com.github.johnrengelman.shadow"
id "com.jfrog.bintray"
id "signing"
}

kotlin {
Expand Down Expand Up @@ -84,6 +84,13 @@ task jarLetsPlotJvmCommonSources(type: ShadowJar) {
configurations = [rootProject.configurations.letsPlotJvmCommonSources]
}

task jarLetsPlotJvmJavaDoc(type: Jar) {
group task_group
archiveBaseName = artifactBaseName
archiveVersion = artifactVersion
classifier 'javadoc'
from("$rootDir/README.md")
}

publishing {
publications {
Expand All @@ -94,6 +101,7 @@ publishing {

artifact jarLetsPlotJvmCommonClasses
artifact jarLetsPlotJvmCommonSources
artifact jarLetsPlotJvmJavaDoc

pom {
name = "Lets-Plot common classes"
Expand Down Expand Up @@ -153,34 +161,18 @@ publishing {
}
repositories {
maven {
// url = uri("$rootDir/.maven-publish-dev-repo")
url = uri("https://jetbrains.bintray.com/lets-plot-maven")
url = project.sonatypeUrl
credentials {
username = project.buildSettings.sonatype.username
password = project.buildSettings.sonatype.password
}
}
mavenLocal {
url = uri(project.localMavenRepository)
}
}
}

// Provide Bintray-specific Information
def bintray_user = project.buildSettings?.bintray?.user
def bintray_key = project.buildSettings?.bintray?.key

if (bintray_user != null && bintray_key != null) {
bintray {
publications = ['letsPlotJvmCommon']
override = true

user = bintray_user
key = bintray_key
publish = project.bintraySettings.publish

pkg {
repo = project.bintraySettings.mvn_repo
name = project.bintraySettings.mvn_pkg_name
userOrg = project.bintraySettings.userOrg
licenses = project.bintraySettings.licenses
vcsUrl = project.bintraySettings.vcsUrl
version {
name = artifactVersion
}
}
signing {
sign publishing.publications.letsPlotJvmCommon
}
}
47 changes: 20 additions & 27 deletions jvm-package/jvm-publish-jfx/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id "org.jetbrains.kotlin.multiplatform"
id "maven-publish"
id "com.github.johnrengelman.shadow"
id "com.jfrog.bintray"
id "signing"
}

kotlin {
Expand Down Expand Up @@ -79,6 +79,13 @@ task jarLetsPlotJvmJfxSources(type: ShadowJar) {
configurations = [rootProject.configurations.letsPlotJvmJfxSources]
}

task jarLetsPlotJvmJavaDoc(type: Jar) {
group task_group
archiveBaseName = artifactBaseName
archiveVersion = artifactVersion
classifier 'javadoc'
from("$rootDir/README.md")
}

publishing {
publications {
Expand All @@ -89,6 +96,7 @@ publishing {

artifact jarLetsPlotJvmJfxClasses
artifact jarLetsPlotJvmJfxSources
artifact jarLetsPlotJvmJavaDoc

pom {
name = "Lets-Plot for JavaFX"
Expand Down Expand Up @@ -134,34 +142,19 @@ publishing {
}
repositories {
maven {
// url = uri("$rootDir/.maven-publish-dev-repo")
url = uri("https://jetbrains.bintray.com/lets-plot-maven")
url = project.sonatypeUrl
credentials {
username = project.buildSettings.sonatype.username
password = project.buildSettings.sonatype.password
}
}
mavenLocal {
url = uri(project.localMavenRepository)
}
}
}

// Provide Bintray-specific Information
def bintray_user = project.buildSettings?.bintray?.user
def bintray_key = project.buildSettings?.bintray?.key

if (bintray_user != null && bintray_key != null) {
bintray {
publications = ['letsPlotJvmJfx']
override = true

user = bintray_user
key = bintray_key
publish = project.bintraySettings.publish

pkg {
repo = project.bintraySettings.mvn_repo
name = project.bintraySettings.mvn_pkg_name
userOrg = project.bintraySettings.userOrg
licenses = project.bintraySettings.licenses
vcsUrl = project.bintraySettings.vcsUrl
version {
name = artifactVersion
}
}
}
signing {
sign publishing.publications.letsPlotJvmJfx
}

Loading

0 comments on commit 87ea13d

Please sign in to comment.