blob: 364e61dde4ef3839d02931f15fdadf90ae789e97 [file] [log] [blame]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -08001= Deploy Gerrit Artifacts
Edwin Kempinbb8e6252012-07-31 14:30:35 +02002
David Ostrovsky520f29c2014-05-22 21:44:29 +02003[[deploy-configuration-setting-maven-central]]
4== Deploy Configuration settings for Maven Central
5
Edwin Kempin5cc204e2014-06-03 10:22:15 +02006Some Gerrit artifacts (e.g. the Gerrit WAR file, the Gerrit Plugin API
7and the Gerrit Extension API) are published on Maven Central in the
8`com.google.gerrit` repository.
David Ostrovsky520f29c2014-05-22 21:44:29 +02009
Edwin Kempin5cc204e2014-06-03 10:22:15 +020010To be able to publish artifacts to Maven Central some preparations must
11be done:
David Ostrovsky520f29c2014-05-22 21:44:29 +020012
Edwin Kempin5cc204e2014-06-03 10:22:15 +020013* Create a Sonatype account as described in the
14link:https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-2.Signup[
15Sonatype OSS Maven Repository Usage Guide].
16+
17Sonatype is the company that runs Maven Central and you need a Sonatype
18account for uploading artifacts to Maven Central.
19
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
34link:https://issues.sonatype.org/browse/OSSRH-7392[OSSRH-7392] Jira
35ticket 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+
42Generate and publish a PGP key as described in
43link:https://docs.sonatype.org/display/Repository/How+To+Generate+PGP+Signatures+With+Maven[
44How To Generate PGP Signatures With Maven].
45+
46Please be aware that after publishing your public key it may take a
47while until it is visible to the Sonatype server.
48+
49The PGP key is needed to be able to sign the artifacts before the
50upload to Maven Central.
51+
52The PGP passphrase can be put in `~/.m2/settings.xml`:
53+
David Ostrovsky520f29c2014-05-22 21:44:29 +020054----
55<settings>
56 <profiles>
57 <profile>
58 <id>gpg</id>
59 <properties>
60 <gpg.executable>gpg2</gpg.executable>
61 <gpg.passphrase>mypassphrase</gpg.passphrase>
62 </properties>
63 </profile>
64 </profiles>
65 <activeProfiles>
66 <activeProfile>gpg</activeProfile>
67 </activeProfiles>
68</settings>
69----
Edwin Kempin5cc204e2014-06-03 10:22:15 +020070+
David Ostrovsky520f29c2014-05-22 21:44:29 +020071It can also be included in the key chain on OS X.
72
Edwin Kempin5cc204e2014-06-03 10:22:15 +020073[[deploy-configuration-settings-xml]]
74== Deploy Configuration in Maven `settings.xml`
75
David Ostrovsky520f29c2014-05-22 21:44:29 +020076Gerrit Subproject Artifacts are stored on
Edwin Kempinbb8e6252012-07-31 14:30:35 +020077link:https://developers.google.com/storage/[Google Cloud Storage].
David Pursehouse63d67372013-12-04 17:21:41 +090078Via the link:https://code.google.com/apis/console/?noredirect[API Console] the
Edwin Kempinbb8e6252012-07-31 14:30:35 +020079Gerrit maintainers have access to the `Gerrit Code Review` project.
80This projects host several buckets for storing Gerrit artifacts:
81
82* `gerrit-api`:
83+
84Bucket to store the Gerrit Extension API Jar and the Gerrit Plugin API
85Jar.
86
87* `gerrit-maven`:
88+
David Pursehouseeeed49762013-04-12 17:13:51 +090089Bucket to store Gerrit Subproject Artifacts (e.g. `gwtjsonrpc` etc.).
Edwin Kempinbb8e6252012-07-31 14:30:35 +020090
Edwin Kempinbb8e6252012-07-31 14:30:35 +020091To upload artifacts to a bucket the user must authenticate with a
92username and password. The username and password need to be retrieved
David Pursehouse63d67372013-12-04 17:21:41 +090093from the link:https://code.google.com/apis/console/?noredirect[API Console]:
Edwin Kempinbb8e6252012-07-31 14:30:35 +020094
95* Go to the `Gerrit Code Review` project
96* In the menu on the left select `Google Cloud Storage` >
97`Interoperable Access`
98* Use the `Access Key` as username
99* Click under `Secret` on the `Show` button to find the password
100
101To make the username and password known to Maven, they must be
102configured in the `~/.m2/settings.xml` file.
103
104----
105 <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
106 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
107 xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
108 <servers>
109 <server>
110 <id>gerrit-api-repository</id>
111 <username>GOOG..EXAMPLE.....EXAMPLE</username>
112 <password>EXAMPLE..EXAMPLE..EXAMPLE</password>
113 </server>
114 <server>
115 <id>gerrit-maven-repository</id>
116 <username>GOOG..EXAMPLE.....EXAMPLE</username>
117 <password>EXAMPLE..EXAMPLE..EXAMPLE</password>
118 </server>
119 <server>
120 <id>gerrit-plugins-repository</id>
121 <username>GOOG..EXAMPLE.....EXAMPLE</username>
122 <password>EXAMPLE..EXAMPLE..EXAMPLE</password>
123 </server>
124 </servers>
125 </settings>
126----
127
128[[deploy-configuration-subprojects]]
Yuxuan 'fishy' Wang61698b12013-12-20 12:55:51 -0800129=== Gerrit Subprojects
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200130
131* You will need to have the following in the `pom.xml` to make it
132deployable to the `gerrit-maven` storage bucket:
133
134----
135 <distributionManagement>
136 <repository>
137 <id>gerrit-maven-repository</id>
138 <name>Gerrit Maven Repository</name>
Shawn Pearced5005002013-06-21 11:01:45 -0700139 <url>gs://gerrit-maven</url>
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200140 <uniqueVersion>true</uniqueVersion>
141 </repository>
142 </distributionManagement>
143----
144
145
146* Add this to the `pom.xml` to enable the wagon provider:
147
148----
149 <build>
150 <extensions>
151 <extension>
Shawn Pearced5005002013-06-21 11:01:45 -0700152 <groupId>com.googlesource.gerrit</groupId>
153 <artifactId>gs-maven-wagon</artifactId>
154 <version>3.3</version>
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200155 </extension>
156 </extensions>
157 </build>
158----
159
160
Edwin Kempinbb8e6252012-07-31 14:30:35 +0200161GERRIT
162------
163Part of link:index.html[Gerrit Code Review]
Yuxuan 'fishy' Wang99cb68d2013-10-31 17:26:00 -0700164
165SEARCHBOX
166---------