|
1 | 1 | # Release Documentation
|
2 | 2 |
|
3 |
| -Here we describe all the ceremonial stuff necessary to publish a Java library to Maven Central. |
| 3 | +Here we describe all the ceremonial stuff necessary to publish a Java library to [Maven Central](https://central.sonatype.com/). |
| 4 | + |
| 5 | +## How to Perform a Release |
| 6 | + |
| 7 | +The release process consists of two main tasks: |
| 8 | + |
| 9 | +1. Build the release on GitHub |
| 10 | +2. Release the published artifacts on Maven Central. |
| 11 | + |
| 12 | +### Build the Release on GitHub |
| 13 | + |
| 14 | +1. Go to the [release page](https://github.com/secureCodeBox/defectdojo-client-java/releases) and click "Draft a new release". |
| 15 | +2. Create a tag for the release (e.g. "1.0.0", for testing you can add a pre-release identifier like "1.0.0-alpha"). |
| 16 | + 1. Click "Choose tag". |
| 17 | + 2. Type in tag name (e.g. "1.0.0"). |
| 18 | + 3. Click "Create new tag..." |
| 19 | +3. Click "Generate release notes" |
| 20 | +4. Select either |
| 21 | + - "Set as a pre-release" if you have a pre-release identifier in the version (e.g. "1.0.0-alpha"). |
| 22 | + - or else "Set as the latest release" |
| 23 | +5. Click "Publish release" |
| 24 | + |
| 25 | +### Release the published artifacts on Maven Central. |
| 26 | + |
| 27 | +Hint: You need to hit the "Refresh" button from time to ime, to see changes. |
| 28 | + |
| 29 | +1. Login to the [Nexus Repository Manager](https://oss.sonatype.org/). |
| 30 | +2. On the left site navigate to "Staging Repositories" |
| 31 | +3. You will see an entry for each unpublished release (usually there is only one):<br> |
| 32 | + |
| 33 | +4. Select the release (in the "Content" tab you can verify the files contained in the release):<br> |
| 34 | + |
| 35 | +5. Close the repository (this triggers the validation of [requirements][ossrh-requirements]):<br> |
| 36 | + |
| 37 | +6. You can see if all validation rules passed in the "Activity" tab:<br> |
| 38 | + |
| 39 | +7. Then either click "Release" or "Drop": |
| 40 | + - Release: This will publish and sync the artifact to Maven Central. (This can't be undone, there is no way to delete a published artifact!). After syncing the staging repo is dropped automatically. |
| 41 | + - Drop: Does not publish the artifact. Use this if something is broken and ypu want to publish a new release with the same version. |
| 42 | +8. After some time (see below) you can find it on Maven Central: <https://central.sonatype.com/artifact/io.securecodebox/defectdojo-client/> |
| 43 | + |
| 44 | +After the first release a [bot created the Maven Central sync][ossrh-jira-issue]: |
| 45 | + |
| 46 | +> Central sync is activated for io.securecodebox. After you successfully release, your component will be available to the public on Central https://repo1.maven.org/maven2/, typically within 30 minutes, though updates to https://search.maven.org can take up to four hours. |
4 | 47 |
|
5 | 48 | ## Credentials
|
6 | 49 |
|
@@ -103,3 +146,5 @@ gpg> save
|
103 | 146 | [user-token]: https://help.sonatype.com/iqserver/managing/user-management/user-tokens
|
104 | 147 | [pgp-signatures]: https://central.sonatype.org/publish/requirements/gpg/
|
105 | 148 | [pgp-best-practices]: https://riseup.net/ru/security/message-security/openpgp/gpg-best-practices
|
| 149 | +[ossrh-jira-issue]: https://issues.sonatype.org/browse/OSSRH-40107 |
| 150 | +[ossrh-requirements]: https://central.sonatype.org/publish/requirements/#supply-javadoc-and-sources |
0 commit comments