Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds CI test for mvn dependency:analyze and fixes missing deps #738

Merged
merged 4 commits into from Jul 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 27 additions & 0 deletions .kokoro/dependencies.sh
@@ -0,0 +1,27 @@
#!/bin/bash
# Copyright 2019 Google LLC
#
# 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

cd github/google-http-java-client/

# Print out Java
java -version
echo $JOB_TYPE

export MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m"

mvn install -DskipTests=true -B -V
mvn -B dependency:analyze -DfailOnWarning=true
12 changes: 12 additions & 0 deletions .kokoro/presubmit/dependencies.cfg
@@ -0,0 +1,12 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/java8"
}

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/google-http-java-client/.kokoro/dependencies.sh"
}
13 changes: 3 additions & 10 deletions google-http-client-apache-v2/pom.xml
Expand Up @@ -18,7 +18,6 @@
<configuration>
<links>
<link>https://download.oracle.com/javase/7/docs/api/</link>
<link>https://jar-download.com/artifacts/org.codehaus.jackson/jackson-core-asl/${project.jackson-core-asl.version}/documentation</link>
</links>
<doctitle>${project.name} ${project.version}</doctitle>
<windowtitle>${project.artifactId} ${project.version}</windowtitle>
Expand Down Expand Up @@ -87,24 +86,18 @@
<groupId>com.google.http-client</groupId>
<artifactId>google-http-client</artifactId>
</dependency>
<dependency>
<groupId>com.google.http-client</groupId>
<artifactId>google-http-client-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<scope>test</scope>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<artifactId>httpcore</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
Expand Down
13 changes: 8 additions & 5 deletions google-http-client-appengine/pom.xml
Expand Up @@ -48,6 +48,14 @@
</signature>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<!-- This artifact is needed by appengine-testing, but is not declared as a dependency -->
<ignoredUnusedDeclaredDependencies>com.google.appengine:appengine-api-stubs</ignoredUnusedDeclaredDependencies>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
Expand Down Expand Up @@ -80,10 +88,5 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
21 changes: 17 additions & 4 deletions google-http-client-findbugs/pom.xml
Expand Up @@ -32,13 +32,17 @@
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<!-- This is needed for Javadoc linking, but is not used in the compiled bytecode -->
<ignoredUnusedDeclaredDependencies>com.google.http-client:google-http-client</ignoredUnusedDeclaredDependencies>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.google.http-client</groupId>
<artifactId>google-http-client</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>findbugs</artifactId>
Expand All @@ -58,5 +62,14 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>bcel-findbugs</artifactId>
<version>6.0</version>
</dependency>
<dependency>
<groupId>com.google.http-client</groupId>
<artifactId>google-http-client</artifactId>
</dependency>
</dependencies>
</project>
5 changes: 0 additions & 5 deletions google-http-client-gson/pom.xml
Expand Up @@ -67,11 +67,6 @@
<artifactId>google-http-client-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: this is inherited from google-http-client-test and we inherit from a base test class.

<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
Expand Down
5 changes: 0 additions & 5 deletions google-http-client-jackson2/pom.xml
Expand Up @@ -67,11 +67,6 @@
<artifactId>google-http-client-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: this is inherited from google-http-client-test and we inherit from a base test class.

<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
Expand Down
4 changes: 4 additions & 0 deletions google-http-client/pom.xml
Expand Up @@ -72,6 +72,10 @@
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
Expand Down
11 changes: 11 additions & 0 deletions pom.xml
Expand Up @@ -147,6 +147,11 @@
<artifactId>httpclient</artifactId>
<version>${project.httpclient.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>${project.httpcore.version}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
Expand Down Expand Up @@ -357,6 +362,11 @@
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
Expand Down Expand Up @@ -552,6 +562,7 @@
<project.xpp3.version>1.1.4c</project.xpp3.version>
<project.commons-logging.version>1.2</project.commons-logging.version>
<project.httpclient.version>4.5.9</project.httpclient.version>
<project.httpcore.version>4.4.11</project.httpcore.version>
<project.opencensus.version>0.21.0</project.opencensus.version>
<project.root-directory>..</project.root-directory>
<deploy.autorelease>false</deploy.autorelease>
Expand Down