Kapt3 use processorpath and processors flags. remove gson usage.
diff --git a/kotlin/internal/jvm/compile.bzl b/kotlin/internal/jvm/compile.bzl
index 6c2d7ed..906b88c 100644
--- a/kotlin/internal/jvm/compile.bzl
+++ b/kotlin/internal/jvm/compile.bzl
@@ -199,7 +199,13 @@
     # Collect and prepare plugin descriptor for the worker.
     plugin_info = _merge_plugin_infos(ctx.attr.plugins + ctx.attr.deps)
     if len(plugin_info.annotation_processors) > 0:
-        args.add("--kotlin_plugins", plugin_info.to_json())
+        processors = depset()
+        processorpath = depset()
+        for p in plugin_info.annotation_processors:
+            processors += [p.processor_class]
+            processorpath += p.classpath
+        args.add("--processors", processors)
+        args.add("--processorpath", processorpath)
 
     progress_message = "Compiling Kotlin to JVM %s { kt: %d, java: %d, srcjars: %d }" % (
         ctx.label,
diff --git a/src/main/kotlin/io/bazel/kotlin/builder/BUILD b/src/main/kotlin/io/bazel/kotlin/builder/BUILD
index 0983523..a60b1d1 100644
--- a/src/main/kotlin/io/bazel/kotlin/builder/BUILD
+++ b/src/main/kotlin/io/bazel/kotlin/builder/BUILD
@@ -39,7 +39,6 @@
     runtime_deps = [
         "@com_github_jetbrains_kotlin//:kotlin-stdlib-jdk7",
         "@com_github_jetbrains_kotlin//:kotlin-stdlib-jdk8",
-        "@io_bazel_rules_kotlin_com_google_code_gson_gson//jar",
     ],
     deps = [
         ":builder_kt",
diff --git a/src/main/kotlin/io/bazel/kotlin/builder/tasks/KotlinBuilder.kt b/src/main/kotlin/io/bazel/kotlin/builder/tasks/KotlinBuilder.kt
index 9ef3736..1d45d39 100644
--- a/src/main/kotlin/io/bazel/kotlin/builder/tasks/KotlinBuilder.kt
+++ b/src/main/kotlin/io/bazel/kotlin/builder/tasks/KotlinBuilder.kt
@@ -15,7 +15,6 @@
  */
 package io.bazel.kotlin.builder.tasks
 
-import com.google.protobuf.util.JsonFormat
 import io.bazel.kotlin.builder.tasks.js.Kotlin2JsTaskExecutor
 import io.bazel.kotlin.builder.tasks.jvm.KotlinJvmTaskExecutor
 import io.bazel.kotlin.builder.toolchain.CompilationStatusException
@@ -39,13 +38,6 @@
 ) : CommandLineProgram {
     companion object {
         @JvmStatic
-        private val jsonTypeRegistry = JsonFormat.TypeRegistry.newBuilder()
-            .add(KotlinModel.getDescriptor().messageTypes).build()
-
-        @JvmStatic
-        private val jsonFormat: JsonFormat.Parser = JsonFormat.parser().usingTypeRegistry(jsonTypeRegistry)
-
-        @JvmStatic
         private val FLAGFILE_RE = Pattern.compile("""^--flagfile=((.*)-(\d+).params)$""").toRegex()
     }
 
@@ -63,7 +55,7 @@
             success = true
         } catch (ex: CompilationStatusException) {
             status = ex.status
-        } catch(throwable: Throwable) {
+        } catch (throwable: Throwable) {
             context.reportUnhandledException(throwable)
             throw throwable
         } finally {
@@ -108,7 +100,7 @@
         SOURCE_JARS("--source_jars"),
         SOURCE_PATH("--sourcepath"),
         BOOT_CLASSPATH("--bootclasspath"),
-        PROCESS_PATH("--processorpath"),
+        PROCESSOR_PATH("--processorpath"),
         PROCESSORS("--processors"),
         EXT_CLASSPATH("--extclasspath"),
         EXT_DIR("--extdir"),
@@ -131,7 +123,6 @@
         JVM_TARGET("--kotlin_jvm_target"),
         OUTPUT_SRCJAR("--kotlin_output_srcjar"),
         GENERATED_CLASSDIR("--kotlin_generated_classdir"),
-        PLUGINS("--kotlin_plugins"),
         FRIEND_PATHS("--kotlin_friend_paths"),
         OUTPUT_JDEPS("--kotlin_output_jdeps"),
         OUTPUT_JS_JAR("--kotlin_output_js_jar"),
@@ -217,6 +208,9 @@
                 putAllIndirectDependencies(argMap.labelDepMap(JavaBuilderFlags.DIRECT_DEPENDENCY))
                 putAllIndirectDependencies(argMap.labelDepMap(JavaBuilderFlags.INDIRECT_DEPENDENCY))
 
+                addAllProcessors(argMap.optional(JavaBuilderFlags.PROCESSORS) ?: emptyList())
+                addAllProcessorpaths(argMap.optional(JavaBuilderFlags.PROCESSOR_PATH) ?: emptyList())
+
                 argMap.optional(JavaBuilderFlags.SOURCES)?.iterator()?.partitionJvmSources(
                     { addKotlinSources(it) },
                     { addJavaSources(it) }
@@ -228,13 +222,6 @@
 
             with(root.infoBuilder) {
                 toolchainInfoBuilder.jvmBuilder.jvmTarget = argMap.mandatorySingle(KotlinBuilderFlags.JVM_TARGET)
-
-                argMap.optionalSingle(KotlinBuilderFlags.PLUGINS)?.let { input ->
-                    plugins = CompilerPlugins.newBuilder().let {
-                        jsonFormat.merge(input, it)
-                        it.build()
-                    }
-                }
             }
             root.build()
         }
diff --git a/src/main/kotlin/io/bazel/kotlin/builder/tasks/jvm/KotlinJvmTaskExecutor.kt b/src/main/kotlin/io/bazel/kotlin/builder/tasks/jvm/KotlinJvmTaskExecutor.kt
index 7debb8d..2f4d3c8 100644
--- a/src/main/kotlin/io/bazel/kotlin/builder/tasks/jvm/KotlinJvmTaskExecutor.kt
+++ b/src/main/kotlin/io/bazel/kotlin/builder/tasks/jvm/KotlinJvmTaskExecutor.kt
@@ -51,7 +51,7 @@
         )
         val taskWithAdditionalSources = context.execute("expand sources") { expandWithSourceJarSources() }
         return context.execute({
-            "kapt (${info.plugins.annotationProcessorsList.joinToString(", ") { it.processorClass }})"
+            "kapt (${inputs.processorsList.joinToString(", ")})"
         }) { taskWithAdditionalSources.runAnnotationProcessors(context) }
     }
 
