Yuxuan 'fishy' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 1 | = Deploy Gerrit Artifacts |
Edwin Kempin | bb8e625 | 2012-07-31 14:30:35 +0200 | [diff] [blame] | 2 | |
David Ostrovsky | 520f29c | 2014-05-22 21:44:29 +0200 | [diff] [blame] | 3 | [[deploy-configuration-setting-maven-central]] |
| 4 | == Deploy Configuration settings for Maven Central |
| 5 | |
Edwin Kempin | 5cc204e | 2014-06-03 10:22:15 +0200 | [diff] [blame] | 6 | Some Gerrit artifacts (e.g. the Gerrit WAR file, the Gerrit Plugin API |
| 7 | and the Gerrit Extension API) are published on Maven Central in the |
| 8 | `com.google.gerrit` repository. |
David Ostrovsky | 520f29c | 2014-05-22 21:44:29 +0200 | [diff] [blame] | 9 | |
Edwin Kempin | 5cc204e | 2014-06-03 10:22:15 +0200 | [diff] [blame] | 10 | To be able to publish artifacts to Maven Central some preparations must |
| 11 | be done: |
David Ostrovsky | 520f29c | 2014-05-22 21:44:29 +0200 | [diff] [blame] | 12 | |
Edwin Kempin | 5cc204e | 2014-06-03 10:22:15 +0200 | [diff] [blame] | 13 | * Create a Sonatype account as described in the |
| 14 | link:https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-2.Signup[ |
| 15 | Sonatype OSS Maven Repository Usage Guide]. |
| 16 | + |
| 17 | Sonatype is the company that runs Maven Central and you need a Sonatype |
| 18 | account for uploading artifacts to Maven Central. |
| 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 |
| 34 | link:https://issues.sonatype.org/browse/OSSRH-7392[OSSRH-7392] Jira |
| 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 | + |
| 42 | Generate and publish a PGP key as described in |
| 43 | link:https://docs.sonatype.org/display/Repository/How+To+Generate+PGP+Signatures+With+Maven[ |
| 44 | How To Generate PGP Signatures With Maven]. |
| 45 | + |
| 46 | Please be aware that after publishing your public key it may take a |
| 47 | while until it is visible to the Sonatype server. |
| 48 | + |
| 49 | The PGP key is needed to be able to sign the artifacts before the |
| 50 | upload to Maven Central. |
| 51 | + |
| 52 | The PGP passphrase can be put in `~/.m2/settings.xml`: |
| 53 | + |
David Ostrovsky | 520f29c | 2014-05-22 21:44:29 +0200 | [diff] [blame] | 54 | ---- |
| 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 Kempin | 5cc204e | 2014-06-03 10:22:15 +0200 | [diff] [blame] | 70 | + |
David Ostrovsky | 520f29c | 2014-05-22 21:44:29 +0200 | [diff] [blame] | 71 | It can also be included in the key chain on OS X. |
| 72 | |
Edwin Kempin | 5cc204e | 2014-06-03 10:22:15 +0200 | [diff] [blame] | 73 | [[deploy-configuration-settings-xml]] |
| 74 | == Deploy Configuration in Maven `settings.xml` |
| 75 | |
David Ostrovsky | 520f29c | 2014-05-22 21:44:29 +0200 | [diff] [blame] | 76 | Gerrit Subproject Artifacts are stored on |
Edwin Kempin | bb8e625 | 2012-07-31 14:30:35 +0200 | [diff] [blame] | 77 | link:https://developers.google.com/storage/[Google Cloud Storage]. |
David Pursehouse | 63d6737 | 2013-12-04 17:21:41 +0900 | [diff] [blame] | 78 | Via the link:https://code.google.com/apis/console/?noredirect[API Console] the |
Edwin Kempin | bb8e625 | 2012-07-31 14:30:35 +0200 | [diff] [blame] | 79 | Gerrit maintainers have access to the `Gerrit Code Review` project. |
| 80 | This projects host several buckets for storing Gerrit artifacts: |
| 81 | |
| 82 | * `gerrit-api`: |
| 83 | + |
| 84 | Bucket to store the Gerrit Extension API Jar and the Gerrit Plugin API |
| 85 | Jar. |
| 86 | |
| 87 | * `gerrit-maven`: |
| 88 | + |
David Pursehouse | eeed4976 | 2013-04-12 17:13:51 +0900 | [diff] [blame] | 89 | Bucket to store Gerrit Subproject Artifacts (e.g. `gwtjsonrpc` etc.). |
Edwin Kempin | bb8e625 | 2012-07-31 14:30:35 +0200 | [diff] [blame] | 90 | |
Edwin Kempin | bb8e625 | 2012-07-31 14:30:35 +0200 | [diff] [blame] | 91 | To upload artifacts to a bucket the user must authenticate with a |
| 92 | username and password. The username and password need to be retrieved |
David Pursehouse | 63d6737 | 2013-12-04 17:21:41 +0900 | [diff] [blame] | 93 | from the link:https://code.google.com/apis/console/?noredirect[API Console]: |
Edwin Kempin | bb8e625 | 2012-07-31 14:30:35 +0200 | [diff] [blame] | 94 | |
| 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 | |
| 101 | To make the username and password known to Maven, they must be |
| 102 | configured 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' Wang | 61698b1 | 2013-12-20 12:55:51 -0800 | [diff] [blame] | 129 | === Gerrit Subprojects |
Edwin Kempin | bb8e625 | 2012-07-31 14:30:35 +0200 | [diff] [blame] | 130 | |
| 131 | * You will need to have the following in the `pom.xml` to make it |
| 132 | deployable 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 Pearce | d500500 | 2013-06-21 11:01:45 -0700 | [diff] [blame] | 139 | <url>gs://gerrit-maven</url> |
Edwin Kempin | bb8e625 | 2012-07-31 14:30:35 +0200 | [diff] [blame] | 140 | <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 Pearce | d500500 | 2013-06-21 11:01:45 -0700 | [diff] [blame] | 152 | <groupId>com.googlesource.gerrit</groupId> |
| 153 | <artifactId>gs-maven-wagon</artifactId> |
| 154 | <version>3.3</version> |
Edwin Kempin | bb8e625 | 2012-07-31 14:30:35 +0200 | [diff] [blame] | 155 | </extension> |
| 156 | </extensions> |
| 157 | </build> |
| 158 | ---- |
| 159 | |
| 160 | |
Edwin Kempin | bb8e625 | 2012-07-31 14:30:35 +0200 | [diff] [blame] | 161 | GERRIT |
| 162 | ------ |
| 163 | Part of link:index.html[Gerrit Code Review] |
Yuxuan 'fishy' Wang | 99cb68d | 2013-10-31 17:26:00 -0700 | [diff] [blame] | 164 | |
| 165 | SEARCHBOX |
| 166 | --------- |