diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg new file mode 100644 index 000000000..4377eeb04 --- /dev/null +++ b/.kokoro/release/common.cfg @@ -0,0 +1,56 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "google-http-java-client/.kokoro/trampoline.sh" + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/java8" +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-keyring" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-passphrase" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "maven-gpg-pubkeyring" + } + } +} + +before_action { + fetch_keystore { + keystore_resource { + keystore_config_id: 70247 + keyname: "sonatype-credentials" + } + } +} diff --git a/.kokoro/release/common.sh b/.kokoro/release/common.sh new file mode 100644 index 000000000..f7d538b3a --- /dev/null +++ b/.kokoro/release/common.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# 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. + +set -eo pipefail + +# Get secrets from keystore and set and environment variables +setup_environment_secrets() { + export GPG_PASSPHRASE=$(cat ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-passphrase) + export GPG_TTY=$(tty) + export GPG_HOMEDIR=/gpg + mkdir $GPG_HOMEDIR + mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-pubkeyring $GPG_HOMEDIR/pubring.gpg + mv ${KOKORO_KEYSTORE_DIR}/70247_maven-gpg-keyring $GPG_HOMEDIR/secring.gpg + export SONATYPE_USERNAME=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f1 -d'|') + export SONATYPE_PASSWORD=$(cat ${KOKORO_KEYSTORE_DIR}/70247_sonatype-credentials | cut -f2 -d'|') +} + +create_settings_xml_file() { + echo " + + + ossrh + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + + sonatype-nexus-staging + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + + sonatype-nexus-snapshots + ${SONATYPE_USERNAME} + ${SONATYPE_PASSWORD} + + +" > $1 +} diff --git a/.kokoro/release/drop.cfg b/.kokoro/release/drop.cfg new file mode 100644 index 000000000..278e44d75 --- /dev/null +++ b/.kokoro/release/drop.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/google-http-java-client/.kokoro/release/drop.sh" +} diff --git a/.kokoro/release/drop.sh b/.kokoro/release/drop.sh new file mode 100755 index 000000000..abc381e5d --- /dev/null +++ b/.kokoro/release/drop.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# 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. + +set -eo pipefail + +source $(dirname "$0")/common.sh + +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn nexus-staging:drop --settings=settings.xml diff --git a/.kokoro/release/promote.cfg b/.kokoro/release/promote.cfg new file mode 100644 index 000000000..e6d8b8fdf --- /dev/null +++ b/.kokoro/release/promote.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/google-http-java-client/.kokoro/release/promote.sh" +} diff --git a/.kokoro/release/promote.sh b/.kokoro/release/promote.sh new file mode 100755 index 000000000..439e0fc3e --- /dev/null +++ b/.kokoro/release/promote.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# 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. + +set -eo pipefail + +source $(dirname "$0")/common.sh + +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn nexus-staging:release -DperformRelease=true --settings=settings.xml diff --git a/.kokoro/release/stage.cfg b/.kokoro/release/stage.cfg new file mode 100644 index 000000000..c49930316 --- /dev/null +++ b/.kokoro/release/stage.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Tell the trampoline which build file to use. +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/google-http-java-client/.kokoro/release/stage.sh" +} diff --git a/.kokoro/release/stage.sh b/.kokoro/release/stage.sh new file mode 100755 index 000000000..02809c918 --- /dev/null +++ b/.kokoro/release/stage.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# Copyright 2018 Google Inc. +# +# 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. + +set -eo pipefail + +source $(dirname "$0")/common.sh + +pushd $(dirname "$0")/../../ + +setup_environment_secrets +create_settings_xml_file "settings.xml" + +mvn clean install deploy \ + --settings settings.xml \ + -DperformRelease=true \ + -Dgpg.executable=gpg \ + -Dgpg.passphrase=${GPG_PASSPHRASE} \ + -Dgpg.homedir=${GPG_HOMEDIR} + + diff --git a/google-http-client-android/pom.xml b/google-http-client-android/pom.xml index 1fe20fca3..eaead49c1 100644 --- a/google-http-client-android/pom.xml +++ b/google-http-client-android/pom.xml @@ -16,7 +16,7 @@ maven-javadoc-plugin - http://download.oracle.com/javase/1.5.0/docs/api/ + http://download.oracle.com/javase/6/docs/api/ ${project.name} ${project.version} ${project.artifactId} ${project.version} diff --git a/google-http-client-gson/pom.xml b/google-http-client-gson/pom.xml index 429458339..6f1321a8a 100644 --- a/google-http-client-gson/pom.xml +++ b/google-http-client-gson/pom.xml @@ -16,8 +16,8 @@ maven-javadoc-plugin - http://download.oracle.com/javase/1.5.0/docs/api/ - http://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs + http://download.oracle.com/javase/6/docs/api/ + https://www.javadoc.io/doc/com.google.code.gson/gson/${project.gson.version} ${project.name} ${project.version} ${project.artifactId} ${project.version} diff --git a/google-http-client-jackson/pom.xml b/google-http-client-jackson/pom.xml index 4cef10787..9d619fe87 100644 --- a/google-http-client-jackson/pom.xml +++ b/google-http-client-jackson/pom.xml @@ -16,8 +16,8 @@ maven-javadoc-plugin - https://download.oracle.com/javase/1.6.0/docs/api/ - https://jar-download.com/artifacts/org.codehaus.jackson/jackson-core-asl/1.9.13/documentation + http://download.oracle.com/javase/6/docs/api/ + https://jar-download.com/artifacts/org.codehaus.jackson/jackson-core-asl/${project.jackson-core-asl.version}/documentation ${project.name} ${project.version} ${project.artifactId} ${project.version} diff --git a/google-http-client-jackson2/pom.xml b/google-http-client-jackson2/pom.xml index 041986701..0df2b4fcd 100644 --- a/google-http-client-jackson2/pom.xml +++ b/google-http-client-jackson2/pom.xml @@ -16,8 +16,8 @@ maven-javadoc-plugin - http://download.oracle.com/javase/1.5.0/docs/api/ - http://fasterxml.github.com/jackson-core/javadoc/2.0.5/ + http://download.oracle.com/javase/6/docs/api/ + http://fasterxml.github.com/jackson-core/javadoc/${project.jackson-core2.version}/ ${project.name} ${project.version} ${project.artifactId} ${project.version} diff --git a/google-http-client-jdo/pom.xml b/google-http-client-jdo/pom.xml index 596606f17..8d70eab3b 100644 --- a/google-http-client-jdo/pom.xml +++ b/google-http-client-jdo/pom.xml @@ -15,7 +15,7 @@ maven-javadoc-plugin - http://download.oracle.com/javase/1.5.0/docs/api/ + http://download.oracle.com/javase/6/docs/api/ ${project.name} ${project.version} ${project.artifactId} ${project.version} @@ -30,15 +30,6 @@ - - - jar - compile - - jar - - - maven-source-plugin diff --git a/google-http-client-test/pom.xml b/google-http-client-test/pom.xml index 701e3fb07..5f4a0d842 100644 --- a/google-http-client-test/pom.xml +++ b/google-http-client-test/pom.xml @@ -16,7 +16,7 @@ maven-javadoc-plugin - http://download.oracle.com/javase/1.5.0/docs/api/ + http://download.oracle.com/javase/6/docs/api/ ${project.name} ${project.version} ${project.artifactId} ${project.version} diff --git a/google-http-client-xml/pom.xml b/google-http-client-xml/pom.xml index 9f6a6ecf4..b67fc66d2 100644 --- a/google-http-client-xml/pom.xml +++ b/google-http-client-xml/pom.xml @@ -16,7 +16,7 @@ maven-javadoc-plugin - http://download.oracle.com/javase/1.5.0/docs/api/ + http://download.oracle.com/javase/6/docs/api/ ${project.name} ${project.version} ${project.artifactId} ${project.version} diff --git a/google-http-client/pom.xml b/google-http-client/pom.xml index 8f384b1d3..351652587 100644 --- a/google-http-client/pom.xml +++ b/google-http-client/pom.xml @@ -20,9 +20,9 @@ maven-javadoc-plugin - http://download.oracle.com/javase/1.5.0/docs/api/ - http://docs.guava-libraries.googlecode.com/git-history/v13.0.1/javadoc - http://commons.apache.org/proper/commons-codec/javadocs/api-release + http://download.oracle.com/javase/6/docs/api/ + https://google.github.io/guava/releases/${project.guava.version}/api/docs/ + https://commons.apache.org/proper/commons-codec/archives/${project.commons-codec.version}/apidocs/ ${project.name} ${project.version} ${project.artifactId} ${project.version} diff --git a/pom.xml b/pom.xml index 665e4d9b1..e7d255ba7 100644 --- a/pom.xml +++ b/pom.xml @@ -152,7 +152,7 @@ commons-codec commons-codec - 1.6 + ${project.commons-codec.version} com.google.guava @@ -272,21 +272,20 @@ - build-helper-maven-plugin - 1.5 - - - maven-antrun-plugin - 1.6 + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.6 + true + + ossrh + https://oss.sonatype.org/ + false + maven-assembly-plugin 2.2 - - maven-clean-plugin - 2.4.1 - maven-compiler-plugin 2.3.2 @@ -295,81 +294,53 @@ 1.6 + - maven-dependency-plugin - 2.1 - - - maven-deploy-plugin - 2.5 - - - maven-ear-plugin - 2.4.2 - - - maven-ejb-plugin - 2.3 - - - maven-install-plugin - 2.3.1 - - - maven-jar-plugin - 2.3.1 - - - false - - true - - - Google - 1.6.x - - - + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + org.apache.maven.plugins maven-javadoc-plugin - 2.9 - - - maven-plugin-plugin - 2.6 - - - maven-rar-plugin - 2.2 - - - maven-release-plugin - 2.1 + 2.9.1 + + + attach-javadocs + + jar + + + - maven-resources-plugin - 2.4.3 - - - maven-site-plugin - 2.1.1 - - - maven-source-plugin - 2.1.2 + org.apache.maven.plugins + maven-jar-plugin + 3.0.2 + + + + test-jar + + + maven-surefire-plugin - 2.12.4 + 2.19.1 -Xmx1024m + sponge_log - - maven-war-plugin - 2.1 - maven-checkstyle-plugin 2.6 @@ -389,11 +360,6 @@ animal-sniffer-maven-plugin 1.9 - - org.sonatype.plugins - jarjar-maven-plugin - 1.9 - org.apache.maven.plugins maven-project-info-reports-plugin @@ -421,13 +387,13 @@ site - https://download.oracle.com/javase/1.6.0/docs/api/ - https://cloud.google.com/appengine/docs/java/javadoc - https://jar-download.com/artifacts/org.codehaus.jackson/jackson-core-asl/1.9.13/documentation - http://fasterxml.github.com/jackson-core/javadoc/2.0.5/ - https://google.github.io/gson/apidocs/ - https://google.github.io/guava/releases/20.0/api/docs/ - http://commons.apache.org/proper/commons-codec/javadocs/api-release + http://download.oracle.com/javase/6/docs/api/ + http://cloud.google.com/appengine/docs/java/javadoc + https://jar-download.com/artifacts/org.codehaus.jackson/jackson-core-asl/${project.jackson-core-asl.version}/documentation + http://fasterxml.github.com/jackson-core/javadoc/${project.jackson-core2.version}/ + https://www.javadoc.io/doc/com.google.code.gson/gson/${project.gson.version} + https://google.github.io/guava/releases/${project.guava.version}/api/docs/ + https://commons.apache.org/proper/commons-codec/archives/${project.commons-codec.version}/apidocs/ Google HTTP Client Library for Java ${project.version} com.google.api.client.findbugs:com.google.api.client.test.:com.google.api.services @@ -476,6 +442,7 @@ + org.apache.maven.plugins maven-checkstyle-plugin checkstyle.xml @@ -526,7 +493,7 @@ org.codehaus.mojo.signature - java15 + java16 1.0 @@ -560,6 +527,7 @@ 20.0 1.1.4c 1.1.1 + 1.10 4.5.5 2.3-eb 3.2.2 @@ -567,4 +535,40 @@ 3.2.1 4.0.3 + + + + release-sign-artifacts + + + performRelease + true + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + sign-artifacts + verify + + sign + + + + --pinentry-mode + loopback + + + + + + + + +