|
1 | 1 | plugins {
|
2 | 2 | id 'java-library'
|
3 | 3 | id 'maven-publish'
|
4 |
| - id 'signing' |
| 4 | + id 'org.jreleaser' version '1.18.0' |
5 | 5 | id "com.diffplug.spotless" version "6.13.0"
|
6 | 6 | }
|
7 | 7 |
|
8 | 8 | group = 'cloud.eppo'
|
9 |
| -version = '3.11.0' |
| 9 | +version = '3.11.1' |
10 | 10 | ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
|
11 | 11 |
|
12 | 12 | java {
|
@@ -71,8 +71,10 @@ tasks.register('testJar', Jar) {
|
71 | 71 |
|
72 | 72 | publishing {
|
73 | 73 | publications {
|
74 |
| - mavenJava(MavenPublication) { |
| 74 | + maven(MavenPublication) { |
| 75 | + groupId = 'cloud.eppo' |
75 | 76 | artifactId = 'sdk-common-jvm'
|
| 77 | + |
76 | 78 | from components.java
|
77 | 79 | artifact testJar // Include the test-jar in the published artifacts
|
78 | 80 | versionMapping {
|
@@ -100,21 +102,46 @@ publishing {
|
100 | 102 | }
|
101 | 103 | }
|
102 | 104 | scm {
|
103 |
| - connection = 'scm:git:git://example.com/my-library.git' |
104 |
| - developerConnection = 'scm:git:ssh://example.com/my-library.git' |
105 |
| - url = 'http://example.com/my-library/' |
| 105 | + connection = 'scm:git:git://github.com/Eppo-exp/sdk-common-jvm.git' |
| 106 | + developerConnection = 'scm:git:ssh://github.com/Eppo-exp/sdk-common-jvm.git' |
| 107 | + url = 'https://github.com/Eppo-exp/sdk-common-jvm' |
106 | 108 | }
|
107 | 109 | }
|
108 | 110 | }
|
109 | 111 | }
|
110 | 112 | repositories {
|
111 | 113 | maven {
|
112 |
| - def releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" |
113 |
| - def snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots/" |
114 |
| - url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl |
115 |
| - credentials { |
116 |
| - username = project.properties.containsKey("ossrhUsername") ? project.properties["ossrhUsername"] : "" |
117 |
| - password = project.properties.containsKey("ossrhPassword") ? project.properties["ossrhPassword"] : "" |
| 114 | + url = layout.buildDirectory.dir('staging-deploy') |
| 115 | + } |
| 116 | + } |
| 117 | +} |
| 118 | + |
| 119 | +jreleaser { |
| 120 | + signing { |
| 121 | + active = 'ALWAYS' |
| 122 | + armored = true |
| 123 | + verify = false |
| 124 | + } |
| 125 | + deploy { |
| 126 | + maven { |
| 127 | + mavenCentral { |
| 128 | + 'release-deploy' { |
| 129 | + active = 'RELEASE' |
| 130 | + url = 'https://central.sonatype.com/api/v1/publisher' |
| 131 | + stagingRepository('build/staging-deploy') |
| 132 | + } |
| 133 | + } |
| 134 | + nexus2 { |
| 135 | + 'snapshot-deploy' { |
| 136 | + active = 'SNAPSHOT' |
| 137 | + snapshotUrl = 'https://central.sonatype.com/repository/maven-snapshots' |
| 138 | + url = 'https://central.sonatype.com/repository/maven-snapshots' |
| 139 | + applyMavenCentralRules = true |
| 140 | + snapshotSupported = true |
| 141 | + closeRepository = true |
| 142 | + releaseRepository = true |
| 143 | + stagingRepository('build/staging-deploy') |
| 144 | + } |
118 | 145 | }
|
119 | 146 | }
|
120 | 147 | }
|
@@ -142,22 +169,6 @@ tasks.named('publish').configure {
|
142 | 169 | dependsOn checkVersion
|
143 | 170 | }
|
144 | 171 |
|
145 |
| -// Conditionally enable or disable publishing tasks |
146 |
| -tasks.withType(PublishToMavenRepository).configureEach { |
147 |
| - onlyIf { |
148 |
| - project.ext.has('shouldPublish') && project.ext.shouldPublish |
149 |
| - } |
150 |
| -} |
151 |
| - |
152 |
| -if (!project.gradle.startParameter.taskNames.contains('publishToMavenLocal')) { |
153 |
| - signing { |
154 |
| - sign publishing.publications.mavenJava |
155 |
| - if (System.env['CI']) { |
156 |
| - useInMemoryPgpKeys(System.env.GPG_PRIVATE_KEY, System.env.GPG_PASSPHRASE) |
157 |
| - } |
158 |
| - } |
159 |
| -} |
160 |
| - |
161 | 172 | javadoc {
|
162 | 173 | failOnError = false
|
163 | 174 | options.addStringOption('Xdoclint:none', '-quiet')
|
|
0 commit comments