1
1
import xyz.jpenilla.resourcefactory.bukkit.BukkitPluginYaml
2
2
3
3
plugins {
4
+ java
4
5
`java- library`
6
+ `maven- publish`
5
7
6
8
id(" com.github.johnrengelman.shadow" ) version " 7.1.2"
7
9
id(" io.papermc.paperweight.userdev" ) version " 1.7.1"
8
10
id(" xyz.jpenilla.resource-factory-bukkit-convention" ) version " 1.1.1"
9
11
id(" xyz.jpenilla.run-paper" ) version " 2.3.0"
12
+ id(" io.github.goooler.shadow" ) version " 8.1.7"
10
13
}
11
14
12
15
group = " org.esoteric_organisation"
13
16
version = " 0.1.1"
14
17
description = " The core plugin of The Slimy Swamp Minecraft server."
15
18
19
+ val projectNameString = rootProject.name
20
+
21
+ val projectGroupString = group.toString()
22
+ val projectVersionString = version.toString()
23
+
24
+ val javaVersion = 21
25
+
16
26
java {
17
- toolchain.languageVersion.set(JavaLanguageVersion .of(21 ))
27
+ toolchain.languageVersion.set(JavaLanguageVersion .of(javaVersion ))
18
28
}
19
29
20
30
dependencies {
@@ -33,8 +43,12 @@ tasks {
33
43
dependsOn(shadowJar)
34
44
}
35
45
46
+ shadowJar {
47
+ archiveFileName.set(" $projectNameString -$projectVersionString .jar" )
48
+ }
49
+
36
50
compileJava {
37
- options.release.set(21 )
51
+ options.release.set(javaVersion )
38
52
}
39
53
40
54
javadoc {
@@ -47,4 +61,19 @@ bukkitPluginYaml {
47
61
load = BukkitPluginYaml .PluginLoadOrder .STARTUP
48
62
authors.addAll(" Esoteric Organisation" , " Esoteric Enderman" )
49
63
apiVersion = " 1.21"
50
- }
64
+ }
65
+
66
+ publishing {
67
+ publications {
68
+ create<MavenPublication >(" mavenJava" ) {
69
+ from(components[" java" ])
70
+ groupId = projectGroupString
71
+ artifactId = projectNameString
72
+ version = projectVersionString
73
+ }
74
+ }
75
+ }
76
+
77
+ tasks.named(" publishMavenJavaPublicationToMavenLocal" ) {
78
+ dependsOn(tasks.named(" build" ))
79
+ }
0 commit comments