11plugins {
22 id ' java-library'
3- id ' maven-publish'
43 id ' com.diffplug.spotless' version ' 6.11.0'
4+ id ' com.vanniktech.maven.publish' version ' 0.27.0'
55}
66
77repositories {
88 mavenCentral()
9- maven {
10- url ' https://s01.oss.sonatype.org/content/repositories/releases/'
11- }
129}
1310
1411dependencies {
@@ -20,7 +17,6 @@ dependencies {
2017 testImplementation ' org.junit.jupiter:junit-jupiter-engine:5.8.2'
2118}
2219
23-
2420sourceCompatibility = 1.8
2521targetCompatibility = 1.8
2622
@@ -35,66 +31,58 @@ spotless {
3531 }
3632}
3733
38-
39- java {
40- withSourcesJar()
41- withJavadocJar()
42- }
43-
44-
4534group = ' com.squareup'
46-
4735version = ' 45.0.0.20250618'
4836
49- jar {
50- dependsOn(" :generatePomFileForMavenPublication" )
51- archiveBaseName = " square"
52- }
53-
54- sourcesJar {
55- archiveBaseName = " square"
56- }
57-
58- javadocJar {
59- archiveBaseName = " square"
60- }
61-
6237test {
6338 useJUnitPlatform()
6439 testLogging {
6540 showStandardStreams = true
6641 }
6742}
6843
69- publishing {
70- publications {
71- maven( MavenPublication ) {
72- groupId = ' com.squareup '
73- artifactId = ' square '
74- version = ' 45.0.0.20250618 '
75- from components . java
76- pom {
77- licenses {
78- license {
79- name = ' MIT '
80- }
81- }
82- scm {
83- connection = ' scm:git:git://github.com/square/square-java-sdk.git '
84- developerConnection = ' scm:git:git://github.com/square/square-java-sdk.git '
85- url = ' https://github.com/square/square-java-sdk '
86- }
44+ // Configure maven publishing for Central Portal
45+ mavenPublishing {
46+ publishToMavenCentral( " CENTRAL " )
47+ signAllPublications()
48+
49+ coordinates( " com.squareup " , " square " , " $ version " )
50+
51+ pom {
52+ name = " Square Java SDK "
53+ description = " Official Square Java SDK "
54+ inceptionYear = " 2019 "
55+ url = " https://github.com/square/square-java-sdk "
56+
57+ licenses {
58+ license {
59+ name = " MIT License "
60+ url = " https://opensource.org/licenses/MIT "
61+ distribution = " repo "
8762 }
8863 }
89- }
90- repositories {
91- maven {
92- url " $System . env . MAVEN_PUBLISH_REGISTRY_URL "
93- credentials {
94- username " $System . env . MAVEN_USERNAME "
95- password " $System . env . MAVEN_PASSWORD "
64+
65+ developers {
66+ developer {
67+ id = " square"
68+ name = " Square"
69+ url = " https://github.com/square"
9670 }
9771 }
72+
73+ scm {
74+ url = " https://github.com/square/square-java-sdk"
75+ connection = " scm:git:git://github.com/square/square-java-sdk.git"
76+ developerConnection
= " scm:git:ssh://[email protected] /square/square-java-sdk.git" 77+ }
9878 }
9979}
10080
81+ java {
82+ withSourcesJar()
83+ withJavadocJar()
84+
85+ toolchain {
86+ languageVersion = JavaLanguageVersion . of(8 )
87+ }
88+ }
0 commit comments