@@ -2,12 +2,14 @@ plugins {
22 id ' java-library'
33 id ' maven-publish'
44 id ' com.diffplug.spotless' version ' 6.11.0'
5+ id ' signing'
6+ id ' cl.franciscosolis.sonatype-central-upload' version ' 1.0.3'
57}
68
79repositories {
810 mavenCentral()
911 maven {
10- url ' https://s01. oss.sonatype.org/content/repositories/releases /'
12+ url ' https://oss.sonatype.org/service/local/staging/deploy/maven2 /'
1113 }
1214}
1315
4446
4547group = ' io.intercom'
4648
47- version = ' 3.0.0-alpha4 '
49+ version = ' 3.0.0-alpha5 '
4850
4951jar {
5052 dependsOn(" :generatePomFileForMavenPublication" )
@@ -59,6 +61,10 @@ javadocJar {
5961 archiveBaseName = " intercom-java"
6062}
6163
64+ signing {
65+ sign(publishing. publications)
66+ }
67+
6268test {
6369 useJUnitPlatform()
6470 testLogging {
@@ -71,15 +77,24 @@ publishing {
7177 maven(MavenPublication ) {
7278 groupId = ' io.intercom'
7379 artifactId = ' intercom-java'
74- version = ' 3.0.0-alpha4 '
80+ version = ' 3.0.0-alpha5 '
7581 from components. java
7682 pom {
83+ name = ' intercom'
84+ description = ' The official SDK of intercom'
85+ url = ' https://buildwithfern.com'
7786 licenses {
7887 license {
7988 name = ' The MIT License (MIT)'
8089 url = ' https://mit-license.org/'
8190 }
8291 }
92+ developers {
93+ developer {
94+ name = ' intercom'
95+ email = ' developers@intercom.com'
96+ }
97+ }
8398 scm {
8499 connection = ' scm:git:git://github.com/intercom/intercom-java.git'
85100 developerConnection = ' scm:git:git://github.com/intercom/intercom-java.git'
@@ -88,14 +103,28 @@ publishing {
88103 }
89104 }
90105 }
91- repositories {
92- maven {
93- url " $System . env . MAVEN_PUBLISH_REGISTRY_URL "
94- credentials {
95- username " $System . env . MAVEN_USERNAME "
96- password " $System . env . MAVEN_PASSWORD "
97- }
98- }
99- }
100106}
101107
108+ sonatypeCentralUpload {
109+ username = " $System . env . MAVEN_USERNAME "
110+ password = " $System . env . MAVEN_PASSWORD "
111+
112+ archives = files(
113+ " $buildDir /libs/intercom-java-" + version + " .jar" ,
114+ " $buildDir /libs/intercom-java-" + version + " -sources.jar" ,
115+ " $buildDir /libs/intercom-java-" + version + " -javadoc.jar"
116+ )
117+
118+ pom = file(" $buildDir /publications/maven/pom-default.xml" )
119+ signingKey = " $System . env . MAVEN_SIGNATURE_SECRET_KEY "
120+ signingKeyPassphrase = " $System . env . MAVEN_SIGNATURE_PASSWORD "
121+ }
122+
123+ signing {
124+ def signingKeyId = " $System . env . MAVEN_SIGNATURE_SECRET_KEY "
125+ def signingPassword = " $System . env . MAVEN_SIGNATURE_PASSWORD "
126+ useInMemoryPgpKeys(signingKeyId, signingPassword)
127+ sign publishing. publications. maven
128+ }
129+
130+ sonatypeCentralUpload. dependsOn build
0 commit comments