Skip to content

Commit 2afa4e6

Browse files
committed
Update README
1 parent 0d6f2a8 commit 2afa4e6

File tree

1 file changed

+35
-7
lines changed

1 file changed

+35
-7
lines changed

README.md

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ what, plus you are forced to use their (possibly closed source) plugins in your
2222
This tool aim is to help you manage your build artifacts by publishing them to these repositories, but without the
2323
hassle of requiring to mutilate your own build (POMs).
2424

25-
## To use it
25+
## Setting it up
2626

27-
With Maven 3 create project-wide, or with Maven 4-rc-3+ create user-wide `~/.m2/extensions.xml` like this:
27+
With Maven 3 create project-wide, or with Maven 4+ create user-wide `~/.m2/extensions.xml` like this:
2828
```xml
2929
<?xml version="1.0" encoding="UTF-8"?>
3030
<extensions>
@@ -44,14 +44,42 @@ It is recommended (but not mandatory) to add this stanza to your `settings.xml`
4444
</pluginGroups>
4545
```
4646

47-
That's all! No project change needed at all. Next, let's see an example of Apache Maven project (I used `maven-gpg-plugin`):
47+
Next, set up authentication. Different publishers require different server, for example `sonatype-cp` publisher
48+
needs following stanza in your `settings.xml`:
4849

49-
1. For example’s sake, I took last release of plugin: `git checkout maven-gpg-plugin-3.2.7`
50+
```xml
51+
<server>
52+
<id>sonatype-cp</id>
53+
<username>USER_TOKEN_PT1</username>
54+
<password>USER_TOKEN_PT2</password>
55+
</server>
56+
```
57+
58+
Supported publishers and corresponding `server.id`s are:
59+
60+
| Publisher (publisher ID) | server.id | What is needed |
61+
|----------------------------------------------------------------|-------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|
62+
| Sonatype Central Portal (`sonatype-cp`) | `sonatype-cp` | Obtain tokens for publishing by following [this documentation](https://central.sonatype.org/publish/generate-portal-token/). |
63+
| Sonatype OSS on https://oss.sonatype.org/ (`sonatype-oss`) | `sonatype-oss` | Obtain tokens for publishing by following [this documentation](https://central.sonatype.org/publish/generate-token/) and using OSS instance. |
64+
| Sonatype S01 on https://s01.oss.sonatype.org/ (`sonatype-s01`) | `sonatype-s01` | As above but using s01 instance. |
65+
| Apache RAO on (`apache-rao`) | `apache.releases.https` | As above but using RAO instance. |
66+
67+
Make sure your `settings.xml` contains token associated with proper `server.id` corresponding to you publishing service you want to use.
68+
69+
That's all! No project change needed at all.
70+
71+
## Using it
72+
73+
Next, let's see an example of Apache Maven project (I used `maven-gpg-plugin`):
74+
75+
1. For example’s sake, I took last release of plugin (hence am simulating release deploy): `git checkout maven-gpg-plugin-3.2.7`
5076
2. Deploy it (locally stage): `mvn -P apache-release deploy -DaltDeploymentRepository=id::njord:` (The `id` is really unused, is there just to fulfil deploy plugin syntax requirement. The URL `njord:` will use "default" store template that is RELEASE. You can target other templates by using, and is equivalent of this `njord:release`. You can stage locally snapshots as well with URL `njord:snapshot`. Finally, you can target existing store with `njord:store:storename-xxx`).
5177
3. Check staged store names: `mvn njord:list`
52-
4. Check locally staged content: `mvn njord:list-content -Dstore=release-xxx` (use store name from above)
53-
5. Publish it to `repository.apache.org`: `mvn njord:publish -Dstore=release-xxx -Dtarget=apache-rao` (use store name from above)
54-
6. From now on, the repository is staged on RAO, so you can close it, vote, and all the usual fluff
78+
4. Optionally, check locally staged content: `mvn njord:list-content -Dstore=release-xxx` (use store name from above)
79+
5. Optionally, validate locally staged content: `mvn njord:validate -Ddetails -Dstore=release-xxx` (use store name from above)
80+
6. Publish it to ASF: `mvn njord:publish -Dstore=release-xxx -Dtarget=apache-rao` (use store name from above)
81+
7. From now on, the repository is staged on RAO, so you can close it, vote, and all the usual fluff as before.
82+
8. Drop locally staged store: `mvn njord:drop -Dstor=release-xxx` (use store name from above)
5583

5684
Build requirements:
5785
* Java 21

0 commit comments

Comments
 (0)