11plugins {
22 id ' java-library'
3- id ' maven-publish'
4- id ' signing'
3+ id ' com.vanniktech.maven.publish' version ' 0.30.0'
54}
65
76group = ' com.mparticle'
@@ -14,11 +13,6 @@ repositories {
1413sourceCompatibility = JavaVersion . VERSION_1_8
1514targetCompatibility = JavaVersion . VERSION_1_8
1615
17- java {
18- withSourcesJar()
19- withJavadocJar()
20- }
21-
2216javadoc {
2317 title = ' mParticle Server Events SDK API Reference'
2418 options. noTimestamp = true
@@ -51,53 +45,33 @@ dependencies {
5145 testImplementation " org.slf4j:slf4j-api:$slf4j_version "
5246}
5347
54- publishing {
55- publications {
56- maven(MavenPublication ) {
57- from components. java
58- groupId = ' com.mparticle'
59- artifactId = ' server-events-sdk'
60- pom {
61- name = ' mParticle server-side Java SDK'
62- description = ' mParticle SDK for server-side Java environments'
63- url = ' https://github.com/mparticle/mparticle-java-events-sdk'
64- licenses {
65- license {
66- name = ' The Apache Software License, Version 2.0'
67- url = ' http://www.apache.org/license/LICENSE-2.0.txt'
68- }
69- }
70- scm {
71- url = ' https://github.com/mparticle/mparticle-java-events-sdk'
72- connection = ' scm:git:https://github.com/mparticle/mparticle-java-events-sdk'
73- developerConnection = ' scm:git:git@github.com:mparticle/mparticle-java-events-sdk.git'
74- }
75- developers {
76- developer {
77- id = ' mParticle'
78- name = ' mParticle Inc.'
79- email = ' developers@mparticle.com'
80- }
81- }
48+ mavenPublishing {
49+ publishToMavenCentral(com.vanniktech.maven.publish.SonatypeHost . CENTRAL_PORTAL )
50+ signAllPublications()
51+
52+ coordinates(' com.mparticle' , ' server-events-sdk' , version. toString())
53+
54+ pom {
55+ name = ' mParticle server-side Java SDK'
56+ description = ' mParticle SDK for server-side Java environments'
57+ url = ' https://github.com/mparticle/mparticle-java-events-sdk'
58+ licenses {
59+ license {
60+ name = ' The Apache Software License, Version 2.0'
61+ url = ' http://www.apache.org/license/LICENSE-2.0.txt'
8262 }
8363 }
84- }
85- repositories {
86- maven {
87- name = ' sonatype'
88- url = ' https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/'
89- credentials {
90- username = System . getenv(' sonatypeUsername' )
91- password = System . getenv(' sonatypePassword' )
64+ scm {
65+ url = ' https://github.com/mparticle/mparticle-java-events-sdk'
66+ connection = ' scm:git:https://github.com/mparticle/mparticle-java-events-sdk'
67+ developerConnection = ' scm:git:git@github.com:mparticle/mparticle-java-events-sdk.git'
68+ }
69+ developers {
70+ developer {
71+ id = ' mParticle'
72+ name = ' mParticle Inc.'
73+ email = ' developers@mparticle.com'
9274 }
9375 }
9476 }
9577}
96-
97- def signingKey = System . getenv(' ORG_GRADLE_PROJECT_signingInMemoryKey' )
98- def signingPassword = System . getenv(' ORG_GRADLE_PROJECT_signingInMemoryKeyPassword' )
99- signing {
100- required { gradle. taskGraph. hasTask(' publishMavenPublicationToSonatypeRepository' ) }
101- useInMemoryPgpKeys(signingKey, signingPassword)
102- sign publishing. publications. maven
103- }
0 commit comments