Revert "Simplify artifacts deployment to Maven Central"

This strategy generates a syntactically valid, barebones pom.xml like:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.google.gerrit</groupId>
  <artifactId>gerrit-extension-api</artifactId>
  <version>2.15-rc0</version>
  <packaging>javadoc</packaging>
</project>

But Nexus rejects this pom when closing the staging repository,
complaining about the lack of license/developer/etc.

This reverts commit 0ce2fdc1c2.

Change-Id: Idab2a82ddd81d60f0ca6eea44d80706e04262c6b
This commit is contained in:
Dave Borowitz 2017-10-01 16:17:42 -04:00
parent d52ccbcfc4
commit 9b87707248
8 changed files with 421 additions and 15 deletions

View File

@ -89,14 +89,22 @@ To create a Gerrit release the following steps have to be done:
. link:#merge-stable[Merge `stable` into `master`]
[[update-version]]
=== Update Version and Create Release Tag
[[update-versions]]
=== Update Versions and Create Release Tag
Before doing the release build, the `GERRIT_VERSION` in the `version.bzl`
file must be updated, e.g. change it from `2.5-SNAPSHOT` to `2.5`.
Commit the change in `version.bzl` and create a signed release tag on the
new commit:
In addition the version must be updated in a number of pom.xml files.
To do this run the `./tools/version.py` script and provide the new
version as parameter, e.g.:
----
./tools/version.py 2.5
----
Commit the changes and create a signed release tag on the new commit:
----
git tag -s -m "v2.5" v2.5
@ -139,8 +147,9 @@ Verify the versions:
link:dev-release-deploy-config.html#deploy-configuration-setting-maven-central[
configuration] for deploying to Maven Central
* Make sure that the version is updated in the `version.bzl` file as described
in the link:#update-version[Update Version and Create Release Tag] section.
* Make sure that the version is updated in the `version.bzl` file and in
the `pom.xml` files as described in the link:#update-versions[Update
Versions and Create Release Tag] section.
* Push the WAR to Maven Central:
+

View File

@ -0,0 +1,86 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.gerrit</groupId>
<artifactId>gerrit-acceptance-framework</artifactId>
<version>2.15-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Gerrit Code Review - Acceptance Test Framework</name>
<description>Framework for Gerrit's acceptance tests</description>
<url>https://www.gerritcodereview.com/</url>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>https://gerrit.googlesource.com/gerrit</url>
<connection>https://gerrit.googlesource.com/gerrit</connection>
</scm>
<developers>
<developer>
<name>Alice Kober-Sotzek</name>
</developer>
<developer>
<name>Andrew Bonventre</name>
</developer>
<developer>
<name>Becky Siegel</name>
</developer>
<developer>
<name>Dave Borowitz</name>
</developer>
<developer>
<name>David Ostrovsky</name>
</developer>
<developer>
<name>David Pursehouse</name>
</developer>
<developer>
<name>Edwin Kempin</name>
</developer>
<developer>
<name>Hugo Arès</name>
</developer>
<developer>
<name>Kasper Nilsson</name>
</developer>
<developer>
<name>Logan Hanks</name>
</developer>
<developer>
<name>Martin Fick</name>
</developer>
<developer>
<name>Saša Živkov</name>
</developer>
<developer>
<name>Shawn Pearce</name>
</developer>
<developer>
<name>Viktar Donich</name>
</developer>
<developer>
<name>Wyatt Allen</name>
</developer>
</developers>
<mailingLists>
<mailingList>
<name>Repo and Gerrit Discussion</name>
<post>repo-discuss@googlegroups.com</post>
<subscribe>https://groups.google.com/forum/#!forum/repo-discuss</subscribe>
<unsubscribe>https://groups.google.com/forum/#!forum/repo-discuss</unsubscribe>
<archive>https://groups.google.com/forum/#!forum/repo-discuss</archive>
</mailingList>
</mailingLists>
<issueManagement>
<url>https://bugs.chromium.org/p/gerrit/issues/list</url>
<system>Gerrit Issue Tracker</system>
</issueManagement>
</project>

View File

@ -1,8 +1,8 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.gerrit</groupId>
<artifactId>gerrit</artifactId>
<version>1</version> <!-- Do not edit; see version.bzl. -->
<artifactId>gerrit-extension-api</artifactId>
<version>2.15-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Gerrit Code Review - Extension API</name>
<description>API for Gerrit Extensions</description>