@@ -82,7 +82,7 @@
         context: CompilationTaskContext,
         printOnSuccess: Boolean = true
     ): List<String> {
-        check(info.plugins.annotationProcessorsList.isNotEmpty()) { "method called without annotation processors" }
+        check(inputs.processorsList.isNotEmpty()) { "method called without annotation processors" }
         return getCommonArgs().let { args ->
             args.addAll(pluginArgsEncoder.encode(context, this))
             args.addAll(inputs.kotlinSourcesList)
@@ -118,7 +118,7 @@
     private fun JvmCompilationTask.runAnnotationProcessors(
         context: CompilationTaskContext
     ): JvmCompilationTask =
-        if (info.plugins.annotationProcessorsList.isEmpty()) {
+        if (inputs.processorsList.isEmpty()) {
             this
         } else {
             runAnnotationProcessor(context, printOnSuccess = !context.isTracing).let { outputLines ->
diff --git a/src/main/kotlin/io/bazel/kotlin/builder/utils/KotlinCompilerPluginArgsEncoder.kt b/src/main/kotlin/io/bazel/kotlin/builder/utils/KotlinCompilerPluginArgsEncoder.kt
index 8e00e13..93eba59 100644
--- a/src/main/kotlin/io/bazel/kotlin/builder/utils/KotlinCompilerPluginArgsEncoder.kt
+++ b/src/main/kotlin/io/bazel/kotlin/builder/utils/KotlinCompilerPluginArgsEncoder.kt
@@ -21,6 +21,7 @@
 import java.io.ObjectOutputStream
 import java.util.*
 
+// TODO(hs) move the kapt specific stuff to the JVM package.
 class KotlinCompilerPluginArgsEncoder(
     private val jarPath: String,
     private val pluginId: String
@@ -76,21 +77,18 @@
 
         // "configuration" is an undocumented kapt3 argument. preparing the arguments this way is the only way to get more than one annotation processor class
         // passed to kotlinc.
-        fun encode(): List<String> =
-            listOf(
-                "-Xplugin=$jarPath",
-                "-P", "plugin:$pluginId:configuration=${encodeMultiMap(
-                    tally
-                )}"
-            )
+        fun encode(): List<String> = listOf(
+            "-Xplugin=$jarPath",
+            "-P", "plugin:$pluginId:configuration=${encodeMultiMap(tally)}"
+        )
     }
 
-    fun encode(context: CompilationTaskContext, command: JvmCompilationTask): List<String> {
+    fun encode(context: CompilationTaskContext, task: JvmCompilationTask): List<String> {
         val javacArgs = mutableMapOf<String, String>(
-            "-target" to command.info.toolchainInfo.jvm.jvmTarget
+            "-target" to task.info.toolchainInfo.jvm.jvmTarget
         )
-        val d = command.directories
-        return command.info.plugins.takeIf { it.annotationProcessorsList.isNotEmpty() }?.let { plugin ->
+        val d = task.directories
+        return if (task.inputs.processorsList.isNotEmpty()) {
             PluginArgs().let { arg ->
                 arg["sources"] = d.generatedSources.toString()
                 arg["classes"] = d.generatedClasses.toString()
@@ -102,13 +100,12 @@
                 context.whenTracing {
                     arg["verbose"] = "true"
                 }
-
-                arg["processors"] = plugin.annotationProcessorsList
-                    .filter { it.processorClass.isNotEmpty() }
-                    .onEach { processor -> processor.classpathList.forEach { arg.bindMulti("apclasspath", it) } }
-                    .joinToString(",") { it.processorClass }
+                arg["processors"] = task.inputs.processorsList.joinToString(",")
+                task.inputs.processorpathsList.forEach { arg.bindMulti("apclasspath", it) }
                 arg.encode()
             }
-        } ?: emptyList()
+        } else {
+            emptyList()
+        }
     }
 }
\ No newline at end of file
diff --git a/src/main/protobuf/jars/libkotlin_model_proto-speed.jar b/src/main/protobuf/jars/libkotlin_model_proto-speed.jar
index 38960a0..45dc3ea 100755
--- a/src/main/protobuf/jars/libkotlin_model_proto-speed.jar
+++ b/src/main/protobuf/jars/libkotlin_model_proto-speed.jar
Binary files differ
diff --git a/src/main/protobuf/kotlin_model.proto b/src/main/protobuf/kotlin_model.proto
index 3f108af..5fcacf7 100644
--- a/src/main/protobuf/kotlin_model.proto
+++ b/src/main/protobuf/kotlin_model.proto
@@ -18,26 +18,6 @@
 option java_package = "io.bazel.kotlin.model";
 option java_multiple_files = true;
 
-// An abstract definition of an annotation processor. This is encoded into a format understood by kapt3.
-// +stable
-message AnnotationProcessor {
-    // The annotation processor class.
-    string processor_class = 1;
-    // The Bazel `java_plugin` `generates_api` attribute.
-    bool generates_api = 2;
-    // The full transitive classpath required for annotation processing.
-    repeated string classpath = 3;
-    // The label of the plugin.
-    string label = 4;
-}
-
-// A container for all of the types of compiler plugins needed by the kotlin compilers.
-// +stable
-message CompilerPlugins {
-    // Regular java annotation_processor descriptors.
-    repeated AnnotationProcessor annotation_processors = 1;
-}
-
 // Toolchain info this contains info to be used to configure the compile tasks as well as configuring certain features
 // in IDE plugins.
 // +stable
@@ -90,16 +70,14 @@
     string passthrough_flags = 5;
     // Toolchain info for this build.
     KotlinToolchainInfo toolchain_info = 6;
-    // Compiler plugin descriptors.
-    CompilerPlugins plugins = 7;
     // Paths to Jars that the kotlin compiler will allow package private access to.
-    repeated string friend_paths = 8;
+    repeated string friend_paths = 7;
     // The path of the primary output for the task, this is derived from the flagfile.
-    string primary_output_path = 9;
+    string primary_output_path = 8;
     // Strings to enable various debugging behaviours
     // trace: enables trace logging.
     // timings: causes timing information to be printed at the of an action.
-    repeated string debug = 10;
+    repeated string debug = 9;
 }
 
 // Mested messages not marked with stable could be refactored.
@@ -140,6 +118,10 @@
         repeated string java_sources = 5;
         // Jars containing additional sources.
         repeated string source_jars = 6;
+        // Annotation processor FQNames
+        repeated string processors = 7;
+        // Annotation processor classpath.
+        repeated string processorpaths = 8;
     }
 
     CompilationTaskInfo info = 1;
diff --git a/src/test/kotlin/io/bazel/kotlin/builder/BUILD b/src/test/kotlin/io/bazel/kotlin/builder/BUILD
index 9c94869..ad1523f 100644
--- a/src/test/kotlin/io/bazel/kotlin/builder/BUILD
+++ b/src/test/kotlin/io/bazel/kotlin/builder/BUILD
@@ -27,7 +27,7 @@
     name = "test_lib",
     testonly = 1,
     srcs = [
-        "Dep.java",
+        "Deps.java",
         "KotlinBuilderJsTestTask.java",
         "KotlinBuilderJvmTestTask.java",
         "KotlinBuilderResource.java",
diff --git a/src/test/kotlin/io/bazel/kotlin/builder/Dep.java b/src/test/kotlin/io/bazel/kotlin/builder/Dep.java
deleted file mode 100644
index 4a3e1d4..0000000
--- a/src/test/kotlin/io/bazel/kotlin/builder/Dep.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright 2018 The Bazel Authors. All rights reserved.
- *
- * 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.
- */
-package io.bazel.kotlin.builder;
-
-import com.google.auto.value.AutoValue;
-import com.google.common.collect.ImmutableSet;
-import io.bazel.kotlin.builder.utils.BazelRunFiles;
-
-import java.util.Optional;
-import java.util.Set;
-import java.util.stream.Stream;
-
-@SuppressWarnings({"WeakerAccess", "unused"})
-@AutoValue
-public abstract class Dep {
-  public abstract String label();
-
-  public abstract String moduleName();
-
-  public abstract Set<String> runtimeDeps();
-
-  public abstract Set<String> compileJars();
-
-  public static Builder builder() {
-    return new AutoValue_Dep.Builder().runtimeDeps(ImmutableSet.of());
-  }
-
-  @SuppressWarnings("UnusedReturnValue")
-  @AutoValue.Builder
-  public abstract static class Builder {
-    public abstract Builder compileJars(Set<String> compileJars);
-
-    public abstract Builder label(String label);
-
-    public abstract Builder runtimeDeps(Set<String> runtimeDeps);
-
-    public abstract Builder moduleName(String moduleName);
-
-    abstract String label();
-
-    abstract Optional<String> moduleName();
-
-    abstract Dep autoBuild();
-
-    public Dep build() {
-      if (!moduleName().isPresent()) {
-        moduleName(label());
-      }
-      return autoBuild();
-    }
-  }
-
-  /** Collect all of the compile jars of all the dependencies. */
-  public static Stream<String> classpathOf(Dep... dependencies) {
-    return Stream.of(dependencies).flatMap(it -> it.compileJars().stream());
-  }
-
-  /** Import a single dep. Similar to a `kt_jvm_import` or a `kt_js_import`. */
-  public static Dep importJar(String label, String compileJar) {
-    return Dep.builder()
-        .label(label)
-        .compileJars(ImmutableSet.of(BazelRunFiles.resolveVerified(compileJar).getAbsolutePath()))
-        .build();
-  }
-}
diff --git a/src/test/kotlin/io/bazel/kotlin/builder/Deps.java b/src/test/kotlin/io/bazel/kotlin/builder/Deps.java
new file mode 100644
index 0000000..8a94799
--- /dev/null
+++ b/src/test/kotlin/io/bazel/kotlin/builder/Deps.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2018 The Bazel Authors. All rights reserved.
+ *
+ * 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.
+ */
+package io.bazel.kotlin.builder;
+
+import com.google.auto.value.AutoValue;
+import com.google.common.collect.ImmutableSet;
+import io.bazel.kotlin.builder.utils.BazelRunFiles;
+
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Stream;
+
+public final class Deps {
+  @SuppressWarnings({"WeakerAccess", "unused"})
+  @AutoValue
+  public abstract static class Dep {
+    public abstract String label();
+
+    public abstract String moduleName();
+
+    public abstract Set<String> runtimeDeps();
+
+    public abstract Set<String> compileJars();
+
+    public static Builder builder() {
+      return new AutoValue_Deps_Dep.Builder().runtimeDeps(ImmutableSet.of());
+    }
+
+    @SuppressWarnings("UnusedReturnValue")
+    @AutoValue.Builder
+    public abstract static class Builder {
+      public abstract Builder compileJars(Set<String> compileJars);
+
+      public abstract Builder label(String label);
+
+      public abstract Builder runtimeDeps(Set<String> runtimeDeps);
+
+      public abstract Builder moduleName(String moduleName);
+
+      abstract String label();
+
+      abstract Optional<String> moduleName();
+
+      abstract Dep autoBuild();
+
+      public Dep build() {
+        if (!moduleName().isPresent()) {
+          moduleName(label());
+        }
+        return autoBuild();
+      }
+    }
+
+    /** Collect all of the compile jars of all the dependencies. */
+    public static Stream<String> classpathOf(Dep... dependencies) {
+      return Stream.of(dependencies).flatMap(it -> it.compileJars().stream());
+    }
+
+    /** Import a single dep. Similar to a `kt_jvm_import` or a `kt_js_import`. */
+    public static Dep importJar(String label, String compileJar) {
+      return Dep.builder()
+          .label(label)
+          .compileJars(ImmutableSet.of(BazelRunFiles.resolveVerified(compileJar).getAbsolutePath()))
+          .build();
+    }
+  }
+
+  @AutoValue
+  public abstract static class AnnotationProcessor {
+    abstract String processClass();
+
+    abstract Set<String> processorPath();
+
+    public static Builder builder() {
+      return new AutoValue_Deps_AnnotationProcessor.Builder();
+    }
+
+    @AutoValue.Builder
+    public abstract static class Builder {
+      public abstract Builder processClass(String processClass);
+
+      public abstract Builder processorPath(Set<String> processorPath);
+
+      public abstract AnnotationProcessor build();
+    }
+  }
+}
diff --git a/src/test/kotlin/io/bazel/kotlin/builder/KotlinBuilderJvmTestTask.java b/src/test/kotlin/io/bazel/kotlin/builder/KotlinBuilderJvmTestTask.java
index e2c294f..824a742 100644
--- a/src/test/kotlin/io/bazel/kotlin/builder/KotlinBuilderJvmTestTask.java
+++ b/src/test/kotlin/io/bazel/kotlin/builder/KotlinBuilderJvmTestTask.java
@@ -15,17 +15,19 @@
  */
 package io.bazel.kotlin.builder;
 
+import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableSet;
 import io.bazel.kotlin.builder.toolchain.KotlinToolchain;
-import io.bazel.kotlin.model.AnnotationProcessor;
 import io.bazel.kotlin.model.CompilationTaskInfo;
 import io.bazel.kotlin.model.JvmCompilationTask;
 
-import java.util.Arrays;
+import java.util.HashSet;
 import java.util.function.Consumer;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
+import static io.bazel.kotlin.builder.Deps.*;
+
 public final class KotlinBuilderJvmTestTask extends KotlinBuilderResource<JvmCompilationTask> {
   @SuppressWarnings({"unused", "WeakerAccess"})
   public static Dep
@@ -98,10 +100,18 @@
   }
 
   public void addAnnotationProcessors(AnnotationProcessor... annotationProcessors) {
+    Preconditions.checkState(
+        taskBuilder.getInputs().getProcessorsList().isEmpty(), "processors already set");
+    HashSet<String> processorClasses = new HashSet<>();
     taskBuilder
-        .getInfoBuilder()
-        .getPluginsBuilder()
-        .addAllAnnotationProcessors(Arrays.asList(annotationProcessors));
+        .getInputsBuilder()
+        .addAllProcessorpaths(
+            Stream.of(annotationProcessors)
+                .peek(it -> processorClasses.add(it.processClass()))
+                .flatMap(it -> it.processorPath().stream())
+                .distinct()
+                .collect(Collectors.toList()))
+        .addAllProcessors(processorClasses);
   }
 
   public void addDirectDependencies(Dep... dependencies) {
diff --git a/src/test/kotlin/io/bazel/kotlin/builder/tasks/jvm/KotlinBuilderJvmKaptTest.java b/src/test/kotlin/io/bazel/kotlin/builder/tasks/jvm/KotlinBuilderJvmKaptTest.java
index c3ca842..553d560 100644
--- a/src/test/kotlin/io/bazel/kotlin/builder/tasks/jvm/KotlinBuilderJvmKaptTest.java
+++ b/src/test/kotlin/io/bazel/kotlin/builder/tasks/jvm/KotlinBuilderJvmKaptTest.java
@@ -15,10 +15,10 @@
  */
 package io.bazel.kotlin.builder.tasks.jvm;
 
-import io.bazel.kotlin.builder.Dep;
+import io.bazel.kotlin.builder.Deps.AnnotationProcessor;
+import io.bazel.kotlin.builder.Deps.Dep;
 import io.bazel.kotlin.builder.KotlinBuilderJvmTestTask;
 import io.bazel.kotlin.builder.KotlinBuilderResource;
-import io.bazel.kotlin.model.AnnotationProcessor;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -38,11 +38,10 @@
           "external/io_bazel_rules_kotlin_com_google_auto_value_auto_value"
               + "/jar/io_bazel_rules_kotlin_com_google_auto_value_auto_value.jar");
   private static final AnnotationProcessor AUTO_VALUE_ANNOTATION_PROCESSOR =
-      AnnotationProcessor.newBuilder()
-          .setLabel("autovalue")
-          .setProcessorClass("com.google.auto.value.processor.AutoValueProcessor")
-          .addAllClasspath(
-              Dep.classpathOf(AUTO_VALUE, KOTLIN_ANNOTATIONS).collect(Collectors.toList()))
+      AnnotationProcessor.builder()
+          .processClass("com.google.auto.value.processor.AutoValueProcessor")
+          .processorPath(
+              Dep.classpathOf(AUTO_VALUE, KOTLIN_ANNOTATIONS).collect(Collectors.toSet()))
           .build();
 
   @Rule public KotlinBuilderJvmTestTask ctx = new KotlinBuilderJvmTestTask();
diff --git a/third_party/dependencies.yaml b/third_party/dependencies.yaml
index 6414939..c5bca82 100644
--- a/third_party/dependencies.yaml
+++ b/third_party/dependencies.yaml
@@ -20,10 +20,6 @@
       modules: ["java", "java-util"]
       lang: "java"
       version: "3.6.0"
-  com.google.code.gson:
-    gson:
-      lang: "java"
-      version: "2.8.4"
   com.google.guava:
     guava:
       lang: "java"
diff --git a/third_party/jvm/com/google/code/gson/BUILD b/third_party/jvm/com/google/code/gson/BUILD
index 0494dae..faeb2a7 100644
--- a/third_party/jvm/com/google/code/gson/BUILD
+++ b/third_party/jvm/com/google/code/gson/BUILD
@@ -5,7 +5,7 @@
         "//external:jar/io_bazel_rules_kotlin_com/google/code/gson/gson"
     ],
     visibility = [
-        "//visibility:public"
+        "//third_party/jvm:__subpackages__"
     ]
 )
 
