11import com.diffplug.gradle.spotless.SpotlessPlugin
22import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin
3+ import com.vanniktech.maven.publish.SonatypeHost
34import groovy.json.JsonSlurper
45import xyz.jpenilla.runpaper.task.RunServer
56import java.net.URI
67
78plugins {
89 java
910 `java- library`
10- `maven- publish`
1111 signing
1212
1313 alias(libs.plugins.shadow)
1414 alias(libs.plugins.spotless)
1515 alias(libs.plugins.grgit)
16- alias(libs.plugins.nexus )
16+ alias(libs.plugins.publish )
1717
1818 eclipse
1919 idea
@@ -68,7 +68,7 @@ subprojects {
6868 apply {
6969 plugin<JavaPlugin >()
7070 plugin<JavaLibraryPlugin >()
71- plugin<MavenPublishPlugin >()
71+ plugin< com.vanniktech.maven.publish. MavenPublishPlugin > ()
7272 plugin<ShadowPlugin >()
7373 plugin<SpotlessPlugin >()
7474 plugin<SigningPlugin >()
@@ -107,11 +107,6 @@ subprojects {
107107 }
108108 }
109109
110- java {
111- withSourcesJar()
112- withJavadocJar()
113- }
114-
115110 val javaComponent = components[" java" ] as AdhocComponentWithVariants
116111 javaComponent.withVariantsFromConfiguration(configurations[" shadowRuntimeElements" ]) {
117112 skip()
@@ -127,74 +122,74 @@ subprojects {
127122 }
128123 }
129124
130- publishing {
131- publications {
132- create<MavenPublication >(" maven" ) {
133- from(components[" java" ])
134-
135- pom {
136-
137- name.set(project.name + " " + project.version)
138- description.set(" PlotSquared, a land and world management plugin for Minecraft." )
139- url.set(" https://github.com/IntellectualSites/PlotSquared" )
140-
141- licenses {
142- license {
143- name.set(" GNU General Public License, Version 3.0" )
144- url.set(" https://www.gnu.org/licenses/gpl-3.0.html" )
145- distribution.set(" repo" )
146- }
147- }
148-
149- developers {
150- developer {
151- id.set(" Sauilitired" )
152- name.set(" Alexander Söderberg" )
153- organization.set(" IntellectualSites" )
154- organizationUrl.set(" https://github.com/IntellectualSites" )
155- }
156- developer {
157- id.set(" NotMyFault" )
158- name.set(" Alexander Brandes" )
159- organization.set(" IntellectualSites" )
160- organizationUrl.set(" https://github.com/IntellectualSites" )
161- email.set(" contact(at)notmyfault.dev" )
162- }
163- developer {
164- id.set(" SirYwell" )
165- name.set(" Hannes Greule" )
166- organization.set(" IntellectualSites" )
167- organizationUrl.set(" https://github.com/IntellectualSites" )
168- }
169- developer {
170- id.set(" dordsor21" )
171- name.set(" dordsor21" )
172- organization.set(" IntellectualSites" )
173- organizationUrl.set(" https://github.com/IntellectualSites" )
174- }
175- }
176-
177- scm {
178- url.set(" https://github.com/IntellectualSites/PlotSquared" )
179- connection.set(" scm:git:https://github.com/IntellectualSites/PlotSquared.git" )
180- developerConnection.set(
" scm:git:[email protected] :IntellectualSites/PlotSquared.git" )
181- tag.set(" ${project.version} " )
182- }
183-
184- issueManagement {
185- system.set(" GitHub" )
186- url.set(" https://github.com/IntellectualSites/PlotSquared/issues" )
187- }
125+ mavenPublishing {
126+ coordinates(
127+ groupId = " $group " ,
128+ artifactId = project.name,
129+ version = " ${project.version} " ,
130+ )
131+
132+ pom {
133+ name.set(project.name)
134+ description.set(" PlotSquared, a land and world management plugin for Minecraft." )
135+ url.set(" https://github.com/IntellectualSites/PlotSquared" )
136+
137+ licenses {
138+ license {
139+ name.set(" GNU General Public License, Version 3.0" )
140+ url.set(" https://www.gnu.org/licenses/gpl-3.0.html" )
141+ distribution.set(" repo" )
188142 }
189143 }
144+
145+ developers {
146+ developer {
147+ id.set(" Sauilitired" )
148+ name.set(" Alexander Söderberg" )
149+ organization.set(" IntellectualSites" )
150+ organizationUrl.set(" https://github.com/IntellectualSites" )
151+ }
152+ developer {
153+ id.set(" NotMyFault" )
154+ name.set(" Alexander Brandes" )
155+ organization.set(" IntellectualSites" )
156+ organizationUrl.set(" https://github.com/IntellectualSites" )
157+ email.set(" contact(at)notmyfault.dev" )
158+ }
159+ developer {
160+ id.set(" SirYwell" )
161+ name.set(" Hannes Greule" )
162+ organization.set(" IntellectualSites" )
163+ organizationUrl.set(" https://github.com/IntellectualSites" )
164+ }
165+ developer {
166+ id.set(" dordsor21" )
167+ name.set(" dordsor21" )
168+ organization.set(" IntellectualSites" )
169+ organizationUrl.set(" https://github.com/IntellectualSites" )
170+ }
171+ }
172+
173+ scm {
174+ url.set(" https://github.com/IntellectualSites/PlotSquared" )
175+ connection.set(" scm:git:https://github.com/IntellectualSites/PlotSquared.git" )
176+ developerConnection.set(
" scm:git:[email protected] :IntellectualSites/PlotSquared.git" )
177+ tag.set(" ${project.version} " )
178+ }
179+
180+ issueManagement {
181+ system.set(" GitHub" )
182+ url.set(" https://github.com/IntellectualSites/PlotSquared/issues" )
183+ }
184+
185+ publishToMavenCentral(SonatypeHost .CENTRAL_PORTAL )
190186 }
191187 }
192188
193189 tasks {
194190
195191 compileJava {
196192 options.compilerArgs.add(" -parameters" )
197- options.isDeprecation = true
198193 options.encoding = " UTF-8"
199194 }
200195
@@ -217,15 +212,6 @@ subprojects {
217212 }
218213}
219214
220- nexusPublishing {
221- this .repositories {
222- sonatype {
223- nexusUrl.set(URI .create(" https://s01.oss.sonatype.org/service/local/" ))
224- snapshotRepositoryUrl.set(URI .create(" https://s01.oss.sonatype.org/content/repositories/snapshots/" ))
225- }
226- }
227- }
228-
229215tasks.getByName<Jar >(" jar" ) {
230216 enabled = false
231217}
0 commit comments