@@ -9,7 +9,7 @@ plugins {
99 `maven- publish`
1010}
1111
12- val baseVersion = " 0.0.15 "
12+ val baseVersion = " 0.0.16 "
1313val commitHash = System .getenv(" COMMIT_HASH" )
1414val timestamp = System .currentTimeMillis() // Temporary to be able to build and publish directly out of fix branch with same commit hash
1515val snapshotVersion = " ${baseVersion} -dev.${timestamp} -${commitHash} "
@@ -40,7 +40,12 @@ subprojects {
4040 apply {
4141 plugin(rootProject.libs.plugins.shadow.get().pluginId)
4242 plugin(rootProject.libs.plugins.kotlin.jvm.get().pluginId)
43- plugin(rootProject.libs.plugins.sonatype.central.portal.publisher.get().pluginId)
43+
44+ // Only apply the central portal publisher plugin to non-shared modules
45+ // to avoid conflicts with the mavenJava publication
46+ if (project.path != " :platform:shared" ) {
47+ plugin(rootProject.libs.plugins.sonatype.central.portal.publisher.get().pluginId)
48+ }
4449 }
4550
4651 java {
@@ -55,34 +60,36 @@ subprojects {
5560 }
5661 }
5762
58- publishing {
59- repositories {
60- maven {
61- name = " simplecloud"
62- url = uri(" https://repo.simplecloud.app/snapshots/" )
63- credentials {
64- username = System .getenv(" SIMPLECLOUD_USERNAME" )? : (project.findProperty(" simplecloudUsername" ) as ? String )
65- password = System .getenv(" SIMPLECLOUD_PASSWORD" )? : (project.findProperty(" simplecloudPassword" ) as ? String )
63+ if (project.path != " :platform:shared" ) {
64+ publishing {
65+ repositories {
66+ maven {
67+ name = " simplecloud"
68+ url = uri(" https://repo.simplecloud.app/snapshots/" )
69+ credentials {
70+ username = System .getenv(" SIMPLECLOUD_USERNAME" )? : (project.findProperty(" simplecloudUsername" ) as ? String )
71+ password = System .getenv(" SIMPLECLOUD_PASSWORD" )? : (project.findProperty(" simplecloudPassword" ) as ? String )
72+ }
73+ authentication {
74+ create<BasicAuthentication >(" basic" )
75+ }
6676 }
67- authentication {
68- create<BasicAuthentication >(" basic" )
77+ }
78+
79+ publications {
80+ create<MavenPublication >(" mavenJava" ) {
81+ from(components[" java" ])
6982 }
7083 }
7184 }
7285
73- publications {
74- create< MavenPublication >( " mavenJava " ) {
75- from(components[ " java " ])
86+ signing {
87+ if (commitHash != null ) {
88+ return @signing
7689 }
77- }
78- }
7990
80- signing {
81- if (commitHash != null ) {
82- return @signing
91+ sign(publishing.publications)
92+ useGpgCmd()
8393 }
84-
85- sign(publishing.publications)
86- useGpgCmd()
8794 }
8895}
0 commit comments