|
2 | 2 | :central_url: pass:[https://central.sonatype.com/api/v1/publisher] |
3 | 3 | :deployer_url: pass:[https://s01.oss.sonatype.org/service/local] |
4 | 4 | :deployer_old_url: pass:[https://oss.sonatype.org/service/local] |
5 | | -:deployer_snapshot_url: pass:[https://s01.oss.sonatype.org/content/repositories/snapshots/] |
| 5 | +:deployer_snapshot_url: pass:[https://s01.oss.sonatype.org/content/repositories/snapshots] |
| 6 | +:central_snapshot_url: pass:[https://central.sonatype.com/repository/maven-snapshots] |
6 | 7 |
|
7 | 8 | Maven Central is the defacto artifact repository for JVM based projects. Anyone can publish artifacts to it as long as |
8 | 9 | they follow the rules. Follow this link:https://central.sonatype.org/publish/publish-guide/[guide] to register an account. |
@@ -150,6 +151,184 @@ jreleaser { |
150 | 151 | -- |
151 | 152 | ==== |
152 | 153 |
|
| 154 | +=== Publishing Snapshots |
| 155 | + |
| 156 | +Publishing snapshots to the Maven Central Portal requires an additional xref:reference:deploy/maven/nexus2.adoc[] deployer |
| 157 | +as shown next: |
| 158 | + |
| 159 | +[tabs] |
| 160 | +==== |
| 161 | +YAML:: |
| 162 | ++ |
| 163 | +-- |
| 164 | +[source,yaml] |
| 165 | +[subs="+macros,attributes"] |
| 166 | +---- |
| 167 | +signing: |
| 168 | + active: ALWAYS |
| 169 | + armored: true |
| 170 | +
|
| 171 | +deploy: |
| 172 | + maven: |
| 173 | + mavenCentral: |
| 174 | + release-deloy: |
| 175 | + active: RELEASE |
| 176 | + url: {central_url} |
| 177 | + stagingRepositories: |
| 178 | + - target/staging-deploy |
| 179 | + nexus2: |
| 180 | + snapshot-deploy: |
| 181 | + active: SNAPSHOT |
| 182 | + snapshotUrl: {central_snapshot_url} |
| 183 | + applyMavenCentralRules: true |
| 184 | + snapshotSupported: true |
| 185 | + closeRepository: true |
| 186 | + releaseRepository: true |
| 187 | + stagingRepositories: |
| 188 | + - target/staging-deploy |
| 189 | +---- |
| 190 | +-- |
| 191 | +TOML:: |
| 192 | ++ |
| 193 | +-- |
| 194 | +[source,toml] |
| 195 | +[subs="+macros,attributes"] |
| 196 | +---- |
| 197 | +[signing] |
| 198 | + active = "ALWAYS" |
| 199 | + armored = true |
| 200 | +
|
| 201 | +[deploy.maven.mavenCentral.release-deploy] |
| 202 | + active = "RELEASE" |
| 203 | + url = "{central_url}" |
| 204 | + stagingRepositories = ["target/staging-deploy"] |
| 205 | +
|
| 206 | +[deploy.maven.nexus2.snapshot-deploy] |
| 207 | + active = "SNAPSHOT" |
| 208 | + snapshotUrl = "{central_snapshot_url}" |
| 209 | + applyMavenCentralRules = true |
| 210 | + snapshotSupported = true |
| 211 | + closeRepository = true |
| 212 | + releaseRepository = true |
| 213 | + stagingRepositories = ["target/staging-deploy"] |
| 214 | +---- |
| 215 | +-- |
| 216 | +JSON:: |
| 217 | ++ |
| 218 | +-- |
| 219 | +[source,json] |
| 220 | +[subs="+macros,attributes"] |
| 221 | +---- |
| 222 | +{ |
| 223 | + "jreleaser": { |
| 224 | + "signing": { |
| 225 | + "active": "ALWAYS", |
| 226 | + "armored": true |
| 227 | + }, |
| 228 | + "deploy": { |
| 229 | + "maven": { |
| 230 | + "mavenCentral": { |
| 231 | + "release-deploy": { |
| 232 | + "active": "RELEASE", |
| 233 | + "url": "{central_url}", |
| 234 | + "stagingRepositories": [ |
| 235 | + "target/staging-deploy" |
| 236 | + ] |
| 237 | + } |
| 238 | + }, |
| 239 | + "nexus2": { |
| 240 | + "snapshot-deploy": { |
| 241 | + "active": "SNAPSHOT", |
| 242 | + "snapshotUrl": "{central_snapshot_url}", |
| 243 | + "applyMavenCentralRules": true, |
| 244 | + "snapshotSupported": true, |
| 245 | + "closeRepository": true, |
| 246 | + "releaseRepository": false, |
| 247 | + "stagingRepositories": [ |
| 248 | + "target/staging-deploy" |
| 249 | + ] |
| 250 | + } |
| 251 | + } |
| 252 | + } |
| 253 | + } |
| 254 | + } |
| 255 | +} |
| 256 | +---- |
| 257 | +-- |
| 258 | +Maven:: |
| 259 | ++ |
| 260 | +-- |
| 261 | +[source,xml] |
| 262 | +[subs="+macros,attributes,verbatim"] |
| 263 | +---- |
| 264 | +<jreleaser> |
| 265 | + <signing> |
| 266 | + <active>ALWAYS</active> |
| 267 | + <armored>true</armored> |
| 268 | + </signing> |
| 269 | + <deploy> |
| 270 | + <maven> |
| 271 | + <mavenCentral> |
| 272 | + <release-deploy> |
| 273 | + <active>RELEASE</active> |
| 274 | + <url>{central_url}</url> |
| 275 | + <stagingRepositories>target/staging-deploy</stagingRepositories> |
| 276 | + </release-deploy> |
| 277 | + </mavenCentral> |
| 278 | + <nexus2> |
| 279 | + <snapshot-deploy> |
| 280 | + <active>SNAPSHOT</active> |
| 281 | + <snapshotUrl>{central_snapshot_url}</snapshotUrl> |
| 282 | + <applyMavenCentralRules>true</applyMavenCentralRules> |
| 283 | + <snapshotSupported>true</snapshotSupported> |
| 284 | + <closeRepository>true</closeRepository> |
| 285 | + <releaseRepository>true</releaseRepository> |
| 286 | + <stagingRepositories>target/staging-deploy</stagingRepositories> |
| 287 | + </snapshot-deploy> |
| 288 | + </nexus2> |
| 289 | + </maven> |
| 290 | + </deploy> |
| 291 | +</jreleaser> |
| 292 | +---- |
| 293 | +-- |
| 294 | +Gradle:: |
| 295 | ++ |
| 296 | +-- |
| 297 | +[source,groovy] |
| 298 | +[subs="+macros,attributes"] |
| 299 | +---- |
| 300 | +jreleaser { |
| 301 | + signing { |
| 302 | + active = 'ALWAYS' |
| 303 | + armored = true |
| 304 | + } |
| 305 | + deploy { |
| 306 | + maven { |
| 307 | + mavenCentral { |
| 308 | + 'release-deploy' { |
| 309 | + active = 'RELEASE' |
| 310 | + url = '{central_url}' |
| 311 | + stagingRepository('target/staging-deploy') |
| 312 | + } |
| 313 | + } |
| 314 | + nexus2 { |
| 315 | + 'snapshot-deploy' { |
| 316 | + active = 'SNAPSHOT' |
| 317 | + snapshotUrl = '{central_snapshot_url}' |
| 318 | + applyMavenCentralRules = true |
| 319 | + snapshotSupported = true |
| 320 | + closeRepository = true |
| 321 | + releaseRepository = true |
| 322 | + stagingRepository('target/staging-deploy') |
| 323 | + } |
| 324 | + } |
| 325 | + } |
| 326 | + } |
| 327 | +} |
| 328 | +---- |
| 329 | +-- |
| 330 | +==== |
| 331 | + |
153 | 332 | == OSSRH |
154 | 333 |
|
155 | 334 | Publishing to OSSRH requires using the xref:reference:deploy/maven/nexus2.adoc[] deployer. |
@@ -651,7 +830,7 @@ jreleaser { |
651 | 830 | sonatype { |
652 | 831 | active = 'ALWAYS' |
653 | 832 | url = '{central_url}' |
654 | | - stagingRepository('target/staging-deploy') |
| 833 | + stagingRepository('build/staging-deploy') |
655 | 834 | } |
656 | 835 | } |
657 | 836 | */ |
|
0 commit comments