@@ -2,6 +2,7 @@ plugins {
22 `maven- publish`
33 id(" io.github.gradle-nexus.publish-plugin" ) version " 1.1.0"
44 signing
5+ id(" io.micronaut.test-resources" ) version " 3.6.7" apply (false )
56}
67
78description = " Test-Resources for Spring Boot"
@@ -19,65 +20,72 @@ subprojects {
1920 mavenCentral()
2021 }
2122
22- plugins.apply (MavenPublishPlugin ::class )
23- plugins.apply (SigningPlugin ::class )
23+ if (! this .path.startsWith(" :testprojects" )) {
24+ plugins.apply (MavenPublishPlugin ::class )
25+ plugins.apply (SigningPlugin ::class )
26+ }
2427
2528 afterEvaluate {
2629
27- if (! name.endsWith( " -client " )) {
30+ if (this .subprojects.isEmpty( )) {
2831 dependencies {
29- " implementation" (libs.micronaut.testresources.testcontainers)
32+ " testImplementation" (libs.jupiter.api)
33+ " testRuntimeOnly" (libs.jupiter.engine)
34+ " testImplementation" (libs.assertj)
3035 }
3136 }
3237
33- dependencies {
34- " testImplementation" (libs.jupiter.api)
35- " testRuntimeOnly" (libs.jupiter.engine)
36- " testImplementation" (libs.assertj)
37- }
38+ if (! this .path.startsWith(" :testprojects" )) {
3839
39- configure<PublishingExtension > {
40- publications {
41- create<MavenPublication >(" maven" ) {
42- from(components[" java" ])
43- pom {
44- name.set(project.name)
45- description.set(project.description)
46- url.set(" https://github.com/cloudflightio/springboot-testresources" )
47- licenses {
48- license {
49- name.set(" The Apache License, Version 2.0" )
50- url.set(" http://www.apache.org/licenses/LICENSE-2.0.txt" )
40+ if (! name.endsWith(" -client" )) {
41+ dependencies {
42+ " implementation" (libs.micronaut.testresources.testcontainers)
43+ }
44+ }
45+
46+ configure<PublishingExtension > {
47+ publications {
48+ create<MavenPublication >(" maven" ) {
49+ from(components[" java" ])
50+ pom {
51+ name.set(project.name)
52+ description.set(project.description)
53+ url.set(" https://github.com/cloudflightio/springboot-testresources" )
54+ licenses {
55+ license {
56+ name.set(" The Apache License, Version 2.0" )
57+ url.set(" http://www.apache.org/licenses/LICENSE-2.0.txt" )
58+ }
5159 }
52- }
53- inceptionYear.set(" 2023" )
54- organization {
55- name.set(" Cloudflight" )
56- url.set(" https://cloudflight.io" )
57- }
58- developers {
59- developer {
60- id.set(" cloudflight" )
61- name.set(" Cloudflight Team" )
62- email.set(" opensource@cloudflight.io" )
60+ inceptionYear.set(" 2023" )
61+ organization {
62+ name.set(" Cloudflight" )
63+ url.set(" https://cloudflight.io" )
64+ }
65+ developers {
66+ developer {
67+ id.set(" cloudflight" )
68+ name.set(" Cloudflight Team" )
69+ email.set(" opensource@cloudflight.io" )
70+ }
71+ }
72+ scm {
73+ connection.set(" scm:ggit@github.com:cloudflightio/springboot-testresources.git" )
74+ developerConnection.set(" scm:git@github.com:cloudflightio/springboot-testresources.git" )
75+ url.set(" https://github.com/cloudflightio/springboot-testresources" )
6376 }
64- }
65- scm {
66- connection.set(" scm:ggit@github.com:cloudflightio/springboot-testresources.git" )
67- developerConnection.set(" scm:git@github.com:cloudflightio/springboot-testresources.git" )
68- url.set(" https://github.com/cloudflightio/springboot-testresources" )
6977 }
7078 }
7179 }
7280 }
73- }
7481
75- configure<SigningExtension > {
76- setRequired {
77- System .getenv(" PGP_SECRET" ) != null
82+ configure<SigningExtension > {
83+ setRequired {
84+ System .getenv(" PGP_SECRET" ) != null
85+ }
86+ useInMemoryPgpKeys(System .getenv(" PGP_SECRET" ), System .getenv(" PGP_PASSPHRASE" ))
87+ sign(publishing.publications.getByName(" maven" ))
7888 }
79- useInMemoryPgpKeys(System .getenv(" PGP_SECRET" ), System .getenv(" PGP_PASSPHRASE" ))
80- sign(publishing.publications.getByName(" maven" ))
8189 }
8290 }
8391}
0 commit comments