Skip to content

Commit 8899998

Browse files
committed
use maven publish gradle plugin
1 parent e4d788b commit 8899998

File tree

3 files changed

+32
-8
lines changed

3 files changed

+32
-8
lines changed

build.gradle.kts

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
import com.vanniktech.maven.publish.SonatypeHost
2+
13
group = "com.trendyol"
24

35
plugins {
46
kotlin("jvm") version libs.versions.kotlin.get()
57
java
6-
id("kediatr-publishing") apply false
78
alias(libs.plugins.spotless)
9+
alias(libs.plugins.maven.publish)
810
}
911

1012
version = properties["version"]!!
@@ -15,6 +17,7 @@ subprojectsOf("projects") {
1517
plugin("kediatr-publishing")
1618
plugin("java")
1719
plugin(rootProject.libs.plugins.spotless.pluginId)
20+
plugin(rootProject.libs.plugins.maven.publish.pluginId)
1821
}
1922

2023
spotless {
@@ -24,8 +27,32 @@ subprojectsOf("projects") {
2427
}
2528
}
2629

27-
java {
28-
withSourcesJar()
29-
withJavadocJar()
30+
mavenPublishing {
31+
coordinates(groupId = rootProject.group.toString(), artifactId = project.name, version = rootProject.version.toString())
32+
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
33+
pom {
34+
name.set(project.name)
35+
description.set(project.properties["projectDescription"].toString())
36+
url.set(project.properties["projectUrl"].toString())
37+
licenses {
38+
license {
39+
name.set(project.properties["licence"].toString())
40+
url.set(project.properties["licenceUrl"].toString())
41+
}
42+
}
43+
developers {
44+
developer {
45+
id.set("osoykan")
46+
name.set("Oguzhan Soykan")
47+
email.set("[email protected]")
48+
}
49+
}
50+
scm {
51+
connection.set("scm:[email protected]:Trendyol/kediatR.git")
52+
developerConnection.set("scm:git:ssh://github.com:Trendyol/kediatR.git")
53+
url.set(project.properties["projectUrl"].toString())
54+
}
55+
}
56+
signAllPublications()
3057
}
3158
}

gradle/libs.versions.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,4 @@ testLogger = { id = "com.adarshr.test-logger", version = "4.0.0" }
4343
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
4444
spotless = { id = "com.diffplug.spotless", version = "7.0.4" }
4545
quarkus = { id = "io.quarkus", version.ref = "quarkus" }
46+
maven-publish = { id = "com.vanniktech.maven.publish", version = "0.31.0" }

projects/kediatr-quarkus-starter/build.gradle.kts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,3 @@ dependencies {
1717
tasks.compileKotlin {
1818
mustRunAfter(tasks.compileQuarkusGeneratedSourcesJava, tasks.compileQuarkusTestGeneratedSourcesJava)
1919
}
20-
21-
tasks.sourcesJar {
22-
mustRunAfter(tasks.compileQuarkusGeneratedSourcesJava)
23-
}

0 commit comments

Comments
 (0)