Skip to content

Commit c323aea

Browse files
migrate from jcenter to maven central
1 parent 1a29957 commit c323aea

File tree

1 file changed

+34
-37
lines changed

1 file changed

+34
-37
lines changed

build.gradle

Lines changed: 34 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,32 @@
22
buildscript {
33
ext {
44
kotlinVersion = "1.4.32"
5-
detektVersion = "1.15.0"
5+
detektVersion = "1.17.0-RC2"
66
}
77
repositories {
8-
maven {
9-
url 'https://maven.aliyun.com/repository/public/'
10-
}
8+
mavenCentral()
119
gradlePluginPortal()
1210
}
1311
dependencies {
1412
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
15-
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4"
1613
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:${detektVersion}"
1714
}
1815
}
1916

2017
allprojects {
2118
group = "org.ktorm"
22-
version = "3.3.0"
19+
version = "3.4.0-SNAPSHOT"
2320
}
2421

2522
subprojects { project ->
2623
apply plugin: "kotlin"
24+
apply plugin: "signing"
2725
apply plugin: "maven-publish"
28-
apply plugin: "com.jfrog.bintray"
2926
apply plugin: "io.gitlab.arturbosch.detekt"
3027
apply from: "${project.rootDir}/check-source-header.gradle"
3128

3229
repositories {
33-
maven {
34-
url 'https://maven.aliyun.com/repository/public/'
35-
}
30+
mavenCentral()
3631
}
3732

3833
dependencies {
@@ -62,16 +57,13 @@ subprojects { project ->
6257

6358
detekt {
6459
toolVersion = detektVersion
60+
input = files("src/main/kotlin")
6561
config = files("${project.rootDir}/detekt.yml")
66-
reports {
67-
xml.enabled = false
68-
html.enabled = false
69-
}
7062
}
7163

7264
publishing {
7365
publications {
74-
bintray(MavenPublication) {
66+
dist(MavenPublication) {
7567
from components.java
7668
artifact generateSources
7769
artifact generateJavadoc
@@ -180,34 +172,39 @@ subprojects { project ->
180172
}
181173
}
182174
}
183-
}
184175

185-
bintray {
186-
user = System.getenv("BINTRAY_USER")
187-
key = System.getenv("BINTRAY_KEY")
188-
publications = ["bintray"]
189-
publish = true
190-
191-
pkg {
192-
repo = "ktorm"
193-
name = project.name
194-
licenses = ["Apache-2.0"]
195-
vcsUrl = "https://github.com/kotlin-orm/ktorm.git"
196-
labels = ["Kotlin", "ORM", "SQL"]
197-
198-
version {
199-
name = project.version
200-
released = new Date()
201-
vcsTag = project.version
202-
203-
mavenCentralSync {
204-
sync = false
205-
user = System.getenv("OSSRH_USER")
176+
repositories {
177+
maven {
178+
name = "central"
179+
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
180+
credentials {
181+
username = System.getenv("OSSRH_USER")
182+
password = System.getenv("OSSRH_PASSWORD")
183+
}
184+
}
185+
maven {
186+
name = "snapshot"
187+
url = "https://oss.sonatype.org/content/repositories/snapshots"
188+
credentials {
189+
username = System.getenv("OSSRH_USER")
206190
password = System.getenv("OSSRH_PASSWORD")
207191
}
208192
}
209193
}
210194
}
195+
196+
signing {
197+
def keyId = System.getenv("GPG_KEY_ID")
198+
def secretKey = System.getenv("GPG_SECRET_KEY")
199+
def password = System.getenv("GPG_PASSWORD")
200+
201+
required {
202+
!project.version.endsWith("SNAPSHOT") && gradle.taskGraph.hasTask("publishDistPublicationToCentralRepository")
203+
}
204+
205+
useInMemoryPgpKeys(keyId, secretKey, password)
206+
sign publishing.publications.dist
207+
}
211208
}
212209

213210
task printClasspath() {

0 commit comments

Comments
 (0)