Skip to content

Commit b9e9f65

Browse files
author
Sean Levin
committed
use new publishing plugin that is compatible with maven central
1 parent 8a9662a commit b9e9f65

File tree

1 file changed

+29
-52
lines changed

1 file changed

+29
-52
lines changed

behavior-graph/build.gradle

Lines changed: 29 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55

66
plugins {
77
id "org.jetbrains.kotlin.jvm"
8-
id "maven-publish"
98
id "java-library"
10-
id "signing"
119
id "org.jetbrains.dokka"
10+
id "com.vanniktech.maven.publish" version "0.29.0"
1211
}
1312

1413
java {
@@ -36,63 +35,41 @@ def dokkaJavadocJar = tasks.register("dokkaJavadocJar", org.gradle.jvm.tasks.Jar
3635

3736
}
3837

39-
publishing {
40-
repositories {
41-
maven {
42-
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
43-
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/"
44-
url = releasesRepoUrl //version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
45-
credentials {
46-
if (project.hasProperty("ossrhUsername")) {
47-
username = ossrhUsername
48-
password = ossrhPassword
49-
}
50-
}
51-
}
52-
}
53-
publications {
54-
release(MavenPublication) {
55-
from components.java
56-
groupId = 'com.yahoo.behaviorgraph'
57-
artifactId = 'bgjvm'
58-
version = '0.8.0'
59-
artifact dokkaJavadocJar
60-
repositories {
38+
import com.vanniktech.maven.publish.KotlinJvm
39+
import com.vanniktech.maven.publish.JavadocJar
40+
import com.vanniktech.maven.publish.SonatypeHost
6141

42+
mavenPublishing {
43+
configure(new KotlinJvm(new JavadocJar.Dokka("dokkaHtml"), true))
44+
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
45+
coordinates("com.yahoo.behaviorgraph", "bgjvm", "0.8.0")
46+
pom {
47+
name = 'Behavior Graph'
48+
description = 'Behavior Graph lets you build your programs out of small, easily understood pieces in a way that lets the computer do more of the work for you.'
49+
url = 'https://github.com/yahoo/bgkotlin'
50+
licenses {
51+
license {
52+
name = 'The Apache License, Version 2.0'
53+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
6254
}
63-
pom {
64-
name = 'Behavior Graph'
65-
description = 'Behavior Graph lets you build your programs out of small, easily understood pieces in a way that lets the computer do more of the work for you.'
66-
url = 'https://github.com/yahoo/bgkotlin'
67-
licenses {
68-
license {
69-
name = 'The Apache License, Version 2.0'
70-
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
71-
}
72-
}
73-
developers {
74-
developer {
75-
id = 'slevin'
76-
name = 'Sean Levin'
77-
78-
}
79-
}
80-
scm {
81-
connection = 'scm:git:git://github.com/yahoo/bgkotlin.git'
82-
developerConnection = 'scm:git:ssh://github.com:yahoo/bgkotlin.git'
83-
url = 'https://github.com/yahoo/bgkotlin'
84-
}
55+
}
56+
developers {
57+
developer {
58+
id = 'slevin'
59+
name = 'Sean Levin'
60+
8561
}
8662
}
63+
scm {
64+
connection = 'scm:git:git://github.com/yahoo/bgkotlin.git'
65+
developerConnection = 'scm:git:ssh://github.com:yahoo/bgkotlin.git'
66+
url = 'https://github.com/yahoo/bgkotlin'
67+
}
8768
}
88-
}
69+
70+
signAllPublications()
8971

9072

91-
signing {
92-
if (project.hasProperty("signing.keyId")) {
93-
sign configurations.archives
94-
sign publishing.publications.release
95-
}
9673
}
9774

9875
dependencies {

0 commit comments

Comments
 (0)