86
gerrit-plugin-api/pom.xml Normal file
View File

@ -0,0 +1,86 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.gerrit</groupId>
<artifactId>gerrit-plugin-api</artifactId>
<version>2.15-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Gerrit Code Review - Plugin API</name>
<description>API for Gerrit Plugins</description>
<url>https://www.gerritcodereview.com/</url>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>https://gerrit.googlesource.com/gerrit</url>
<connection>https://gerrit.googlesource.com/gerrit</connection>
</scm>
<developers>
<developer>
<name>Alice Kober-Sotzek</name>
</developer>
<developer>
<name>Andrew Bonventre</name>
</developer>
<developer>
<name>Becky Siegel</name>
</developer>
<developer>
<name>Dave Borowitz</name>
</developer>
<developer>
<name>David Ostrovsky</name>
</developer>
<developer>
<name>David Pursehouse</name>
</developer>
<developer>
<name>Edwin Kempin</name>
</developer>
<developer>
<name>Hugo Arès</name>
</developer>
<developer>
<name>Kasper Nilsson</name>
</developer>
<developer>
<name>Logan Hanks</name>
</developer>
<developer>
<name>Martin Fick</name>
</developer>
<developer>
<name>Saša Živkov</name>
</developer>
<developer>
<name>Shawn Pearce</name>
</developer>
<developer>
<name>Viktar Donich</name>
</developer>
<developer>
<name>Wyatt Allen</name>
</developer>
</developers>
<mailingLists>
<mailingList>
<name>Repo and Gerrit Discussion</name>
<post>repo-discuss@googlegroups.com</post>
<subscribe>https://groups.google.com/forum/#!forum/repo-discuss</subscribe>
<unsubscribe>https://groups.google.com/forum/#!forum/repo-discuss</unsubscribe>
<archive>https://groups.google.com/forum/#!forum/repo-discuss</archive>
</mailingList>
</mailingLists>
<issueManagement>
<url>https://bugs.chromium.org/p/gerrit/issues/list</url>
<system>Gerrit Issue Tracker</system>
</issueManagement>
</project>

View File

@ -0,0 +1,86 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.gerrit</groupId>
<artifactId>gerrit-plugin-gwtui</artifactId>
<version>2.15-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Gerrit Code Review - Plugin GWT UI</name>
<description>Common Classes for Gerrit GWT UI Plugins</description>
<url>https://www.gerritcodereview.com/</url>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>https://gerrit.googlesource.com/gerrit</url>
<connection>https://gerrit.googlesource.com/gerrit</connection>
</scm>
<developers>
<developer>
<name>Alice Kober-Sotzek</name>
</developer>
<developer>
<name>Andrew Bonventre</name>
</developer>
<developer>
<name>Becky Siegel</name>
</developer>
<developer>
<name>Dave Borowitz</name>
</developer>
<developer>
<name>David Ostrovsky</name>
</developer>
<developer>
<name>David Pursehouse</name>
</developer>
<developer>
<name>Edwin Kempin</name>
</developer>
<developer>
<name>Hugo Arès</name>
</developer>
<developer>
<name>Kasper Nilsson</name>
</developer>
<developer>
<name>Logan Hanks</name>
</developer>
<developer>
<name>Martin Fick</name>
</developer>
<developer>
<name>Saša Živkov</name>
</developer>
<developer>
<name>Shawn Pearce</name>
</developer>
<developer>
<name>Viktar Donich</name>
</developer>
<developer>
<name>Wyatt Allen</name>
</developer>
</developers>
<mailingLists>
<mailingList>
<name>Repo and Gerrit Discussion</name>
<post>repo-discuss@googlegroups.com</post>
<subscribe>https://groups.google.com/forum/#!forum/repo-discuss</subscribe>
<unsubscribe>https://groups.google.com/forum/#!forum/repo-discuss</unsubscribe>
<archive>https://groups.google.com/forum/#!forum/repo-discuss</archive>
</mailingList>
</mailingLists>
<issueManagement>
<url>https://bugs.chromium.org/p/gerrit/issues/list</url>
<system>Gerrit Issue Tracker</system>
</issueManagement>
</project>

86
gerrit-war/pom.xml Normal file
View File

