File tree Expand file tree Collapse file tree
build-logic/src/main/kotlin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,8 +40,13 @@ jreleaser {
4040
4141 files {
4242 subprojects.forEach { project ->
43- glob {
44- pattern.set(project.layout.buildDirectory.dir(" libs" ).get().asFile.absolutePath + " /**.jar" )
43+ // Exclude test modules from JReleaser files
44+ if (! project.name.endsWith(" -tests" )) {
45+ glob {
46+ pattern.set(
47+ project.layout.buildDirectory.dir(" libs" ).get().asFile.absolutePath + " /**.jar"
48+ )
49+ }
4550 }
4651 }
4752 }
@@ -174,9 +179,12 @@ jreleaser {
174179 url.set(" https://central.sonatype.com/api/v1/publisher" )
175180 applyMavenCentralRules.set(true )
176181 subprojects.forEach { project ->
177- stagingRepository(
178- project.layout.buildDirectory.dir(" staging-deploy" ).get().asFile.absolutePath
179- )
182+ // Exclude test modules from JReleaser deployment
183+ if (! project.name.endsWith(" -tests" )) {
184+ stagingRepository(
185+ project.layout.buildDirectory.dir(" staging-deploy" ).get().asFile.absolutePath
186+ )
187+ }
180188 }
181189 }
182190 }
Original file line number Diff line number Diff line change @@ -90,7 +90,12 @@ afterEvaluate {
9090 if (project == project.rootProject) {
9191 withXml {
9292 val modules = asNode().appendNode(" modules" )
93- subprojects.forEach { subproject -> modules.appendNode(" module" , subproject.name) }
93+ subprojects.forEach { subproject ->
94+ // Exclude test modules from Maven publication
95+ if (! subproject.name.endsWith(" -tests" )) {
96+ modules.appendNode(" module" , subproject.name)
97+ }
98+ }
9499 }
95100 } else {
96101 withXml {
@@ -106,8 +111,8 @@ afterEvaluate {
106111
107112 // Add all project modules to the BOM
108113 rootProject.subprojects.forEach { subproject ->
109- // Skip the BOM itself
110- if (subproject.name != project.name) {
114+ // Skip the BOM itself and test modules
115+ if (subproject.name != project.name && ! subproject.name.endsWith( " -tests " ) ) {
111116 dependencies.appendNode(" dependency" ).apply {
112117 appendNode(" groupId" , subproject.group)
113118 appendNode(" artifactId" , subproject.name)
You can’t perform that action at this time.
0 commit comments