Skip to content

Commit eed04bf

Browse files
committed
Update publishing to central portal
1 parent 00835bd commit eed04bf

File tree

1,066 files changed

+46
-252353
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,066 files changed

+46
-252353
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
run: ./gradlew test
3939
env:
4040
TEST_SQUARE_TOKEN: ${{ secrets.TEST_SQUARE_TOKEN }}
41+
4142
publish:
4243
needs: [ compile ]
4344
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
@@ -54,10 +55,10 @@ jobs:
5455
java-version: "11"
5556
architecture: x64
5657

57-
- name: Publish to maven
58-
run: |
59-
./gradlew publish
58+
- name: Publish to Maven Central
59+
run: ./gradlew publish --stacktrace
6060
env:
61-
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
62-
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
63-
MAVEN_PUBLISH_REGISTRY_URL: "https://s01.oss.sonatype.org/content/repositories/releases/"
61+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_CENTRAL_USERNAME }}
62+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_CENTRAL_PASSWORD }}
63+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SECRET_KEY }}
64+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_SECRET_PASSPHRASE }}

build.gradle

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
plugins {
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

77
repositories {
88
mavenCentral()
9-
maven {
10-
url 'https://s01.oss.sonatype.org/content/repositories/releases/'
11-
}
129
}
1310

1411
dependencies {
@@ -20,7 +17,6 @@ dependencies {
2017
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
2118
}
2219

23-
2420
sourceCompatibility = 1.8
2521
targetCompatibility = 1.8
2622

@@ -35,15 +31,7 @@ spotless {
3531
}
3632
}
3733

38-
39-
java {
40-
withSourcesJar()
41-
withJavadocJar()
42-
}
43-
44-
4534
group = 'com.squareup'
46-
4735
version = '45.0.0.20250618'
4836

4937
jar {
@@ -66,35 +54,48 @@ test {
6654
}
6755
}
6856

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-
}
57+
// Configure maven publishing for Central Portal
58+
mavenPublishing {
59+
publishToMavenCentral()
60+
signAllPublications()
61+
62+
coordinates("com.squareup", "square", "$version")
63+
64+
pom {
65+
name = "Square Java SDK"
66+
description = "Official Square Java SDK"
67+
inceptionYear = "2019"
68+
url = "https://github.com/square/square-java-sdk"
69+
70+
licenses {
71+
license {
72+
name = "MIT License"
73+
url = "https://opensource.org/licenses/MIT"
74+
distribution = "repo"
8775
}
8876
}
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"
77+
78+
developers {
79+
developer {
80+
id = "square"
81+
name = "Square"
82+
url = "https://github.com/square"
9683
}
9784
}
85+
86+
scm {
87+
url = "https://github.com/square/square-java-sdk"
88+
connection = "scm:git:git://github.com/square/square-java-sdk.git"
89+
developerConnection = "scm:git:ssh://[email protected]/square/square-java-sdk.git"
90+
}
9891
}
9992
}
10093

94+
java {
95+
withSourcesJar()
96+
withJavadocJar()
97+
98+
toolchain {
99+
languageVersion = JavaLanguageVersion.of(8)
100+
}
101+
}

legacy-sdk/build.gradle

Lines changed: 0 additions & 82 deletions
This file was deleted.

legacy-sdk/src/main/java/com/squareup/square/legacy/ApiHelper.java

Lines changed: 0 additions & 8 deletions
This file was deleted.

legacy-sdk/src/main/java/com/squareup/square/legacy/BearerAuthCredentials.java

Lines changed: 0 additions & 20 deletions
This file was deleted.

legacy-sdk/src/main/java/com/squareup/square/legacy/CompatibilityFactoryImpl.java

Lines changed: 0 additions & 90 deletions
This file was deleted.

0 commit comments

Comments
 (0)