11import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
22
33plugins {
4- id(" org.springframework.boot" ) version " 3.2.0"
54 id(" io.spring.dependency-management" ) version " 1.1.4"
65 id(" org.jmailen.kotlinter" ) version " 4.1.0"
76 id(" maven-publish" )
87 id(" java-library" )
98 kotlin(" jvm" ) version " 1.9.21"
109 kotlin(" plugin.spring" ) version " 1.9.21"
10+ id(" net.thebugmc.gradle.sonatype-central-portal-publisher" ) version " 1.2.4"
1111}
1212
1313group = " com.valensas"
14- version = " 3.2.0"
1514java.sourceCompatibility = JavaVersion .VERSION_17
1615
1716repositories {
1817 mavenCentral()
19- if (project.hasProperty(" GITLAB_REPO_URL" )) {
20- maven {
21- name = " Gitlab"
22- url = uri(project.property(" GITLAB_REPO_URL" ).toString())
23- credentials(HttpHeaderCredentials ::class .java) {
24- name = project.findProperty(" GITLAB_TOKEN_NAME" )?.toString()
25- value = project.findProperty(" GITLAB_TOKEN" )?.toString()
26- }
27- authentication {
28- create(" header" , HttpHeaderAuthentication ::class )
29- }
30- }
31- }
3218}
3319
3420
@@ -37,7 +23,7 @@ dependencies {
3723 compileOnly(" org.springframework.boot:spring-boot-starter-webflux" )
3824 implementation(" org.springframework.data:spring-data-commons" )
3925 implementation(" org.jetbrains.kotlin:kotlin-reflect" )
40- implementation(" com.valensas:exception:2.1.0 " )
26+ implementation(" com.valensas:exception:2.4.2 " )
4127 compileOnly(" io.micrometer:micrometer-core" )
4228 api(" org.jetbrains.kotlinx:kotlinx-coroutines-reactor:1.7.3" )
4329 testImplementation(" org.springframework.boot:spring-boot-starter-webflux" )
@@ -51,30 +37,61 @@ tasks.withType<KotlinCompile> {
5137 }
5238}
5339
40+ dependencyManagement {
41+ imports {
42+ mavenBom(" org.springframework.boot:spring-boot-dependencies:3.2.0" )
43+ }
44+ }
45+
5446tasks.withType<Test > {
5547 useJUnitPlatform()
5648}
5749
5850publishing {
51+ publications {
52+ create(" library" , MavenPublication ::class .java) {
53+ artifactId = " util"
54+ from(components[" java" ])
55+ }
56+ }
5957 repositories {
60- if (System .getenv(" CI_API_V4_URL" ) != null ) {
61- maven {
62- name = " Gitlab"
63- url = uri(" ${System .getenv(" CI_API_V4_URL" )} /projects/${System .getenv(" CI_PROJECT_ID" )} /packages/maven" )
64- credentials(HttpHeaderCredentials ::class .java) {
65- name = " Job-Token"
66- value = System .getenv(" CI_JOB_TOKEN" )
67- }
68- authentication {
69- create(" header" , HttpHeaderAuthentication ::class )
70- }
58+ mavenLocal()
59+ }
60+ }
61+
62+ signing {
63+ val keyId = System .getenv(" SIGNING_KEYID" )
64+ val secretKey = System .getenv(" SIGNING_SECRETKEY" )
65+ val passphrase = System .getenv(" SIGNING_PASSPHRASE" )
66+
67+ useInMemoryPgpKeys(keyId, secretKey, passphrase)
68+ }
69+
70+ centralPortal {
71+ name = " util"
72+ username = System .getenv(" SONATYPE_USERNAME" )
73+ password = System .getenv(" SONATYPE_PASSWORD" )
74+ pom {
75+ name = " Util"
76+ description = " A simple library that contains common object mapper configurations and extensions for Spring Boot."
77+ url = " https://valensas.com/"
78+ scm {
79+ url = " https://github.com/Valensas/util"
80+ }
81+
82+ licenses {
83+ license {
84+ name.set(" MIT License" )
85+ url.set(" https://mit-license.org" )
7186 }
7287 }
73- }
7488
75- publications {
76- create<MavenPublication >(" artifact" ) {
77- from(components[" java" ])
89+ developers {
90+ developer {
91+ id.set(" 0" )
92+ name.set(" Valensas" )
93+ email.set(" info@valensas.com" )
94+ }
7895 }
7996 }
8097}
0 commit comments