diff --git a/.kokoro/build.sh b/.kokoro/build.sh index 13e4bf27e214..313dcccfcfb3 100755 --- a/.kokoro/build.sh +++ b/.kokoro/build.sh @@ -21,7 +21,7 @@ cd github/google-cloud-java/ java -version echo $JOB_TYPE -mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V +mvn install -DskipTests=true -Dmaven.javadoc.skip=true -Dgcloud.download.skip=true -B -V # prepend Kokoro root directory onto GOOGLE_APPLICATION_CREDENTIALS path if [ ! -z "$GOOGLE_APPLICATION_CREDENTIALS" ]; then diff --git a/google-cloud-testing/google-cloud-gcloud-maven-plugin/src/main/java/com/google/cloud/DownloadComponentsMojo.java b/google-cloud-testing/google-cloud-gcloud-maven-plugin/src/main/java/com/google/cloud/DownloadComponentsMojo.java index 491aaf284efb..3baa1e4f7a8d 100644 --- a/google-cloud-testing/google-cloud-gcloud-maven-plugin/src/main/java/com/google/cloud/DownloadComponentsMojo.java +++ b/google-cloud-testing/google-cloud-gcloud-maven-plugin/src/main/java/com/google/cloud/DownloadComponentsMojo.java @@ -77,10 +77,17 @@ public class DownloadComponentsMojo extends AbstractMojo { @Parameter(defaultValue = "false", required = true, property = "gcloud.download.force") private boolean forceRefresh; + @Parameter(defaultValue = "false", required = true, property = "gcloud.download.skip") + private boolean shouldSkipDownload; + @Parameter(defaultValue = "${session}", readonly = true) private MavenSession session; public void execute() throws MojoExecutionException { + if (shouldSkipDownload) { + return; + } + if (session.isOffline() && forceRefresh) { throw new MojoExecutionException("Can't force refresh when offline"); }