Marian Harbach | ebeb154 | 2019-12-13 10:42:46 +0100 | [diff] [blame] | 1 | :linkattrs: |
Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 2 | = Deploy Gerrit Artifacts |
Edwin Kempin | bb8e625 | 2012-07-31 14:30:35 +0200 | [diff] [blame] | 3 | |
David Ostrovsky | 520f29c | 2014-05-22 21:44:29 +0200 | [diff] [blame] | 4 | [[deploy-configuration-setting-maven-central]] |
| 5 | == Deploy Configuration settings for Maven Central |
| 6 | |
Edwin Kempin | 5cc204e | 2014-06-03 10:22:15 +0200 | [diff] [blame] | 7 | Some Gerrit artifacts (e.g. the Gerrit WAR file, the Gerrit Plugin API |
| 8 | and the Gerrit Extension API) are published on Maven Central in the |
| 9 | `com.google.gerrit` repository. |
David Ostrovsky | 520f29c | 2014-05-22 21:44:29 +0200 | [diff] [blame] | 10 | |
Edwin Kempin | 5cc204e | 2014-06-03 10:22:15 +0200 | [diff] [blame] | 11 | To be able to publish artifacts to Maven Central some preparations must |
| 12 | be done: |
David Ostrovsky | 520f29c | 2014-05-22 21:44:29 +0200 | [diff] [blame] | 13 | |
David Pursehouse | e76ec91 | 2015-04-17 13:53:55 +0900 | [diff] [blame] | 14 | * Create an account on |
Marian Harbach | 3425337 | 2019-12-10 18:01:31 +0100 | [diff] [blame] | 15 | link:https://issues.sonatype.org/secure/Signup!default.jspa[Sonatype's Jira,role=external,window=_blank]. |
Edwin Kempin | 5cc204e | 2014-06-03 10:22:15 +0200 | [diff] [blame] | 16 | + |
| 17 | Sonatype is the company that runs Maven Central and you need a Sonatype |
David Pursehouse | e76ec91 | 2015-04-17 13:53:55 +0900 | [diff] [blame] | 18 | account to be able to upload artifacts to Maven Central. |
Edwin Kempin | 5cc204e | 2014-06-03 10:22:15 +0200 | [diff] [blame] | 19 | |
| 20 | * Configure your Sonatype user and password in `~/.m2/settings.xml`: |
| 21 | + |
David Ostrovsky | 520f29c | 2014-05-22 21:44:29 +0200 | [diff] [blame] | 22 | ---- |
| 23 | <server> |
| 24 | <id>sonatype-nexus-staging</id> |
| 25 | <username>USER</username> |
| 26 | <password>PASSWORD</password> |
| 27 | </server> |
| 28 | ---- |
| 29 | |
Edwin Kempin | 5cc204e | 2014-06-03 10:22:15 +0200 | [diff] [blame] | 30 | * Request permissions to upload artifacts to the `com.google.gerrit` |
| 31 | repository on Maven Central: |
| 32 | + |
| 33 | Ask for this permission by adding a comment on the |
Marian Harbach | 3425337 | 2019-12-10 18:01:31 +0100 | [diff] [blame] | 34 | link:https://issues.sonatype.org/browse/OSSRH-7392[OSSRH-7392,role=external,window=_blank] Jira |
Edwin Kempin | 5cc204e | 2014-06-03 10:22:15 +0200 | [diff] [blame] | 35 | ticket at Sonatype. |
| 36 | + |
| 37 | The request needs to be approved by someone who already has this |
| 38 | permission by commenting on the same issue. |
David Ostrovsky | 520f29c | 2014-05-22 21:44:29 +0200 | [diff] [blame] | 39 | |
Edwin Kempin | 5cc204e | 2014-06-03 10:22:15 +0200 | [diff] [blame] | 40 | * Generate and publish a PGP key |
| 41 | + |
David Pursehouse | 0d7746b | 2017-06-30 13:26:44 +0900 | [diff] [blame] | 42 | A PGP key is needed to be able to sign the release artifacts before |
David Pursehouse | b3f1deb | 2017-06-30 13:37:11 +0900 | [diff] [blame] | 43 | the upload to Maven Central, and to sign the release announcement email. |
David Pursehouse | 0d7746b | 2017-06-30 13:26:44 +0900 | [diff] [blame] | 44 | + |
Edwin Kempin | 5cc204e | 2014-06-03 10:22:15 +0200 | [diff] [blame] | 45 | Generate and publish a PGP key as described in |
Edwin Kempin | 126f802 | 2014-10-02 10:22:58 +0200 | [diff] [blame] | 46 | link:http://central.sonatype.org/pages/working-with-pgp-signatures.html[ |
Marian Harbach | 3425337 | 2019-12-10 18:01:31 +0100 | [diff] [blame] | 47 | Working with PGP Signatures,role=external,window=_blank]. In addition to the keyserver mentioned |
David Pursehouse | 0d7746b | 2017-06-30 13:26:44 +0900 | [diff] [blame] | 48 | there it is recommended to also publish the key to the |
| 49 | link:https://keyserver.ubuntu.com/[Ubuntu key server]. |
Edwin Kempin | 5cc204e | 2014-06-03 10:22:15 +0200 | [diff] [blame] | 50 | + |
| 51 | Please be aware that after publishing your public key it may take a |
| 52 | while until it is visible to the Sonatype server. |
| 53 | + |
David Pursehouse | 0d7746b | 2017-06-30 13:26:44 +0900 | [diff] [blame] | 54 | Add an entry for the public key in the |
Marian Harbach | 3425337 | 2019-12-10 18:01:31 +0100 | [diff] [blame] | 55 | link:https://gerrit.googlesource.com/homepage/+/md-pages/releases/public-keys.md[key list,role=external,window=_blank] |
David Pursehouse | 0d7746b | 2017-06-30 13:26:44 +0900 | [diff] [blame] | 56 | on the homepage. |
Edwin Kempin | 5cc204e | 2014-06-03 10:22:15 +0200 | [diff] [blame] | 57 | + |
| 58 | The PGP passphrase can be put in `~/.m2/settings.xml`: |
| 59 | + |
David Ostrovsky | 520f29c | 2014-05-22 21:44:29 +0200 | [diff] [blame] | 60 | ---- |
| 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 Kempin | 5cc204e | 2014-06-03 10:22:15 +0200 | [diff] [blame] | 76 | + |
David Ostrovsky | 520f29c | 2014-05-22 21:44:29 +0200 | [diff] [blame] | 77 | It can also be included in the key chain on OS X. |
| 78 | |
Edwin Kempin | 5cc204e | 2014-06-03 10:22:15 +0200 | [diff] [blame] | 79 | [[deploy-configuration-settings-xml]] |
| 80 | == Deploy Configuration in Maven `settings.xml` |
| 81 | |
David Ostrovsky | 520f29c | 2014-05-22 21:44:29 +0200 | [diff] [blame] | 82 | Gerrit Subproject Artifacts are stored on |
Edwin Kempin | bb8e625 | 2012-07-31 14:30:35 +0200 | [diff] [blame] | 83 | link:https://developers.google.com/storage/[Google Cloud Storage]. |
Marian Harbach | 3425337 | 2019-12-10 18:01:31 +0100 | [diff] [blame] | 84 | Via the link:https://console.developers.google.com/project/164060093628[Developers Console,role=external,window=_blank] the |
Edwin Kempin | bb8e625 | 2012-07-31 14:30:35 +0200 | [diff] [blame] | 85 | Gerrit maintainers have access to the `Gerrit Code Review` project. |
| 86 | This projects host several buckets for storing Gerrit artifacts: |
| 87 | |
| 88 | * `gerrit-api`: |
| 89 | + |
| 90 | Bucket to store the Gerrit Extension API Jar and the Gerrit Plugin API |
| 91 | Jar. |
| 92 | |
| 93 | * `gerrit-maven`: |
| 94 | + |
Dave Borowitz | 8626f87 | 2019-04-19 14:34:36 -0700 | [diff] [blame] | 95 | Bucket to store Gerrit Subproject Artifacts (e.g. Prolog Cafe). |
Edwin Kempin | bb8e625 | 2012-07-31 14:30:35 +0200 | [diff] [blame] | 96 | |
Edwin Kempin | bb8e625 | 2012-07-31 14:30:35 +0200 | [diff] [blame] | 97 | To upload artifacts to a bucket the user must authenticate with a |
| 98 | username and password. The username and password need to be retrieved |
David Pursehouse | ec0f2c8 | 2016-09-21 07:36:26 +0200 | [diff] [blame] | 99 | from the link:https://console.cloud.google.com/storage/settings?project=api-project-164060093628[ |
Marian Harbach | 3425337 | 2019-12-10 18:01:31 +0100 | [diff] [blame] | 100 | Storage Setting in the Google Cloud Platform Console,role=external,window=_blank]: |
Edwin Kempin | bb8e625 | 2012-07-31 14:30:35 +0200 | [diff] [blame] | 101 | |
David Pursehouse | ec0f2c8 | 2016-09-21 07:36:26 +0200 | [diff] [blame] | 102 | Select the `Interoperability` tab, and if no keys are listed under |
| 103 | `Interoperable storage access keys`, select 'Create a new key'. |
Edwin Kempin | bb8e625 | 2012-07-31 14:30:35 +0200 | [diff] [blame] | 104 | |
David Pursehouse | ec0f2c8 | 2016-09-21 07:36:26 +0200 | [diff] [blame] | 105 | Using `Access Key` as username and `Secret` as the password, add the |
| 106 | configuration in the `~/.m2/settings.xml` file to make the credentials |
| 107 | known to Maven: |
Edwin Kempin | bb8e625 | 2012-07-31 14:30:35 +0200 | [diff] [blame] | 108 | |
| 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' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 134 | === Gerrit Subprojects |
Edwin Kempin | bb8e625 | 2012-07-31 14:30:35 +0200 | [diff] [blame] | 135 | |
| 136 | * You will need to have the following in the `pom.xml` to make it |
| 137 | deployable 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 Pearce | d500500 | 2013-06-21 11:01:45 -0700 | [diff] [blame] | 144 | <url>gs://gerrit-maven</url> |
Edwin Kempin | bb8e625 | 2012-07-31 14:30:35 +0200 | [diff] [blame] | 145 | <uniqueVersion>true</uniqueVersion> |
| 146 | </repository> |
| 147 | </distributionManagement> |
| 148 | ---- |
| 149 | |
Michael Ochmann | 8129ece | 2016-07-08 11:25:25 +0200 | [diff] [blame] | 150 | [NOTE] |
David Pursehouse | b8fbb8a | 2016-08-31 09:33:03 +0900 | [diff] [blame] | 151 | In case of JGit the `pom.xml` already contains a `distributionManagement` |
| 152 | section. To deploy the artifacts to the `gerrit-maven` repository, replace |
| 153 | the existing `distributionManagement` section with this snippet. |
Edwin Kempin | bb8e625 | 2012-07-31 14:30:35 +0200 | [diff] [blame] | 154 | |
Saša Živkov | f9ffc83 | 2016-02-18 13:18:53 +0100 | [diff] [blame] | 155 | * Add these two snippets to the `pom.xml` to enable the wagon provider: |
| 156 | |
| 157 | ---- |
David Pursehouse | c2d124a | 2016-07-28 19:48:12 +0900 | [diff] [blame] | 158 | <pluginRepositories> |
| 159 | <pluginRepository> |
| 160 | <id>gerrit-maven</id> |
| 161 | <url>https://gerrit-maven.commondatastorage.googleapis.com</url> |
| 162 | </pluginRepository> |
| 163 | </pluginRepositories> |
Saša Živkov | f9ffc83 | 2016-02-18 13:18:53 +0100 | [diff] [blame] | 164 | ---- |
Edwin Kempin | bb8e625 | 2012-07-31 14:30:35 +0200 | [diff] [blame] | 165 | |
| 166 | ---- |
| 167 | <build> |
| 168 | <extensions> |
| 169 | <extension> |
Shawn Pearce | d500500 | 2013-06-21 11:01:45 -0700 | [diff] [blame] | 170 | <groupId>com.googlesource.gerrit</groupId> |
| 171 | <artifactId>gs-maven-wagon</artifactId> |
| 172 | <version>3.3</version> |
Edwin Kempin | bb8e625 | 2012-07-31 14:30:35 +0200 | [diff] [blame] | 173 | </extension> |
| 174 | </extensions> |
| 175 | </build> |
| 176 | ---- |
| 177 | |
| 178 | |
Edwin Kempin | bb8e625 | 2012-07-31 14:30:35 +0200 | [diff] [blame] | 179 | GERRIT |
| 180 | ------ |
| 181 | Part of link:index.html[Gerrit Code Review] |
Yuxuan 'fishy' Wang | 99cb68d | 2013-10-31 17:26:00 -0700 | [diff] [blame] | 182 | |
| 183 | SEARCHBOX |
| 184 | --------- |