blob: a4ccccfa9a151dac18dcb98f5e38505079a36b73 [file] [log] [blame]
Marian Harbachebeb1542019-12-13 10:42:46 +01001:linkattrs:
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08002= Deploy Gerrit Artifacts
Edwin Kempinbb8e6252012-07-31 14:30:35 +02003
David Ostrovsky520f29c2014-05-22 21:44:29 +02004[[deploy-configuration-setting-maven-central]]
5== Deploy Configuration settings for Maven Central
6
Edwin Kempin5cc204e2014-06-03 10:22:15 +02007Some Gerrit artifacts (e.g. the Gerrit WAR file, the Gerrit Plugin API
8and the Gerrit Extension API) are published on Maven Central in the
9`com.google.gerrit` repository.
David Ostrovsky520f29c2014-05-22 21:44:29 +020010
Edwin Kempin5cc204e2014-06-03 10:22:15 +020011To be able to publish artifacts to Maven Central some preparations must
12be done:
David Ostrovsky520f29c2014-05-22 21:44:29 +020013
David Pursehousee76ec912015-04-17 13:53:55 +090014* Create an account on
Marian Harbach34253372019-12-10 18:01:31 +010015link:https://issues.sonatype.org/secure/Signup!default.jspa[Sonatype's Jira,role=external,window=_blank].
Edwin Kempin5cc204e2014-06-03 10:22:15 +020016+
17Sonatype is the company that runs Maven Central and you need a Sonatype
David Pursehousee76ec912015-04-17 13:53:55 +090018account to be able to upload artifacts to Maven Central.
Edwin Kempin5cc204e2014-06-03 10:22:15 +020019
20* Configure your Sonatype user and password in `~/.m2/settings.xml`:
21+
David Ostrovsky520f29c2014-05-22 21:44:29 +020022----
23<server>
24 <id>sonatype-nexus-staging</id>
25 <username>USER</username>
26 <password>PASSWORD</password>
27</server>
28----
29
Edwin Kempin5cc204e2014-06-03 10:22:15 +020030* Request permissions to upload artifacts to the `com.google.gerrit`
31repository on Maven Central:
32+
33Ask for this permission by adding a comment on the
Marian Harbach34253372019-12-10 18:01:31 +010034link:https://issues.sonatype.org/browse/OSSRH-7392[OSSRH-7392,role=external,window=_blank] Jira
Edwin Kempin5cc204e2014-06-03 10:22:15 +020035ticket at Sonatype.
36+
37The request needs to be approved by someone who already has this
38permission by commenting on the same issue.
David Ostrovsky520f29c2014-05-22 21:44:29 +020039
Edwin Kempin5cc204e2014-06-03 10:22:15 +020040* Generate and publish a PGP key
41+
David Pursehouse0d7746b2017-06-30 13:26:44 +090042A PGP key is needed to be able to sign the release artifacts before
David Pursehouseb3f1deb2017-06-30 13:37:11 +090043the upload to Maven Central, and to sign the release announcement email.
David Pursehouse0d7746b2017-06-30 13:26:44 +090044+
Edwin Kempin5cc204e2014-06-03 10:22:15 +020045Generate and publish a PGP key as described in
Edwin Kempin126f8022014-10-02 10:22:58 +020046link:http://central.sonatype.org/pages/working-with-pgp-signatures.html[
Marian Harbach34253372019-12-10 18:01:31 +010047Working with PGP Signatures,role=external,window=_blank]. In addition to the keyserver mentioned
David Pursehouse0d7746b2017-06-30 13:26:44 +090048there it is recommended to also publish the key to the
49link:https://keyserver.ubuntu.com/[Ubuntu key server].
Edwin Kempin5cc204e2014-06-03 10:22:15 +020050+
51Please be aware that after publishing your public key it may take a
52while until it is visible to the Sonatype server.
53+
David Pursehouse0d7746b2017-06-30 13:26:44 +090054Add an entry for the public key in the
Marian Harbach34253372019-12-10 18:01:31 +010055link:https://gerrit.googlesource.com/homepage/+/md-pages/releases/public-keys.md[key list,role=external,window=_blank]
David Pursehouse0d7746b2017-06-30 13:26:44 +090056on the homepage.
Edwin Kempin5cc204e2014-06-03 10:22:15 +020057+
58The PGP passphrase can be put in `~/.m2/settings.xml`:
59+
David Ostrovsky520f29c2014-05-22 21:44:29 +020060----
61<settings>
62 <profiles>
63 <profile>
64 <id>gpg</id>
65 <properties>
66 <gpg.executable>gpg2</gpg.executable>
67 <gpg.passphrase>mypassphrase</gpg.passphrase>
68 </properties>
69 </profile>
70 </profiles>
71 <activeProfiles>
72 <activeProfile>gpg</activeProfile>
73 </activeProfiles>
74</settings>
75----
Edwin Kempin5cc204e2014-06-03 10:22:15 +020076+
David Ostrovsky520f29c2014-05-22 21:44:29 +020077It can also be included in the key chain on OS X.
78
Edwin Kempin5cc204e2014-06-03 10:22:15 +020079[[deploy-configuration-settings-xml]]
80== Deploy Configuration in Maven `settings.xml`
81
David Ostrovsky520f29c2014-05-22 21:44:29 +020082Gerrit Subproject Artifacts are stored on
Edwin Kempinbb8e6252012-07-31 14:30:35 +020083link:https://developers.google.com/storage/[Google Cloud Storage].
Marian Harbach34253372019-12-10 18:01:31 +010084Via the link:https://console.developers.google.com/project/164060093628[Developers Console,role=external,window=_blank] the
Edwin Kempinbb8e6252012-07-31 14:30:35 +020085Gerrit maintainers have access to the `Gerrit Code Review` project.
86This projects host several buckets for storing Gerrit artifacts:
87
88* `gerrit-api`:
89+
90Bucket to store the Gerrit Extension API Jar and the Gerrit Plugin API
91Jar.
92
93* `gerrit-maven`:
94+
Dave Borowitz8626f872019-04-19 14:34:36 -070095Bucket to store Gerrit Subproject Artifacts (e.g. Prolog Cafe).
Edwin Kempinbb8e6252012-07-31 14:30:35 +020096
Edwin Kempinbb8e6252012-07-31 14:30:35 +020097To upload artifacts to a bucket the user must authenticate with a
98username and password. The username and password need to be retrieved
David Pursehouseec0f2c82016-09-21 07:36:26 +020099from the link:https://console.cloud.google.com/storage/settings?project=api-project-164060093628[
Marian Harbach34253372019-12-10 18:01:31 +0100100Storage Setting in the Google Cloud Platform Console,role=external,window=_blank]:
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200101
David Pursehouseec0f2c82016-09-21 07:36:26 +0200102Select the `Interoperability` tab, and if no keys are listed under
103`Interoperable storage access keys`, select 'Create a new key'.
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200104
David Pursehouseec0f2c82016-09-21 07:36:26 +0200105Using `Access Key` as username and `Secret` as the password, add the
106configuration in the `~/.m2/settings.xml` file to make the credentials
107known to Maven:
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200108
109----
110 <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
111 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
112 xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
113 <servers>
114 <server>
115 <id>gerrit-api-repository</id>
116 <username>GOOG..EXAMPLE.....EXAMPLE</username>
117 <password>EXAMPLE..EXAMPLE..EXAMPLE</password>
118 </server>
119 <server>
120 <id>gerrit-maven-repository</id>
121 <username>GOOG..EXAMPLE.....EXAMPLE</username>
122 <password>EXAMPLE..EXAMPLE..EXAMPLE</password>
123 </server>
124 <server>
125 <id>gerrit-plugins-repository</id>
126 <username>GOOG..EXAMPLE.....EXAMPLE</username>
127 <password>EXAMPLE..EXAMPLE..EXAMPLE</password>
128 </server>
129 </servers>
130 </settings>
131----
132
133[[deploy-configuration-subprojects]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800134=== Gerrit Subprojects
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200135
136* You will need to have the following in the `pom.xml` to make it
137deployable to the `gerrit-maven` storage bucket:
138
139----
140 <distributionManagement>
141 <repository>
142 <id>gerrit-maven-repository</id>
143 <name>Gerrit Maven Repository</name>
Shawn Pearced5005002013-06-21 11:01:45 -0700144 <url>gs://gerrit-maven</url>
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200145 <uniqueVersion>true</uniqueVersion>
146 </repository>
147 </distributionManagement>
148----
149
Michael Ochmann8129ece2016-07-08 11:25:25 +0200150[NOTE]
David Pursehouseb8fbb8a2016-08-31 09:33:03 +0900151In case of JGit the `pom.xml` already contains a `distributionManagement`
152section. To deploy the artifacts to the `gerrit-maven` repository, replace
153the existing `distributionManagement` section with this snippet.
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200154
Saša Živkovf9ffc832016-02-18 13:18:53 +0100155* Add these two snippets to the `pom.xml` to enable the wagon provider:
156
157----
David Pursehousec2d124a2016-07-28 19:48:12 +0900158 <pluginRepositories>
159 <pluginRepository>
160 <id>gerrit-maven</id>
161 <url>https://gerrit-maven.commondatastorage.googleapis.com</url>
162 </pluginRepository>
163 </pluginRepositories>
Saša Živkovf9ffc832016-02-18 13:18:53 +0100164----
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200165
166----
167 <build>
168 <extensions>
169 <extension>
Shawn Pearced5005002013-06-21 11:01:45 -0700170 <groupId>com.googlesource.gerrit</groupId>
171 <artifactId>gs-maven-wagon</artifactId>
172 <version>3.3</version>
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200173 </extension>
174 </extensions>
175 </build>
176----
177
178
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200179GERRIT
180------
181Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -0700182
183SEARCHBOX
184---------