Release docs: Describe in more details how to publish to Maven Central
Change-Id: I69d335cbd6ba192b716782ed9379716c8a37861a
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
diff --git a/Documentation/dev-release.txt b/Documentation/dev-release.txt
index 1a382f1..bcb0b0f 100644
--- a/Documentation/dev-release.txt
+++ b/Documentation/dev-release.txt
@@ -164,31 +164,121 @@
** make sure you are signed in with your Gmail account
** manually upload the Gerrit WAR file by using the `Upload` button
+[[publish-to-maven-central]]
+==== Publish the Gerrit artifacts to Maven Central
+
+* Make sure you have done the
+link:dev-release-deploy-config.html#deploy-configuration-setting-maven-central[
+configuration] for deploying to Maven Central
+
+* Make sure that the version is updated in the `VERSION` file and in
+the `pom.xml` files as described in the link:#update-versions[Update
+Versions and Create Release Tag] section.
+
* Push the WAR to Maven Central:
+
----
buck build war_deploy
----
-[[extension-and-plugin-api]]
-==== Publish the Extension and Plugin API Jars
-
-* Make sure you have done the
-link:dev-release-deploy-config.html#deploy-configuration-setting-maven-central[
-configuration needed for deployment]
-
-* Push the Jars to Maven Central:
+* Push the plugin artifacts to Maven Central:
+
----
buck build api_deploy
----
-
-* Troubleshooting: to see the commands that are execured in Buck build process
-environment variable VERBOSE can be set:
++
+For troubleshooting, the environment variable `VERBOSE` can be set. This
+prints out the commands that are executed by the Buck build process:
+
----
VERBOSE=1 buck build api_deploy
----
++
+If no artifacts are uploaded, clean the `buck-out` folder and retry:
++
+----
+ rm -rf buck-out
+----
+
+* Push the plugin Maven archetypes to Maven Central:
++
+----
+ ./tools/plugin_archetype_deploy.sh
+----
+
+* To where the artifacts are uploaded depends on the `GERRIT_VERSION` in
+the `VERSION` file:
+
+** SNAPSHOT versions are directly uploaded into the Sonatype snapshots
+repository and no further action is needed:
++
+https://oss.sonatype.org/content/repositories/snapshots/com/google/gerrit/
+
+** Release versions are uploaded into a staging repository in the
+link:https://oss.sonatype.org/[Sonatype Nexus Server].
+
+* Verify the staging repository
++
+How to do this is described in the
+link:https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-8.a.1.ClosingaStagingRepository[
+Sonatype OSS Maven Repository Usage Guide].
+
+** Go to the link:https://oss.sonatype.org/[Sonatype Nexus Server] and
+sign in with your Sonatype credentials.
+
+** Click in the left navigation bar under `Build Promotion` on
+`Staging Repositories` and find the `comgooglegerrit-XXXX` staging
+repository.
+
+** Verify its content
++
+While the staging repository is open you can upload further content and
+also replace uploaded artifacts. If something is wrong with the staging
+repository you can drop it by selecting it and clicking on `Drop`.
+
+** Run Sonatype validations on the staging repository
++
+Select the staging repository and click on `Close`. This runs the
+Sonatype validations on the staging repository. The repository will
+only be closed if everything is OK. A closed repository cannot be
+modified anymore, but you may still drop it if you find any issues.
+
+** Test closed staging repository
++
+Once a repository is closed you can find the URL to it in the `Summary`
+section, e.g. https://oss.sonatype.org/content/repositories/comgooglegerrit-1029
++
+Use this URL for further testing of the artifacts in this repository,
+e.g. to try building a plugin against the plugin API in this repository
+update the version in the `pom.xml` and configure the repository:
++
+----
+ <repositories>
+ <repository>
+ <id>gerrit-staging-repository</id>
+ <url>https://oss.sonatype.org/content/repositories/comgooglegerrit-1029</url>
+ </repository>
+ </repositories>
+----
+
+* Release the staging repository
++
+How to release a staging repository is described in the
+link:https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-8.a.2.ReleasingaStagingRepository[
+Sonatype OSS Maven Repository Usage Guide].
++
+[WARNING]
+Releasing artifacts to Maven Central cannot be undone!
+
+** Find the closed staging repository in the
+link:https://oss.sonatype.org/[Sonatype Nexus Server], select it and
+click on `Release`.
+
+** It may take up to 2 hours until the artifacts appear on Maven
+Central:
++
+https://oss.sonatype.org/content/repositories/releases/com/google/gerrit/
+
[[push-stable]]
==== Push the Stable Branch
@@ -318,17 +408,6 @@
for review and get it merged.
-[[publish-plugins-archetypes-to-maven-central]]
-=== Publish plugin archetypes to Maven Central
-
-Make sure you have done the
-link:dev-release-deploy-config.html#deploy-configuration-setting-maven-central[
-configuration needed for deployment]
-
-----
- ./tools/plugin_archetype_deploy.sh
-----
-
[[merge-stable]]
=== Merge `stable` into `master`