Migrate JavaEE artifacts to Maven Central
buildscript {
repositories {
- jcenter()
+ mavenCentral()
}
dependencies {
- classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.5'
+ classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.22.0"
}
}
subprojects {
repositories {
- jcenter()
+ mavenCentral()
}
apply plugin: 'java'
@@ -31,7 +31,7 @@ subprojects {
configure([project(':api'), project(':rt'), project(':tooling')]) {
apply plugin: 'maven-publish'
- apply plugin: 'com.jfrog.bintray'
+ apply plugin: 'signing'
task sourcesJar(type: Jar, dependsOn: classes) {
classifier 'sources'
@@ -68,12 +68,13 @@ configure([project(':api'), project(':rt'), project(':tooling')]) {
publishing {
repositories {
maven {
- def releasesUrl = "http://ci.arch.iconloop.com/nexus/repository/maven-releases"
- def snapshotsUrl = "http://ci.arch.iconloop.com/nexus/repository/maven-snapshots"
+ name = 'mavenCentral'
+ def releasesUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
+ def snapshotsUrl = "https://oss.sonatype.org/content/repositories/snapshots"
url = version.endsWith('SNAPSHOT') ? snapshotsUrl : releasesUrl
credentials {
- username = rootProject.hasProperty('nexusUsername') ? "$nexusUsername" : ''
- password = rootProject.hasProperty('nexusPassword') ? "$nexusPassword" : ''
+ username = rootProject.hasProperty('mavenCentralUsername') ? "$mavenCentralUsername" : ''
+ password = rootProject.hasProperty('mavenCentralPassword') ? "$mavenCentralPassword" : ''
}
}
}
@@ -94,31 +95,16 @@ configure([project(':api'), project(':rt'), project(':tooling')]) {
}
}
- bintray {
- user = rootProject.hasProperty('bintrayUser') ? "$bintrayUser" : ''
- key = rootProject.hasProperty('bintrayKey') ? "$bintrayKey" : ''
- publications = ['mavenJava']
- publish = true
- pkg {
- userOrg = 'icon'
- repo = 'javaee'
- name = projectName
- licenses = ['Apache-2.0']
- vcsUrl = 'https://github.com/icon-project/goloop.git'
- version {
- name = project.version
- gpg {
- sign = true
- }
- }
+ signing {
+ sign publishing.publications.mavenJava
}
}
- bintrayUpload { task ->
- doFirst {
- if (version.endsWith('SNAPSHOT')) {
- throw new GradleException('Cannot publish SNAPSHOT versions to Bintray!')
- }
- }
- }
+apply plugin: 'io.codearte.nexus-staging'
+
+nexusStaging {
+ packageGroup = GROUP
+ stagingProfileId = project.hasProperty('mavenProfileId') ? "$mavenProfileId" : ''
+ username = project.hasProperty('mavenCentralUsername') ? "$mavenCentralUsername" : ''
+ password = project.hasProperty('mavenCentralPassword') ? "$mavenCentralPassword" : ''
}
