@@ -7,27 +7,31 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
77import org.gradle.api.tasks.testing.logging.TestLogEvent
88
99group = ' net.luckperms'
10- version = ' 0.1-SNAPSHOT'
11-
10+ version = ' 0.2-SNAPSHOT'
1211
1312java {
14- // toolchain {
15- // languageVersion = JavaLanguageVersion.of(11)
16- // }
17-
1813 sourceCompatibility = ' 1.8'
1914 targetCompatibility = ' 1.8'
2015
2116 withJavadocJar()
2217 withSourcesJar()
2318}
2419
20+ javadoc {
21+ options. encoding = ' UTF-8'
22+ options. links(
23+ ' https://docs.oracle.com/en/java/javase/21/docs/api/' ,
24+ ' https://javadoc.io/static/com.squareup.retrofit2/retrofit/2.8.1/' ,
25+ ' https://javadoc.io/static/com.squareup.okhttp3/okhttp/3.14.9/' ,
26+ )
27+ }
28+
2529repositories {
2630 mavenCentral()
2731}
2832
2933test {
30- // onlyIf { project.hasProperty('dockerTests') }
34+ onlyIf { project. hasProperty(' dockerTests' ) }
3135 useJUnitPlatform()
3236 testLogging {
3337 events = [TestLogEvent . PASSED , TestLogEvent . FAILED , TestLogEvent . SKIPPED ]
@@ -60,20 +64,66 @@ dependencies {
6064 testImplementation ' com.google.guava:guava:32.1.3-jre'
6165}
6266
63- publishing {
64- // repositories {
65- // maven {
66- // url = 'https://oss.sonatype.org/content/repositories/snapshots'
67- // credentials {
68- // username = sonatypeUsername
69- // password = sonatypePassword
70- // }
71- // }
72- // }
73- publications {
74- mavenJava(MavenPublication ) {
75- from components. java
67+ if (project. hasProperty(' sonatypeUsername' ) && project. hasProperty(' sonatypePassword' )) {
68+ apply plugin : ' signing'
69+
70+ publishing {
71+ repositories {
72+ maven {
73+ def releasesRepoUrl = ' https://oss.sonatype.org/service/local/staging/deploy/maven2/'
74+ def snapshotsRepoUrl = ' https://oss.sonatype.org/content/repositories/snapshots/'
75+ url = version. endsWith(' SNAPSHOT' ) ? snapshotsRepoUrl : releasesRepoUrl
76+
77+ credentials {
78+ username sonatypeUsername
79+ password sonatypePassword
80+ }
81+ }
82+ }
83+
84+ publications {
85+ mavenJava(MavenPublication ) {
86+ from components. java
87+
88+ pom {
89+ name = ' LuckPerms Rest API Java Client'
90+ description = ' A Java client for the LuckPerms REST API.'
91+ url = ' https://luckperms.net'
92+
93+ licenses {
94+ license {
95+ name = ' MIT'
96+ url = ' https://opensource.org/licenses/MIT'
97+ }
98+ }
99+
100+ developers {
101+ developer {
102+ id = ' lucko'
103+ name = ' Luck'
104+ url = ' https://lucko.me'
105+ 106+ }
107+ }
108+
109+ scm {
110+ connection = ' scm:git:https://github.com/LuckPerms/rest-api-java-client.git'
111+ developerConnection
= ' scm:git:[email protected] :LuckPerms/rest-api-java-client.git' 112+ url = ' https://github.com/LuckPerms/rest-api-java-client'
113+ }
114+
115+ issueManagement {
116+ system = ' GitHub'
117+ url = ' https://github.com/LuckPerms/rest-api-java-client/issues'
118+ }
119+ }
120+ }
76121 }
77122 }
78- }
79123
124+ signing {
125+ useGpgCmd()
126+ sign publishing. publications. mavenJava
127+ required = true
128+ }
129+ }
0 commit comments