diff --git a/third_party/jvm/workspace.bzl b/third_party/jvm/workspace.bzl
index e0ae5a3..fc0c2a1 100644
--- a/third_party/jvm/workspace.bzl
+++ b/third_party/jvm/workspace.bzl
@@ -70,7 +70,7 @@
     {"artifact": "com.google.auto.value:auto-value:1.5.3", "lang": "java", "sha1": "514df6a7c7938de35c7f68dc8b8f22df86037f38", "sha256": "238d3b7535096d782d08576d1e42f79480713ff0794f511ff2cc147363ec072d", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/google/auto/value/auto-value/1.5.3/auto-value-1.5.3.jar", "source": {"sha1": "1bb4def82e18be0b6a58ab089fba288d712db6cb", "sha256": "7c9adb9f49a4f07e226778951e087da85759a9ab53ac375f9d076de6dc84ca2b", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/google/auto/value/auto-value/1.5.3/auto-value-1.5.3-sources.jar"} , "name": "io_bazel_rules_kotlin_com_google_auto_value_auto_value", "actual": "@io_bazel_rules_kotlin_com_google_auto_value_auto_value//jar", "bind": "jar/io_bazel_rules_kotlin_com/google/auto/value/auto_value"},
     {"artifact": "com.google.auto:auto-common:0.8", "lang": "java", "sha1": "c6f7af0e57b9d69d81b05434ef9f3c5610d498c4", "sha256": "97db1709f57b91b32edacb596ef4641872f227b7d99ad90e467f0d77f5ba134a", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/google/auto/auto-common/0.8/auto-common-0.8.jar", "source": {"sha1": "24705cafc9997c5eb6ae3270bd6234fdf9912bad", "sha256": "1e258bc08963dc8ffdcf22efa04b9fea6886761e077fc126ebacf92d11c9abec", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/google/auto/auto-common/0.8/auto-common-0.8-sources.jar"} , "name": "io_bazel_rules_kotlin_com_google_auto_auto_common", "actual": "@io_bazel_rules_kotlin_com_google_auto_auto_common//jar", "bind": "jar/io_bazel_rules_kotlin_com/google/auto/auto_common"},
     {"artifact": "com.google.code.findbugs:jsr305:1.3.9", "lang": "java", "sha1": "40719ea6961c0cb6afaeb6a921eaa1f6afd4cfdf", "sha256": "905721a0eea90a81534abb7ee6ef4ea2e5e645fa1def0a5cd88402df1b46c9ed", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar", "name": "io_bazel_rules_kotlin_com_google_code_findbugs_jsr305", "actual": "@io_bazel_rules_kotlin_com_google_code_findbugs_jsr305//jar", "bind": "jar/io_bazel_rules_kotlin_com/google/code/findbugs/jsr305"},
-    {"artifact": "com.google.code.gson:gson:2.8.4", "lang": "java", "sha1": "d0de1ca9b69e69d1d497ee3c6009d015f64dad57", "sha256": "53bc5fe7644db908e6071d6c8b59059acadce7fc14217933d7251994e8673104", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/google/code/gson/gson/2.8.4/gson-2.8.4.jar", "source": {"sha1": "6b1d345789e396d4342821ce01ddfb11dbdd50cc", "sha256": "32821f053a181c3568ceeeff571e54de9f68e1bca99f92e37cf966a5583b8637", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/google/code/gson/gson/2.8.4/gson-2.8.4-sources.jar"} , "name": "io_bazel_rules_kotlin_com_google_code_gson_gson", "actual": "@io_bazel_rules_kotlin_com_google_code_gson_gson//jar", "bind": "jar/io_bazel_rules_kotlin_com/google/code/gson/gson"},
+    {"artifact": "com.google.code.gson:gson:2.7", "lang": "java", "sha1": "751f548c85fa49f330cecbb1875893f971b33c4e", "sha256": "2d43eb5ea9e133d2ee2405cc14f5ee08951b8361302fdd93494a3a997b508d32", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/google/code/gson/gson/2.7/gson-2.7.jar", "source": {"sha1": "bbb63ca253b483da8ee53a50374593923e3de2e2", "sha256": "2d3220d5d936f0a26258aa3b358160741a4557e046a001251e5799c2db0f0d74", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/google/code/gson/gson/2.7/gson-2.7-sources.jar"} , "name": "io_bazel_rules_kotlin_com_google_code_gson_gson", "actual": "@io_bazel_rules_kotlin_com_google_code_gson_gson//jar", "bind": "jar/io_bazel_rules_kotlin_com/google/code/gson/gson"},
     {"artifact": "com.google.dagger:dagger-compiler:2.16", "lang": "java", "sha1": "203235b0c6875c39a0b5053dfc2f043acab04acf", "sha256": "723dca807605ddc82cd86c4e334493789ad7fb3fe863b264a8853611c89baf3d", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/google/dagger/dagger-compiler/2.16/dagger-compiler-2.16.jar", "source": {"sha1": "7ceeb0333370b3f0c28f4b23b1db72d8aae5efa3", "sha256": "05dbe0867bd1efce9a446359d30a0ad2bfe0407b1afd2b31a3058944d2bf3a7d", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/google/dagger/dagger-compiler/2.16/dagger-compiler-2.16-sources.jar"} , "name": "io_bazel_rules_kotlin_com_google_dagger_dagger_compiler", "actual": "@io_bazel_rules_kotlin_com_google_dagger_dagger_compiler//jar", "bind": "jar/io_bazel_rules_kotlin_com/google/dagger/dagger_compiler"},
     {"artifact": "com.google.dagger:dagger-producers:2.16", "lang": "java", "sha1": "4e084a99b71a31e7079603c9675cb4994aff1344", "sha256": "97737907bde6e94cfa90883fa2a8ff4765400b9561bdcb4d83fe475ddbaf22af", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/google/dagger/dagger-producers/2.16/dagger-producers-2.16.jar", "source": {"sha1": "b477b4eebb171e718c7c9c4e4968913e50cf8e52", "sha256": "93838ce482666e54ed7a10d97558db99fce7c761392db44c259805e66664f384", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/google/dagger/dagger-producers/2.16/dagger-producers-2.16-sources.jar"} , "name": "io_bazel_rules_kotlin_com_google_dagger_dagger_producers", "actual": "@io_bazel_rules_kotlin_com_google_dagger_dagger_producers//jar", "bind": "jar/io_bazel_rules_kotlin_com/google/dagger/dagger_producers"},
     {"artifact": "com.google.dagger:dagger-spi:2.16", "lang": "java", "sha1": "26da9b6bf60185ca6f42da51bc20d93b2c825661", "sha256": "1b14f73b7c1088ab399f9fcf9f98aecba7a51d9fbfeeb63c1ad5dab9aadbef86", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/google/dagger/dagger-spi/2.16/dagger-spi-2.16.jar", "source": {"sha1": "17302c42cf920a1af28c8400b39462a78b63f549", "sha256": "62442cb1017f3498a2e2528fe5ac5d965f51e65090fa21cf0df01fa240e1ab07", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/google/dagger/dagger-spi/2.16/dagger-spi-2.16-sources.jar"} , "name": "io_bazel_rules_kotlin_com_google_dagger_dagger_spi", "actual": "@io_bazel_rules_kotlin_com_google_dagger_dagger_spi//jar", "bind": "jar/io_bazel_rules_kotlin_com/google/dagger/dagger_spi"},