Skip to content

Commit 08b6b79

Browse files
committed
Prepare version 0.12.0
1 parent f7fb8f3 commit 08b6b79

File tree

6 files changed

+52
-21
lines changed

6 files changed

+52
-21
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@
99
A lightweight, handy Gradle plugin to deploy your maven packages (for example, Android AARs, Java JARs, Kotlin KLibs)
1010
to different kinds of repositories. It supports publishing to:
1111
- local directories, to use them as local maven repositories in other projects
12-
- Sonatype Nexus repositories, including [Sonatype OSSRH / Maven Central](https://central.sonatype.org/)
12+
- [Maven Central](https://central.sonatype.org/) repository via Sonatype's OSSRH
13+
- Other Sonatype Nexus repositories
1314
- [GitHub Packages](https://docs.github.com/en/packages)
1415

16+
> For Maven Central builds, the plugin takes care of releasing the artifacts using Sonatype REST APIs so you don't have to use their web UI.
17+
1518
```kotlin
1619
// settings.gradle.kts
1720
pluginManagement {
@@ -23,7 +26,7 @@ pluginManagement {
2326

2427
// build.gradle.kts of deployable modules
2528
plugins {
26-
id("io.deepmedia.tools.deployer") version "0.11.0"
29+
id("io.deepmedia.tools.deployer") version "0.12.0"
2730
}
2831
```
2932

deployer/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ gradlePlugin {
4646
}
4747

4848
group = "io.deepmedia.tools.deployer"
49-
version = "0.12.0-rc1" // on change, update both docs and README
49+
version = "0.12.0" // on change, update both docs and README
5050

5151
deployer {
5252
verbose = true

docs/index.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,9 @@ docs:
1313
`MavenDeployer` is a lightweight, handy Gradle plugin to deploy your maven packages (for example, Android AARs, Java JARs, Kotlin KLibs)
1414
to different kinds of repositories. It supports publishing to:
1515
- local directories, to use them as local maven repositories in other projects
16-
- Sonatype Nexus repositories, including [Sonatype OSSRH / Maven Central](https://central.sonatype.org/)
16+
- [Maven Central](https://central.sonatype.org/) repository via Sonatype's OSSRH
17+
- Other Sonatype Nexus repositories
1718
- [GitHub Packages](https://docs.github.com/en/packages)
19+
20+
> For Maven Central builds, the plugin takes care of releasing the artifacts using Sonatype REST APIs so you don't have to use their web UI.
21+

docs/install.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pluginManagement {
1919

2020
// build.gradle.kts of deployable modules
2121
plugins {
22-
id("io.deepmedia.tools.deployer") version "0.11.0"
22+
id("io.deepmedia.tools.deployer") version "0.12.0"
2323
}
2424
```
2525

docs/repos/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ exposed through subclasses of the `DeploySpec` type, so that, for example, a `lo
1414

1515
`MavenDeployer` supports publishing to:
1616
- local directories, to use them as local maven repositories in other projects [[docs](local)]
17-
- Sonatype Nexus repositories, including [Sonatype OSSRH / Maven Central](https://central.sonatype.org/) [[docs](sonatype)]
17+
- Sonatype Nexus repositories, with support for syncing to [Maven Central](https://central.sonatype.org/) [[docs](sonatype)]
1818
- [GitHub Packages](https://docs.github.com/en/packages) [[docs](github)]

docs/repos/sonatype.mdx

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,24 @@ title: Sonatype & Maven Central
44

55
# Sonatype & Maven Central
66

7-
Add a new spec with `sonatypeSpec {}`. It adds a mandatory property called `repositoryUrl`, which is the remote URL
8-
of the sonatype repo. This defaults to `https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/` -
9-
the Sonatype OSSRH which can be synced to Maven Central.
10-
11-
Sonatype repositories make many fields mandatory:
12-
- authentication: use the `auth` block as shown below
13-
- signing
14-
- valid project url and scm
15-
- at least one developer and a license
16-
- possibly more
17-
18-
Deployment will fail with clear errors notifying you about what's missing.
7+
Add a new spec with `sonatypeSpec {}` or `nexusSpec {}`. It adds a mandatory property called `repositoryUrl`, which is the remote URL
8+
of the sonatype repo. This defaults to `https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/`, one of the
9+
OSSRH urls that can be synced to Maven Central.
1910

2011
```kotlin
2112
deployer {
2213
// Common configuration...
2314
project.description.set("Handy tool to publish maven packages in different repositories.")
2415

2516
sonatypeSpec {
26-
// Sonatype configuration...
17+
// Target URL. You can use `ossrh`, `ossrh1`, `ossrhSnapshots`, `ossrhSnapshots1` or your own URL
2718
repositoryUrl.set(ossrh1)
2819

29-
// Credentials used to register the package group into the OSSRH repository...
20+
// For OSSRH projects, these are the credentials that were used to register the package group into OSSRH
3021
auth.user.set(secret("SONATYPE_USER"))
3122
auth.password.set(secret("SONATYPE_PASSWORD"))
3223

33-
// Signing is required
24+
// Note: signing is required for Maven Central sync
3425
signing.key.set(secret("SIGNING_KEY"))
3526
signing.password.set(secret("SIGNING_PASSWORD"))
3627
}
@@ -43,3 +34,36 @@ deployer {
4334
}
4435
}
4536
```
37+
38+
## Maven Central sync
39+
40+
Sonatype's OSSRH projects are allowed to sync artifacts with the [Maven Central](https://central.sonatype.org/) repository.
41+
The process is generally tricky, because you have to:
42+
43+
- Build maven packages with a very strict set of rules (for example, signing is mandatory)
44+
- Deploy them to `oss.sonatype.org/service/local/staging/deploy/maven2` or `s01.oss.sonatype.org/service/local/staging/deploy/maven2`
45+
- Access the web interface at `oss.sonatype.org` or `s01.oss.sonatype.org`
46+
- Login with your credentials
47+
- Find the staging repository corresponding to the upload, `Close` it and then `Release` it
48+
49+
Deployer streamlines the process so that only the first step is really your responsibility.
50+
First, enable maven central sync using `syncToMavenCentral`:
51+
52+
```kotlin
53+
sonatypeSpec {
54+
syncToMavenCentral = true
55+
56+
auth.user = secret("SONATYPE_USER")
57+
auth.password = secret("SONATYPE_PASSWORD")
58+
}
59+
```
60+
61+
Then simply run the deploy task. Deployer will:
62+
63+
- Validate your artifacts and POM file, to ensure they won't be rejected by the backend
64+
- Fail with clear errors if any issue is found
65+
- Use Sonatype's REST APIs to create a staging repository in your Sonatype account
66+
- Upload the artifacts
67+
- Use Sonatype's REST APIs to close and release the staging repository
68+
69+

0 commit comments

Comments
 (0)