@ -0,0 +1,86 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.google.gerrit</groupId>
<artifactId>gerrit-war</artifactId>
<version>2.15-SNAPSHOT</version>
<packaging>war</packaging>
<name>Gerrit Code Review - WAR</name>
<description>Gerrit WAR</description>
<url>https://www.gerritcodereview.com/</url>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>https://gerrit.googlesource.com/gerrit</url>
<connection>https://gerrit.googlesource.com/gerrit</connection>
</scm>
<developers>
<developer>
<name>Alice Kober-Sotzek</name>
</developer>
<developer>
<name>Andrew Bonventre</name>
</developer>
<developer>
<name>Becky Siegel</name>
</developer>
<developer>
<name>Dave Borowitz</name>
</developer>
<developer>
<name>David Ostrovsky</name>
</developer>
<developer>
<name>David Pursehouse</name>
</developer>
<developer>
<name>Edwin Kempin</name>
</developer>
<developer>
<name>Hugo Arès</name>
</developer>
<developer>
<name>Kasper Nilsson</name>
</developer>
<developer>
<name>Logan Hanks</name>
</developer>
<developer>
<name>Martin Fick</name>
</developer>
<developer>
<name>Saša Živkov</name>
</developer>
<developer>
<name>Shawn Pearce</name>
</developer>
<developer>
<name>Viktar Donich</name>
</developer>
<developer>
<name>Wyatt Allen</name>
</developer>
</developers>
<mailingLists>
<mailingList>
<name>Repo and Gerrit Discussion</name>
<post>repo-discuss@googlegroups.com</post>
<subscribe>https://groups.google.com/forum/#!forum/repo-discuss</subscribe>
<unsubscribe>https://groups.google.com/forum/#!forum/repo-discuss</unsubscribe>
<archive>https://groups.google.com/forum/#!forum/repo-discuss</archive>
</mailingList>
</mailingLists>
<issueManagement>
<url>https://bugs.chromium.org/p/gerrit/issues/list</url>
<system>Gerrit Issue Tracker</system>
</issueManagement>
</project>

View File

@ -19,10 +19,6 @@ from os import path, environ
from subprocess import check_output
from sys import stderr
def mvn():
return ['mvn', '--file', path.join(root, 'fake_pom.xml'), '-DgroupId=com.google.gerrit']
opts = OptionParser()
opts.add_option('--repository', help='maven repository id')
opts.add_option('--url', help='maven repository url')
@ -41,12 +37,14 @@ while not path.exists(path.join(root, 'WORKSPACE')):
root = path.dirname(root)
if 'install' == args.a:
cmd = mvn() + [
cmd = [
'mvn',
'install:install-file',
'-Dversion=%s' % args.v,
]
elif 'deploy' == args.a:
cmd = mvn() + [
cmd = [
'mvn',
'gpg:sign-and-deploy-file',
'-DrepositoryId=%s' % args.repository,
'-Durl=%s' % args.url,
@ -58,7 +56,7 @@ else:
for spec in args.s:
artifact, packaging_type, src = spec.split(':')
exe = cmd + [
'-DartifactId=%s' % artifact,
'-DpomFile=%s' % path.join(root, '%s/pom.xml' % artifact),
'-Dpackaging=%s' % packaging_type,
'-Dfile=%s' % src,
]

55
tools/version.py Executable file
View File

@ -0,0 +1,55 @@
#!/usr/bin/env python
# Copyright (C) 2014 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import print_function
from optparse import OptionParser
import os.path
import re
import sys
parser = OptionParser()
opts, args = parser.parse_args()
if not len(args):
parser.error('not enough arguments')
elif len(args) > 1:
parser.error('too many arguments')
DEST_PATTERN = r'\g<1>%s\g<3>' % args[0]
def replace_in_file(filename, src_pattern):
try:
f = open(filename, "r")
s = f.read()
f.close()
s = re.sub(src_pattern, DEST_PATTERN, s)
f = open(filename, "w")
f.write(s)
f.close()
except IOError as err:
print('error updating %s: %s' % (filename, err), file=sys.stderr)
src_pattern = re.compile(r'^(\s*<version>)([-.\w]+)(</version>\s*)$',
re.MULTILINE)
for project in ['gerrit-acceptance-framework', 'gerrit-extension-api',
'gerrit-plugin-api', 'gerrit-plugin-gwtui',
'gerrit-war']:
pom = os.path.join(project, 'pom.xml')
replace_in_file(pom, src_pattern)
src_pattern = re.compile(r'^(GERRIT_VERSION = ")([-.\w]+)(")$', re.MULTILINE)
replace_in_file('version.bzl', src_pattern)