Skip to content

Commit 149b6c3

Browse files
authored
Add publish javadoc kokoro job (#631)
* Add publish javadoc kokoro job * Update maven-javadoc-plugin * Add source config for maven-javadoc-plugin * Fix gson hosted javadoc location * Update maven-site-plugin and skip site generation for bom artifact * we don't need to stage the site as we're aggregating * Fix url for jackson-core-asl javadocs
1 parent b6f3755 commit 149b6c3

File tree

7 files changed

+99
-7
lines changed

7 files changed

+99
-7
lines changed

.kokoro/release/publish_javadoc.cfg

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
env_vars: {
3+
key: "STAGING_BUCKET"
4+
value: "docs-staging"
5+
}
6+
7+
env_vars: {
8+
key: "TRAMPOLINE_BUILD_FILE"
9+
value: "github/google-http-java-client/.kokoro/release/publish_javadoc.sh"
10+
}
11+
12+
before_action {
13+
fetch_keystore {
14+
keystore_resource {
15+
keystore_config_id: 73713
16+
keyname: "docuploader_service_account"
17+
}
18+
}
19+
}

.kokoro/release/publish_javadoc.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/bin/bash
2+
# Copyright 2019 Google Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
set -eo pipefail
17+
18+
if [[ -z "${CREDENTIALS}" ]]; then
19+
CREDENTIALS=${KOKORO_KEYSTORE_DIR}/73713_docuploader_service_account
20+
fi
21+
22+
if [[ -z "${STAGING_BUCKET}" ]]; then
23+
echo "Need to set STAGING_BUCKET environment variable"
24+
exit 1
25+
fi
26+
27+
# work from the git root directory
28+
pushd $(dirname "$0")/../../
29+
30+
# install docuploader package
31+
python3 -m pip install gcp-docuploader
32+
33+
# compile all packages
34+
mvn clean install -B -DskipTests=true
35+
36+
NAME=google-http-client
37+
VERSION=$(grep ${NAME}: versions.txt | cut -d: -f3)
38+
39+
# build the docs
40+
mvn site -B
41+
42+
pushd target/site/apidocs
43+
44+
# create metadata
45+
python3 -m docuploader create-metadata \
46+
--name ${NAME} \
47+
--version ${VERSION} \
48+
--language java
49+
50+
# upload docs
51+
python3 -m docuploader upload . \
52+
--credentials ${CREDENTIALS} \
53+
--staging-bucket ${STAGING_BUCKET}
54+
55+
popd

google-http-client-apache-legacy/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<configuration>
1919
<links>
2020
<link>https://download.oracle.com/javase/7/docs/api/</link>
21-
<link>https://jar-download.com/artifacts/org.codehaus.jackson/jackson-core-asl/${project.jackson-core-asl.version}/documentation</link>
21+
<link>https://jar-download.com/javaDoc/org.codehaus.jackson/jackson-core-asl/${project.jackson-core-asl.version}</link>
2222
</links>
2323
<doctitle>${project.name} ${project.version}</doctitle>
2424
<windowtitle>${project.artifactId} ${project.version}</windowtitle>

google-http-client-bom/pom.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,18 @@
130130
<autoReleaseAfterClose>false</autoReleaseAfterClose>
131131
</configuration>
132132
</plugin>
133+
<plugin>
134+
<artifactId>maven-javadoc-plugin</artifactId>
135+
<configuration>
136+
<skip>true</skip>
137+
</configuration>
138+
</plugin>
139+
<plugin>
140+
<artifactId>maven-site-plugin</artifactId>
141+
<configuration>
142+
<skip>true</skip>
143+
</configuration>
144+
</plugin>
133145
</plugins>
134146
</build>
135147

google-http-client-gson/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<configuration>
1919
<links>
2020
<link>http://download.oracle.com/javase/7/docs/api/</link>
21-
<link>https://www.javadoc.io/doc/com.google.code.gson/gson/${project.gson.version}</link>
21+
<link>https://static.javadoc.io/com.google.code.gson/gson/${project.gson.version}</link>
2222
</links>
2323
<doctitle>${project.name} ${project.version}</doctitle>
2424
<windowtitle>${project.artifactId} ${project.version}</windowtitle>

google-http-client-jackson/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<configuration>
1919
<links>
2020
<link>http://download.oracle.com/javase/7/docs/api/</link>
21-
<link>https://jar-download.com/artifacts/org.codehaus.jackson/jackson-core-asl/${project.jackson-core-asl.version}/documentation</link>
21+
<link>https://jar-download.com/javaDoc/org.codehaus.jackson/jackson-core-asl/${project.jackson-core-asl.version}</link>
2222
</links>
2323
<doctitle>${project.name} ${project.version}</doctitle>
2424
<windowtitle>${project.artifactId} ${project.version}</windowtitle>

pom.xml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@
304304
<plugin>
305305
<groupId>org.apache.maven.plugins</groupId>
306306
<artifactId>maven-javadoc-plugin</artifactId>
307-
<version>3.0.1</version>
307+
<version>3.1.0</version>
308308
<executions>
309309
<execution>
310310
<id>attach-javadocs</id>
@@ -357,7 +357,12 @@
357357
<plugin>
358358
<groupId>org.apache.maven.plugins</groupId>
359359
<artifactId>maven-project-info-reports-plugin</artifactId>
360-
<version>2.7</version>
360+
<version>3.0.0</version>
361+
</plugin>
362+
<plugin>
363+
<groupId>org.apache.maven.plugins</groupId>
364+
<artifactId>maven-site-plugin</artifactId>
365+
<version>3.7.1</version>
361366
</plugin>
362367
</plugins>
363368
</pluginManagement>
@@ -385,6 +390,7 @@
385390
<artifactId>maven-javadoc-plugin</artifactId>
386391
<configuration>
387392
<doclint>none</doclint>
393+
<source>7</source>
388394
</configuration>
389395
<executions>
390396
<execution>
@@ -397,9 +403,9 @@
397403
<links>
398404
<link>http://download.oracle.com/javase/7/docs/api/</link>
399405
<link>http://cloud.google.com/appengine/docs/java/javadoc</link>
400-
<link>https://jar-download.com/artifacts/org.codehaus.jackson/jackson-core-asl/${project.jackson-core-asl.version}/documentation</link>
406+
<link>https://jar-download.com/javaDoc/org.codehaus.jackson/jackson-core-asl/${project.jackson-core-asl.version}</link>
401407
<link>http://fasterxml.github.com/jackson-core/javadoc/${project.jackson-core2.version}/</link>
402-
<link>https://www.javadoc.io/doc/com.google.code.gson/gson/${project.gson.version}</link>
408+
<link>https://static.javadoc.io/doc/com.google.code.gson/gson/${project.gson.version}</link>
403409
<link>https://google.github.io/guava/releases/${project.guava.version}/api/docs/</link>
404410
</links>
405411
<doctitle>Google HTTP Client Library for Java ${project.version}</doctitle>

0 commit comments

Comments
 (0)