@@ -5,13 +5,8 @@ plugins {
55 id ' maven-publish' // for jitpack.io
66}
77
8- String group = System . getenv(" GROUP" ) ?: properties[" group" ] ?: " com.github.server-utilities"
9- String commitHash = " " ;
10-
11- if (System . getenv(" JITPACK" ) != " true" ) {
12- rootProject. group = group
13- rootProject. version = properties[" version" ] + " ." + commitHash
14- }
8+ group = ' com.github.server-utilities'
9+ version = ' 1.0.0'
1510
1611repositories {
1712 mavenCentral()
@@ -74,10 +69,6 @@ shadowJar {
7469 archiveFileName = project. name + ' -' + project. version + ' .jar'
7570}
7671
77- artifacts {
78- archives shadowJar
79- }
80-
8172tasks. register(' deploy' , Copy ) {
8273 // Define the deployment directory
8374 def deployDir = file(System . getenv(" DEPLOY_DIR" ) ?: " $rootDir /deploy" )
@@ -89,31 +80,32 @@ tasks.register('deploy', Copy) {
8980 println " Generated JAR file: ${ shadowJar.archiveFile} "
9081 }
9182
92- // Copy the generated jar(s) to the deploy directory
83+ // Copy the shadowJar output
9384 from shadowJar. archiveFile
9485 into deployDir
9586}
9687
97- // Ensure that the copyToDeployDir task runs after the shadowJar task
88+ // Ensure that the deploy task runs after the shadowJar task
9889shadowJar. finalizedBy(deploy)
9990
10091tasks. named(' deploy' ). configure {
101- dependsOn shadowJar
102- dependsOn jar
92+ dependsOn ' shadowJar' , ' sourcesJar' , ' javadocJar' , ' jar'
10393}
10494
105- tasks. register(' getGitCommitHash' ) {
106- doLast {
107- def ch = ' git rev-parse --short HEAD' . execute(). text. trim()
108- commitHash = ch
95+ publishing {
96+ publications {
97+ maven(MavenPublication ) {
98+ from components. java
99+ }
109100 }
110101}
111102
112- tasks. named(" build" ). configure {
113- dependsOn getGitCommitHash
103+ java {
104+ withSourcesJar()
105+ withJavadocJar()
114106}
115107
116108wrapper {
117109 gradleVersion = ' 8.9'
118110 distributionType = Wrapper.DistributionType . BIN
119- }
111+ }
0 commit comments