11import org.cadixdev.gradle.licenser.LicenseExtension
2+ import java.net.URI
23
34plugins {
45 java
@@ -7,43 +8,32 @@ plugins {
78 signing
89
910 id(" org.cadixdev.licenser" ) version " 0.6.1"
11+ id(" io.github.gradle-nexus.publish-plugin" ) version " 1.1.0"
1012
1113 idea
1214 eclipse
1315}
1416
1517java {
16- toolchain.languageVersion.set(JavaLanguageVersion .of(16 ))
17- }
18-
19- tasks.compileJava.configure {
20- options.release.set(8 )
18+ toolchain.languageVersion.set(JavaLanguageVersion .of(8 ))
2119}
2220
2321configurations.all {
24- attributes.attribute(TargetJvmVersion .TARGET_JVM_VERSION_ATTRIBUTE , 16 )
22+ attributes.attribute(TargetJvmVersion .TARGET_JVM_VERSION_ATTRIBUTE , 8 )
2523}
2624
2725group = " com.arcaniax"
28- version = " 1.3.1"
29-
30- var versuffix by extra(" SNAPSHOT" )
31- version = if (! project.hasProperty(" release" )) {
32- String .format(" %s-%s" , project.version, versuffix)
33- } else {
34- String .format(project.version as String )
35- }
26+ version = " 1.3.1-SNAPSHOT"
3627
3728repositories {
38- mavenCentral()
3929 maven {
4030 name = " PaperMC"
4131 url = uri(" https://papermc.io/repo/repository/maven-public/" )
4232 }
4333}
4434
4535dependencies {
46- compileOnly(" io.papermc .paper:paper-api:1.17.1 -R0.1-SNAPSHOT" )
36+ compileOnly(" com.destroystokyo .paper:paper-api:1.16.5 -R0.1-SNAPSHOT" )
4737}
4838
4939configure<LicenseExtension > {
8272
8373signing {
8474 if (! version.toString().endsWith(" -SNAPSHOT" )) {
75+ val signingKey: String? by project
76+ val signingPassword: String? by project
77+ useInMemoryPgpKeys(signingKey, signingPassword)
8578 signing.isRequired
8679 sign(publishing.publications)
8780 }
@@ -126,29 +119,13 @@ publishing {
126119 }
127120 }
128121 }
122+ }
129123
124+ nexusPublishing {
130125 repositories {
131- mavenLocal()
132- val nexusUsername: String? by project
133- val nexusPassword: String? by project
134- if (nexusUsername != null && nexusPassword != null ) {
135- maven {
136- val releasesRepositoryUrl =
137- " https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
138- val snapshotRepositoryUrl =
139- " https://s01.oss.sonatype.org/content/repositories/snapshots/"
140- url = uri(
141- if (version.toString().endsWith(" -SNAPSHOT" )) snapshotRepositoryUrl
142- else releasesRepositoryUrl
143- )
144-
145- credentials {
146- username = nexusUsername
147- password = nexusPassword
148- }
149- }
150- } else {
151- logger.warn(" No nexus repository is added; nexusUsername or nexusPassword is null." )
126+ sonatype {
127+ nexusUrl.set(URI .create(" https://s01.oss.sonatype.org/service/local/" ))
128+ snapshotRepositoryUrl.set(URI .create(" https://s01.oss.sonatype.org/content/repositories/snapshots/" ))
152129 }
153130 }
154131}
0 commit comments