c2d124a1b8
The setting currently documented does not work. Update it to the correct value, matching what was added in the core Gerrit pom.xml (which no longer exists since the migration to Buck) in Change I0fa4b97ae. Change-Id: Ia4ca720f83ec30154a8eb3e946a7041162b6d3d7
181 lines
5.2 KiB
Plaintext
181 lines
5.2 KiB
Plaintext
= Deploy Gerrit Artifacts
|
|
|
|
[[deploy-configuration-setting-maven-central]]
|
|
== Deploy Configuration settings for Maven Central
|
|
|
|
Some Gerrit artifacts (e.g. the Gerrit WAR file, the Gerrit Plugin API
|
|
and the Gerrit Extension API) are published on Maven Central in the
|
|
`com.google.gerrit` repository.
|
|
|
|
To be able to publish artifacts to Maven Central some preparations must
|
|
be done:
|
|
|
|
* Create an account on
|
|
link:https://issues.sonatype.org/secure/Signup!default.jspa[Sonatype's Jira].
|
|
+
|
|
Sonatype is the company that runs Maven Central and you need a Sonatype
|
|
account to be able to upload artifacts to Maven Central.
|
|
|
|
* Configure your Sonatype user and password in `~/.m2/settings.xml`:
|
|
+
|
|
----
|
|
<server>
|
|
<id>sonatype-nexus-staging</id>
|
|
<username>USER</username>
|
|
<password>PASSWORD</password>
|
|
</server>
|
|
----
|
|
|
|
* Request permissions to upload artifacts to the `com.google.gerrit`
|
|
repository on Maven Central:
|
|
+
|
|
Ask for this permission by adding a comment on the
|
|
link:https://issues.sonatype.org/browse/OSSRH-7392[OSSRH-7392] Jira
|
|
ticket at Sonatype.
|
|
+
|
|
The request needs to be approved by someone who already has this
|
|
permission by commenting on the same issue.
|
|
|
|
* Generate and publish a PGP key
|
|
+
|
|
Generate and publish a PGP key as described in
|
|
link:http://central.sonatype.org/pages/working-with-pgp-signatures.html[
|
|
Working with PGP Signatures].
|
|
+
|
|
Please be aware that after publishing your public key it may take a
|
|
while until it is visible to the Sonatype server.
|
|
+
|
|
The PGP key is needed to be able to sign the artifacts before the
|
|
upload to Maven Central.
|
|
+
|
|
The PGP passphrase can be put in `~/.m2/settings.xml`:
|
|
+
|
|
----
|
|
<settings>
|
|
<profiles>
|
|
<profile>
|
|
<id>gpg</id>
|
|
<properties>
|
|
<gpg.executable>gpg2</gpg.executable>
|
|
<gpg.passphrase>mypassphrase</gpg.passphrase>
|
|
</properties>
|
|
</profile>
|
|
</profiles>
|
|
<activeProfiles>
|
|
<activeProfile>gpg</activeProfile>
|
|
</activeProfiles>
|
|
</settings>
|
|
----
|
|
+
|
|
It can also be included in the key chain on OS X.
|
|
|
|
[[deploy-configuration-settings-xml]]
|
|
== Deploy Configuration in Maven `settings.xml`
|
|
|
|
Gerrit Subproject Artifacts are stored on
|
|
link:https://developers.google.com/storage/[Google Cloud Storage].
|
|
Via the link:https://console.developers.google.com/project/164060093628[Developers Console] the
|
|
Gerrit maintainers have access to the `Gerrit Code Review` project.
|
|
This projects host several buckets for storing Gerrit artifacts:
|
|
|
|
* `gerrit-api`:
|
|
+
|
|
Bucket to store the Gerrit Extension API Jar and the Gerrit Plugin API
|
|
Jar.
|
|
|
|
* `gerrit-maven`:
|
|
+
|
|
Bucket to store Gerrit Subproject Artifacts (e.g. `gwtjsonrpc` etc.).
|
|
|
|
To upload artifacts to a bucket the user must authenticate with a
|
|
username and password. The username and password need to be retrieved
|
|
from the link:https://console.developers.google.com/project/164060093628[
|
|
Google Developers Console]:
|
|
|
|
* In the menu on the left select `Storage` -> `Cloud Storage` >
|
|
> `Storage access`
|
|
* Select the `Interoperability` tab
|
|
* If no keys are listed under `Interoperable storage access keys`, select "Create a new key"
|
|
* Use the `Access Key` as username, and `Secret` as the password
|
|
|
|
To make the username and password known to Maven, they must be
|
|
configured in the `~/.m2/settings.xml` file.
|
|
|
|
----
|
|
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
|
|
<servers>
|
|
<server>
|
|
<id>gerrit-api-repository</id>
|
|
<username>GOOG..EXAMPLE.....EXAMPLE</username>
|
|
<password>EXAMPLE..EXAMPLE..EXAMPLE</password>
|
|
</server>
|
|
<server>
|
|
<id>gerrit-maven-repository</id>
|
|
<username>GOOG..EXAMPLE.....EXAMPLE</username>
|
|
<password>EXAMPLE..EXAMPLE..EXAMPLE</password>
|
|
</server>
|
|
<server>
|
|
<id>gerrit-plugins-repository</id>
|
|
<username>GOOG..EXAMPLE.....EXAMPLE</username>
|
|
<password>EXAMPLE..EXAMPLE..EXAMPLE</password>
|
|
</server>
|
|
</servers>
|
|
</settings>
|
|
----
|
|
|
|
[[deploy-configuration-subprojects]]
|
|
=== Gerrit Subprojects
|
|
|
|
* You will need to have the following in the `pom.xml` to make it
|
|
deployable to the `gerrit-maven` storage bucket:
|
|
|
|
----
|
|
<distributionManagement>
|
|
<repository>
|
|
<id>gerrit-maven-repository</id>
|
|
<name>Gerrit Maven Repository</name>
|
|
<url>gs://gerrit-maven</url>
|
|
<uniqueVersion>true</uniqueVersion>
|
|
</repository>
|
|
</distributionManagement>
|
|
----
|
|
|
|
[NOTE]
|
|
In case of JGit the `pom.xml` already contains a distributionManagement
|
|
section. Replace the existing distributionManagement section with this snippet
|
|
in order to deploy the artifacts only in the gerrit-maven repository.
|
|
|
|
|
|
* Add these two snippets to the `pom.xml` to enable the wagon provider:
|
|
|
|
----
|
|
<pluginRepositories>
|
|
<pluginRepository>
|
|
<id>gerrit-maven</id>
|
|
<url>https://gerrit-maven.commondatastorage.googleapis.com</url>
|
|
</pluginRepository>
|
|
</pluginRepositories>
|
|
----
|
|
|
|
----
|
|
<build>
|
|
<extensions>
|
|
<extension>
|
|
<groupId>com.googlesource.gerrit</groupId>
|
|
<artifactId>gs-maven-wagon</artifactId>
|
|
<version>3.3</version>
|
|
</extension>
|
|
</extensions>
|
|
</build>
|
|
----
|
|
|
|
|
|
GERRIT
|
|
------
|
|
Part of link:index.html[Gerrit Code Review]
|
|
|
|
SEARCHBOX
|
|
---------
|