@@ -12,16 +12,21 @@ plugins {
1212
1313 id(" io.spring.dependency-management" ) version springDependencyManagementVersion
1414 kotlin(" jvm" ) version kotlinVersion
15+ id(" java-library" )
1516 id(" com.adarshr.test-logger" ) version adarshrTestLoggerVersion
1617 id(" jacoco" )
1718 id(" org.sonarqube" ) version sonarqubeVersion
19+ id(" maven-publish" )
20+ id(" signing" )
1821}
1922
20- group = " io.github.tobi. laa"
23+ group = " io.github.tobi- laa"
2124version = " 0.0.1-SNAPSHOT"
2225
2326java {
2427 sourceCompatibility = JavaVersion .VERSION_17
28+ withJavadocJar()
29+ withSourcesJar()
2530}
2631
2732sonar {
@@ -72,4 +77,79 @@ tasks.jacocoTestReport {
7277 reports {
7378 xml.required = true
7479 }
75- }
80+ }
81+
82+ publishing {
83+ publications {
84+ create<MavenPublication >(" mavenJava" ) {
85+ groupId = " ${group} "
86+ artifactId = rootProject.name
87+ version = version
88+ from(components[" java" ])
89+ versionMapping {
90+ usage(" java-api" ) {
91+ fromResolutionOf(" runtimeClasspath" )
92+ }
93+ usage(" java-runtime" ) {
94+ fromResolutionResult()
95+ }
96+ }
97+ pom {
98+ name = " ${group} :${rootProject.name} "
99+ description = " Integrates embedded-redis with Spring Boot"
100+ url = " https://github.com/tobias-laa/spring-boot-embedded-redis.git"
101+ properties = mapOf (
102+ " myProp" to " value" ,
103+ " prop.with.dots" to " anotherValue"
104+ )
105+ licenses {
106+ license {
107+ name = " The Apache License, Version 2.0"
108+ url = " http://www.apache.org/licenses/LICENSE-2.0.txt"
109+ distribution = " repo"
110+ comments = " A business-friendly OSS license"
111+ }
112+ }
113+ developers {
114+ developer {
115+ id = " tobi-laa"
116+ name = " Tobias Laatsch"
117+ email = " tobias.laatsch@posteo.de"
118+ organizationUrl = " https://github.com/tobias-laa"
119+ }
120+ }
121+ scm {
122+ connection = " scm:git:git@github.com:tobias-laa/spring-boot-embedded-redis.git"
123+ developerConnection = " scm:git:git@github.com:tobias-laa/spring-boot-embedded-redis.git"
124+ url = " https://github.com/tobias-laa/spring-boot-embedded-redis/tree/master"
125+ tag = " HEAD"
126+ }
127+ issueManagement {
128+ system = " GitHub Issues"
129+ url = " https://github.com/tobias-laa/spring-boot-embedded-redis/issues"
130+ }
131+ inceptionYear = " 2024"
132+ }
133+ }
134+ }
135+ repositories {
136+ maven {
137+ name = " OSSRH"
138+ val releasesRepoUrl = uri(" https://oss.sonatype.org/service/local/staging/deploy/maven2/" )
139+ val snapshotsRepoUrl = uri(" https://oss.sonatype.org/content/repositories/snapshots" )
140+ url = if (version.toString().endsWith(" SNAPSHOT" )) snapshotsRepoUrl else releasesRepoUrl
141+ credentials {
142+ username = System .getenv(" MAVEN_USERNAME" )
143+ password = System .getenv(" MAVEN_PASSWORD" )
144+ }
145+ }
146+ }
147+ }
148+
149+ signing {
150+ sign(publishing.publications[" mavenJava" ])
151+ }
152+
153+ tasks.javadoc {
154+ (options as StandardJavadocDocletOptions ).addBooleanOption(" html5" , true )
155+ }
0 commit comments