Skip to content

Commit f6d52bd

Browse files
committed
Upload to Maven Central instead of Bintray
1 parent 45399c3 commit f6d52bd

File tree

1 file changed

+49
-36
lines changed

1 file changed

+49
-36
lines changed

Diff for: build.gradle

+49-36
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
22
import org.gradle.api.tasks.testing.logging.TestLogEvent
33

44
plugins {
5-
id 'com.jfrog.bintray' version '1.8.4' apply false
65
id 'java'
76
id "maven-publish"
7+
id "signing"
88
id 'checkstyle'
99
id "org.embulk.embulk-plugins" version "0.4.2" apply false
1010
}
@@ -18,7 +18,7 @@ allprojects {
1818
subprojects {
1919
apply plugin: 'java'
2020
apply plugin: "maven-publish"
21-
apply plugin: "com.jfrog.bintray"
21+
apply plugin: "signing"
2222
apply plugin: "org.embulk.embulk-plugins"
2323
//apply plugin: 'jacoco'
2424

@@ -144,45 +144,58 @@ subprojects {
144144

145145
publishing {
146146
publications {
147-
embulkPluginMaven(MavenPublication) { // Publish it with "publishEmbulkPluginMavenPublicationTo???Repository".
148-
from components.java // Must be "components.java". The dependency modification works only for it.
149-
artifact testsJar
150-
artifact sourcesJar
151-
artifact javadocJar
147+
maven(MavenPublication) {
148+
afterEvaluate { project ->
149+
groupId = "${project.group}"
150+
artifactId = "${project.name}"
151+
}
152+
153+
from components.java
154+
155+
pom { // https://central.sonatype.org/pages/requirements.html
156+
packaging "jar"
157+
158+
afterEvaluate { project ->
159+
name = "${project.name}"
160+
description = "${project.description}"
161+
}
162+
url = "https://www.embulk.org/"
163+
164+
licenses {
165+
license {
166+
// http://central.sonatype.org/pages/requirements.html#license-information
167+
name = "The Apache License, Version 2.0"
168+
url = "https://www.apache.org/licenses/LICENSE-2.0.txt"
169+
}
170+
}
171+
172+
scm {
173+
connection = "scm:git:git://github.com/embulk/embulk-input-jdbc.git"
174+
developerConnection = "scm:git:[email protected]:embulk/embulk-input-jdbc.git"
175+
url = "https://github.com/embulk/embulk-input-jdbc"
176+
}
177+
}
152178
}
153179
}
180+
154181
repositories {
155-
// TODO: Configure some public Maven repo(s).
156-
}
157-
}
182+
maven { // publishMavenPublicationToMavenCentralRepository
183+
name = "mavenCentral"
184+
if (project.version.endsWith("-SNAPSHOT")) {
185+
url "https://oss.sonatype.org/content/repositories/snapshots"
186+
} else {
187+
url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
188+
}
158189

159-
bintray {
160-
// write at your bintray user name and api key to ~/.gradle/gradle.properties file:
161-
// bintray_user=frsyuki
162-
// bintray_api_key=xxxxxxxxxxx
163-
user = project.hasProperty('bintray_user') ? bintray_user : ''
164-
key = project.hasProperty('bintray_api_key') ? bintray_api_key : ''
165-
166-
publications = [ "embulkPluginMaven" ]
167-
168-
dryRun = false
169-
publish = true
170-
171-
pkg {
172-
userOrg = 'embulk-input-jdbc'
173-
repo = 'maven'
174-
name = project.name
175-
desc = 'MySQL, PostgreSQL, Redshift and generic JDBC input plugins for Embulk'
176-
websiteUrl = 'https://github.com/embulk/embulk-input-jdbc'
177-
issueTrackerUrl = 'https://github.com/embulk/embulk-input-jdbc/issues'
178-
vcsUrl = 'https://github.com/embulk/embulk-input-jdbc.git'
179-
licenses = ['Apache-2.0']
180-
labels = ['embulk', 'java']
181-
publicDownloadNumbers = true
182-
183-
version {
184-
name = project.version
190+
credentials {
191+
username = project.hasProperty("ossrhUsername") ? ossrhUsername : ""
192+
password = project.hasProperty("ossrhPassword") ? ossrhPassword : ""
193+
}
185194
}
186195
}
187196
}
197+
198+
signing {
199+
sign publishing.publications.maven
200+
}
188201
}

0 commit comments

Comments
 (0)