1- version = project. getProperties(). get(" version" ) != " unspecified" ? version : ' 1.0.0'
1+ import com.vanniktech.maven.publish.SonatypeHost
2+
3+ version = ' 1.6.1-SNAPSHOT'
4+
5+ buildscript {
6+ repositories {
7+ mavenCentral()
8+ gradlePluginPortal()
9+ }
10+ dependencies {
11+ classpath ' com.vanniktech:gradle-maven-publish-plugin:0.31.0'
12+ classpath " io.freefair.lombok:io.freefair.lombok.gradle.plugin:8.13.1"
13+ }
14+ }
215
316allprojects {
4- if (it. name != ' bom' ) {
17+ group = ' io.github.reajason'
18+
19+ if (it. name != ' memshell-party-bom' ) {
520 apply(plugin : ' java' )
621 apply(plugin : ' idea' )
722 apply(plugin : ' jacoco' )
23+ apply(plugin : ' io.freefair.lombok' )
24+ }
25+
26+ apply(plugin : ' com.vanniktech.maven.publish' )
27+
28+ mavenPublishing {
29+ publishToMavenCentral(SonatypeHost . CENTRAL_PORTAL )
30+ signAllPublications()
31+ coordinates(" io.github.reajason" , project. name, rootProject. version as String )
32+
33+ pom {
34+ name = ' MemShellParty'
35+ description = project. description
36+ url = ' https://github.com/ReaJason/MemShellParty'
37+ inceptionYear = ' 2025'
38+ licenses {
39+ license {
40+ name = ' MIT'
41+ url = ' https://spdx.org/licenses/MIT.html'
42+ }
43+ }
44+ developers {
45+ developer {
46+ id = ' reajason'
47+ name = ' ReaJason'
48+ url = " https://reajason.eu.org"
49+ }
50+ }
51+ scm {
52+ connection = ' scm:git:https://github.com/ReaJason/MemShellParty.git'
53+ developerConnection = ' scm:git:ssh://github.com/ReaJason/MemShellParty.git'
54+ url = ' https://github.com/ReaJason/MemShellParty'
55+ }
56+ }
857 }
958
1059 if (it. name != ' memshell-party-bom' && ! it. name. startsWith(" vul" )) {
@@ -48,4 +97,23 @@ jacocoTestReport {
4897 }
4998 )
5099 }
100+ }
101+
102+ tasks. register(' publishAllToMavenCentral' ) {
103+ def isSnapshot = rootProject. version. toString(). endsWith(' -SNAPSHOT' )
104+ if (isSnapshot) {
105+ dependsOn ' :memshell-party-bom:publishAllPublicationsToMavenCentralRepository'
106+ dependsOn ' :memshell-party-common:publishAllPublicationsToMavenCentralRepository'
107+ dependsOn ' :deserialize:publishAllPublicationsToMavenCentralRepository'
108+ dependsOn ' :memshell:publishAllPublicationsToMavenCentralRepository'
109+ dependsOn ' :memshell-java8:publishAllPublicationsToMavenCentralRepository'
110+ dependsOn ' :generator:publishAllPublicationsToMavenCentralRepository'
111+ } else {
112+ dependsOn ' :memshell-party-bom:publishAndReleaseToMavenCentral'
113+ dependsOn ' :memshell-party-common:publishAndReleaseToMavenCentral'
114+ dependsOn ' :deserialize:publishAndReleaseToMavenCentral'
115+ dependsOn ' :memshell:publishAndReleaseToMavenCentral'
116+ dependsOn ' :memshell-java8:publishAndReleaseToMavenCentral'
117+ dependsOn ' :generator:publishAndReleaseToMavenCentral'
118+ }
51119}
0 commit comments