Re-attach OSGI headers to lite,core, and util. This information was dropped in the move from maven to bazel.

PiperOrigin-RevId: 518267412
diff --git a/build_defs/java_opts.bzl b/build_defs/java_opts.bzl
index 8e0fb0a..e9c0407 100644
--- a/build_defs/java_opts.bzl
+++ b/build_defs/java_opts.bzl
@@ -2,6 +2,8 @@
 
 load("@rules_java//java:defs.bzl", "java_library")
 load("@rules_jvm_external//:defs.bzl", "java_export")
+load("//java/osgi:osgi.bzl", "osgi_java_library")
+load("//:protobuf_version.bzl", "PROTOBUF_JAVA_VERSION")
 
 JAVA_OPTS = [
     "-source 8",
@@ -9,6 +11,9 @@
     "-Xep:Java8ApiChecker:ERROR",
 ]
 
+BUNDLE_DOC_URL = "https://developers.google.com/protocol-buffers/"
+BUNDLE_LICENSE = "https://opensource.org/licenses/BSD-3-Clause"
+
 def protobuf_java_export(**kwargs):
     java_export(
         javacopts = JAVA_OPTS,
@@ -20,3 +25,53 @@
         javacopts = JAVA_OPTS,
         **kwargs
     )
+
+def protobuf_versioned_java_library(
+        bundle_description,
+        bundle_name,
+        bundle_symbolic_name,
+        bundle_additional_imports = [],
+        bundle_additional_exports = [],
+        **kwargs):
+    """Extends `java_library` to add OSGi headers to the MANIFEST.MF using bndlib
+
+    This macro should be usable as a drop-in replacement for java_library.
+
+    The additional arguments are given the bndlib tool to generate an OSGi-compliant manifest file.
+    See [bnd documentation](https://bnd.bndtools.org/chapters/110-introduction.html)
+
+    Takes all the args that are standard for a java_library target plus the following.
+    Args:
+        bundle_description: (required) The Bundle-Description header defines a short
+            description of this bundle.
+        bundle_name: (required) The Bundle-Name header defines a readable name for this
+            bundle. This should be a short, human-readable name that can
+            contain spaces.
+        bundle_symbolic_name: (required) The Bundle-SymbolicName header specifies a
+            non-localizable name for this bundle. The bundle symbolic name
+            together with a version must identify a unique bundle though it can
+            be installed multiple times in a framework. The bundle symbolic
+            name should be based on the reverse domain name convention.
+        bundle_additional_exports: The Export-Package header contains a
+            declaration of exported packages. These are additional export
+            package statements to be added before the default wildcard export
+            "*;version={$Bundle-Version}".
+        bundle_additional_imports: The Import-Package header declares the
+            imported packages for this bundle. These are additional import
+            package statements to be added before the default wildcard import
+            "*".
+        **kwargs: Additional key-word arguments that are passed to the internal
+            java_library target.
+    """
+    osgi_java_library(
+        javacopts = JAVA_OPTS,
+        bundle_doc_url = BUNDLE_DOC_URL,
+        bundle_license = BUNDLE_LICENSE,
+        bundle_version = PROTOBUF_JAVA_VERSION,
+        bundle_description = bundle_description,
+        bundle_name = bundle_name,
+        bundle_symbolic_name = bundle_symbolic_name,
+        bundle_additional_exports = bundle_additional_exports,
+        bundle_additional_imports = bundle_additional_imports + ["sun.misc;resolution:=optional"],
+        **kwargs
+    )
diff --git a/java/core/BUILD.bazel b/java/core/BUILD.bazel
index f08cf4a..49bf0e0 100644
--- a/java/core/BUILD.bazel
+++ b/java/core/BUILD.bazel
@@ -2,7 +2,7 @@
 load("@rules_java//java:defs.bzl", "java_lite_proto_library", "java_proto_library")
 load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
 load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain", "proto_library")
-load("//build_defs:java_opts.bzl", "protobuf_java_export", "protobuf_java_library")
+load("//build_defs:java_opts.bzl", "protobuf_java_export", "protobuf_java_library", "protobuf_versioned_java_library")
 load("//conformance:defs.bzl", "conformance_test")
 load("//:protobuf.bzl", "internal_gen_well_known_protos_java")
 load("//:protobuf_version.bzl", "PROTOBUF_JAVA_VERSION")
@@ -121,11 +121,16 @@
 )
 
 # Should be used as `//java/lite`.
-protobuf_java_library(
+protobuf_versioned_java_library(
     name = "lite",
     srcs = LITE_SRCS + [
         ":gen_well_known_protos_javalite",
     ],
+    bundle_description = "Lite version of Protocol Buffers library. This " +
+                         "version is optimized for code size, but does not " +
+                         "guarantee API/ABI stability.",
+    bundle_name = "Protocol Buffers [Lite]",
+    bundle_symbolic_name = "com.google.protobuf",
     visibility = [
         "//java/lite:__pkg__",
     ],
@@ -166,7 +171,7 @@
     ],
 )
 
-protobuf_java_library(
+protobuf_versioned_java_library(
     name = "core",
     srcs = glob(
         [
@@ -176,6 +181,11 @@
     ) + [
         ":gen_well_known_protos_java",
     ],
+    bundle_description = "Core Protocol Buffers library. Protocol Buffers " +
+                         "are a way of encoding structured data in an " +
+                         "efficient yet extensible format.",
+    bundle_name = "Protocol Buffers [Core]",
+    bundle_symbolic_name = "com.google.protobuf",
     visibility = ["//visibility:public"],
     exports = [
         ":lite_runtime_only",
diff --git a/java/osgi/BUILD.bazel b/java/osgi/BUILD.bazel
new file mode 100644
index 0000000..223e6fe
--- /dev/null
+++ b/java/osgi/BUILD.bazel
@@ -0,0 +1,16 @@
+load("@rules_java//java:defs.bzl", "java_binary")
+
+package(
+    default_visibility = ["//java:__subpackages__"],
+)
+
+java_binary(
+    name = "osgi_wrapper",
+    srcs = ["OsgiWrapper.java"],
+    main_class = "com.google.protobuf.osgi.OsgiWrapper",
+    deps = [
+        "@maven//:biz_aQute_bnd_biz_aQute_bndlib",
+        "@maven//:com_google_guava_guava",
+        "@maven//:info_picocli_picocli",
+    ],
+)
diff --git a/java/osgi/OsgiWrapper.java b/java/osgi/OsgiWrapper.java
new file mode 100644
index 0000000..efff06b
--- /dev/null
+++ b/java/osgi/OsgiWrapper.java
@@ -0,0 +1,166 @@
+// Protocol Buffers - Google's data interchange format
+// Copyright 2008 Google Inc.  All rights reserved.
+// https://developers.google.com/protocol-buffers/
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+package com.google.protobuf.osgi;
+
+import aQute.bnd.osgi.Analyzer;
+import aQute.bnd.osgi.Jar;
+import java.io.File;
+import java.util.Arrays;
+import java.util.concurrent.Callable;
+import java.util.jar.Manifest;
+import java.util.stream.Collectors;
+import picocli.CommandLine;
+import picocli.CommandLine.Command;
+import picocli.CommandLine.Option;
+
+/** Java binary that runs bndlib to analyze a jar file to generate OSGi bundle manifest. */
+@Command(name = "osgi_wrapper")
+public final class OsgiWrapper implements Callable<Integer> {
+  private static final String REMOVEHEADERS =
+      Arrays.stream(
+              new String[] {
+                "Embed-Dependency",
+                "Embed-Transitive",
+                "Built-By",
+                // "Tool",
+                "Created-By",
+                // "Build-Jdk",
+                "Originally-Created-By",
+                "Archiver-Version",
+                "Include-Resource",
+                "Private-Package",
+                "Ignore-Package",
+                // "Bnd-LastModified",
+                "Target-Label"
+              })
+          .collect(Collectors.joining(","));
+
+  @Option(
+      names = {"--input_jar"},
+      description = "The jar file to wrap with OSGi metadata")
+  private File inputJar;
+
+  @Option(
+      names = {"--output_jar"},
+      description = "Output path to the wrapped jar")
+  private File outputJar;
+
+  @Option(
+      names = {"--classpath"},
+      description = "The classpath that contains dependencies of the input jar, separated with :")
+  private String classpath;
+
+  @Option(
+      names = {"--bundle_copyright"},
+      description = "Copyright string for the bundle")
+  private String bundleCopyright;
+
+  @Option(
+      names = {"--bundle_description"},
+      description = "Description of the bundle")
+  private String bundleDescription;
+
+  @Option(
+      names = {"--bundle_doc_url"},
+      description = "Documentation URL for the bundle")
+  private String bundleDocUrl;
+
+  @Option(
+      names = {"--bundle_license"},
+      description = "URL for the license of the bundle")
+  private String bundleLicense;
+
+  @Option(
+      names = {"--bundle_name"},
+      description = "The name of the bundle")
+  private String bundleName;
+
+  @Option(
+      names = {"--bundle_symbolic_name"},
+      description = "The symbolic name of the bundle")
+  private String bundleSymbolicName;
+
+  @Option(
+      names = {"--bundle_version"},
+      description = "The version of the bundle")
+  private String bundleVersion;
+
+  @Option(
+      names = {"--export_package"},
+      description = "The exported packages from this bundle")
+  private String exportPackage;
+
+  @Option(
+      names = {"--import_package"},
+      description = "The imported packages from this bundle")
+  private String importPackage;
+
+  @Override
+  public Integer call() throws Exception {
+    Jar bin = new Jar(inputJar);
+
+    Analyzer analyzer = new Analyzer();
+    analyzer.setJar(bin);
+    analyzer.setProperty(Analyzer.BUNDLE_NAME, bundleName);
+    analyzer.setProperty(Analyzer.BUNDLE_SYMBOLICNAME, bundleSymbolicName);
+    analyzer.setProperty(Analyzer.BUNDLE_VERSION, bundleVersion);
+    analyzer.setProperty(Analyzer.IMPORT_PACKAGE, importPackage);
+    analyzer.setProperty(Analyzer.EXPORT_PACKAGE, exportPackage);
+    analyzer.setProperty(Analyzer.BUNDLE_DESCRIPTION, bundleDescription);
+    analyzer.setProperty(Analyzer.BUNDLE_COPYRIGHT, bundleCopyright);
+    analyzer.setProperty(Analyzer.BUNDLE_DOCURL, bundleDocUrl);
+    analyzer.setProperty(Analyzer.BUNDLE_LICENSE, bundleLicense);
+    analyzer.setProperty(Analyzer.REMOVEHEADERS, REMOVEHEADERS);
+
+    if (classpath != null) {
+      for (String dep : Arrays.asList(classpath.split(":"))) {
+        analyzer.addClasspath(new File(dep));
+      }
+    }
+
+    analyzer.analyze();
+
+    Manifest manifest = analyzer.calcManifest();
+
+    if (analyzer.isOk()) {
+      analyzer.getJar().setManifest(manifest);
+      if (analyzer.save(outputJar, true)) {
+        return 0;
+      }
+    }
+    return 1;
+  }
+
+  public static void main(String[] args) {
+    int exitCode = new CommandLine(new OsgiWrapper()).execute(args);
+    System.exit(exitCode);
+  }
+}
diff --git a/java/osgi/osgi.bzl b/java/osgi/osgi.bzl
new file mode 100644
index 0000000..ec0b18a
--- /dev/null
+++ b/java/osgi/osgi.bzl
@@ -0,0 +1,235 @@
+""" Custom rule to generate OSGi Manifest """
+
+load("@rules_java//java:defs.bzl", "java_library")
+
+# Note that this rule is currently agnostic of protobuf concerns and could be
+# pulled out as a general purpose helper to allow migrations from maven to bazel
+# for OSS release builds.
+#
+# There are (at least) 3 things that would nice to fix about this rule:
+# 1. `deps` are captured by wrapping the java_library target into the
+#    osgi_java_library target -- if possible, it would be better to get
+#    the deps from the JavaInfo or some other provider from any java_library
+#    target.
+# 2. imports are probably not being calculated properly for deps that are more
+#    than 1 step deep in the dependency chain. For example: //java:core depends
+#    on //java/core:lite_runtime_only but does not calculate the need for
+#    "sun.misc" like the //java/core:lite target does (even though the same code
+#    is transitively included. Those imports can be explicitly added through
+#    `bundle_additional_imports`, but it would be better if the calculation
+#    applied correctly to transitive dependencies.
+# 3. Versioned imports didn't work properly when an ijar is used as the
+#    "compile_jar". Thus, this rule uses the full jar as the compile_jar,
+#    which is probably sub-optimal.
+def osgi_java_library(
+        name,
+        bundle_description,
+        bundle_doc_url,
+        bundle_license,
+        bundle_name,
+        bundle_symbolic_name,
+        bundle_version,
+        bundle_additional_imports = [],
+        bundle_additional_exports = [],
+        deps = [],
+        exports = [],
+        exported_plugins = [],
+        neverlink = False,
+        runtime_deps = [],
+        visibility = [],
+        **kwargs):
+    """Extends `java_library` to add OSGi headers to the MANIFEST.MF using bndlib
+
+    This macro should be usable as a drop-in replacement for java_library.
+
+    The additional arguments are given the bndlib tool to generate an OSGi-compliant manifest file.
+    See [bnd documentation](https://bnd.bndtools.org/chapters/110-introduction.html)
+
+    Args:
+        name: (required) A unique name for this target.
+        bundle_description: (required) The Bundle-Description header defines a short
+            description of this bundle.
+        bundle_doc_url: (required) The Bundle-DocURL headers must contain a URL pointing
+            to documentation about this bundle.
+        bundle_license: (required) The Bundle-License header provides an optional machine
+            readable form of license information.
+        bundle_name: (required) The Bundle-Name header defines a readable name for this
+            bundle. This should be a short, human-readable name that can
+            contain spaces.
+        bundle_symbolic_name: (required) The Bundle-SymbolicName header specifies a
+            non-localizable name for this bundle. The bundle symbolic name
+            together with a version must identify a unique bundle though it can
+            be installed multiple times in a framework. The bundle symbolic
+            name should be based on the reverse domain name convention.
+        bundle_version: (required) The Bundle-Version header specifies the version string
+            for this bundle. The version string is expected to follow semantic
+            versioning conventions MAJOR.MINOR.PATCH[.BUILD]
+        bundle_additional_exports: The Export-Package header contains a
+            declaration of exported packages. These are additional export
+            package statements to be added before the default wildcard export
+            "*;version={$Bundle-Version}".
+        bundle_additional_imports: The Import-Package header declares the
+            imported packages for this bundle. These are additional import
+            package statements to be added before the default wildcard import
+            "*".
+        deps: The list of libraries to link into this library. See general
+            comments about deps at Typical attributes defined by most build
+            rules. The jars built by java_library rules listed in deps will be
+            on the compile-time classpath of this rule. Furthermore the
+            transitive closure of their deps, runtime_deps and exports will be
+            on the runtime classpath. By contrast, targets in the data
+            attribute are included in the runfiles but on neither the
+            compile-time nor runtime classpath.
+        exports: Exported libraries.
+        exported_plugins: The list of java_plugins (e.g. annotation processors)
+            to export to libraries that directly depend on this library. The
+            specified list of java_plugins will be applied to any library which
+            directly depends on this library, just as if that library had
+            explicitly declared these labels in plugins.
+        neverlink: Whether this library should only be used for compilation and
+            not at runtime. Useful if the library will be provided by the runtime
+            environment during execution. Examples of such libraries are the IDE
+            APIs for IDE plug-ins or tools.jar for anything running on a standard
+            JDK.
+        runtime_deps: Libraries to make available to the final binary or test
+            at runtime only. Like ordinary deps, these will appear on the runtime
+            classpath, but unlike them, not on the compile-time classpath.
+            Dependencies needed only at runtime should be listed here.
+            Dependency-analysis tools should ignore targets that appear in both
+            runtime_deps and deps
+        visibility: The visibility attribute on a target controls whether the
+            target can be used in other packages. See the documentation for
+            visibility.
+        **kwargs: Additional key-word arguments that are passed to the internal
+            java_library target.
+    """
+
+    # Build the private jar without the OSGI manifest
+    private_library_name = "%s-no-manifest-do-not-use" % name
+    java_library(
+        name = private_library_name,
+        deps = deps,
+        runtime_deps = runtime_deps,
+        neverlink = True,
+        exported_plugins = exported_plugins,
+        visibility = ["//visibility:private"],
+        **kwargs
+    )
+
+    # Repackage the jar with an OSGI manifest
+    _osgi_jar(
+        name = name,
+        bundle_description = bundle_description,
+        bundle_doc_url = bundle_doc_url,
+        bundle_license = bundle_license,
+        bundle_name = bundle_name,
+        bundle_symbolic_name = bundle_symbolic_name,
+        bundle_version = bundle_version,
+        export_package = bundle_additional_exports + ["*;version=${Bundle-Version}"],
+        import_package = bundle_additional_imports + ["*"],
+        target = private_library_name,
+        deps = deps,
+        runtime_deps = runtime_deps,
+        exported_plugins = exported_plugins,
+        neverlink = neverlink,
+        exports = exports,
+        visibility = visibility,
+    )
+
+def _run_osgi_wrapper(ctx, input_jar, classpath_jars, output_jar):
+    args = ctx.actions.args()
+    args.add_joined("--classpath", classpath_jars, join_with = ":")
+    args.add("--input_jar", input_jar.path)
+    args.add("--output_jar", output_jar.path)
+    args.add("--bundle_copyright", ctx.attr.bundle_copyright)
+    args.add("--bundle_description", ctx.attr.bundle_description)
+    args.add("--bundle_doc_url", ctx.attr.bundle_doc_url)
+    args.add("--bundle_license", ctx.attr.bundle_license)
+    args.add("--bundle_name", ctx.attr.bundle_name)
+    args.add("--bundle_version", ctx.attr.bundle_version)
+    args.add("--bundle_symbolic_name", ctx.attr.bundle_symbolic_name)
+    args.add_joined("--export_package", ctx.attr.export_package, join_with = ",")
+    args.add_joined("--import_package", ctx.attr.import_package, join_with = ",")
+
+    ctx.actions.run(
+        inputs = [input_jar] + classpath_jars,
+        executable = ctx.executable._osgi_wrapper_exe,
+        arguments = [args],
+        outputs = [output_jar],
+        progress_message = "Generating OSGi bundle Manifest for %s" % input_jar.path,
+    )
+
+def _osgi_jar_impl(ctx):
+    if len(ctx.attr.target[JavaInfo].java_outputs) != 1:
+        fail("osgi_jar rule can only be used on a single java target.")
+    target_java_output = ctx.attr.target[JavaInfo].java_outputs[0]
+
+    if len(target_java_output.source_jars) > 1:
+        fail("osgi_jar rule doesn't know how to deal with more than one source jar.")
+    source_jar = target_java_output.source_jars[0]
+
+    output_jar = ctx.outputs.output_jar
+
+    input_jar = target_java_output.class_jar
+    classpath_jars = ctx.attr.target[JavaInfo].compilation_info.compilation_classpath.to_list()
+
+    _run_osgi_wrapper(ctx, input_jar, classpath_jars, output_jar)
+
+    return [
+        DefaultInfo(
+            files = depset([output_jar]),
+            # Workaround for https://github.com/bazelbuild/bazel/issues/15043
+            # Bazel's native rule such as sh_test do not pick up 'files' in
+            # DefaultInfo for a target in 'data'.
+            data_runfiles = ctx.runfiles([output_jar]),
+        ),
+        JavaInfo(
+            output_jar = output_jar,
+
+            # compile_jar should be an ijar, but using an ijar results in
+            # missing protobuf import version.
+            compile_jar = output_jar,
+            source_jar = source_jar,
+            compile_jdeps = target_java_output.compile_jdeps,
+            generated_class_jar = target_java_output.generated_class_jar,
+            generated_source_jar = target_java_output.generated_source_jar,
+            native_headers_jar = target_java_output.native_headers_jar,
+            manifest_proto = target_java_output.manifest_proto,
+            neverlink = ctx.attr.neverlink,
+            deps = [dep[JavaInfo] for dep in ctx.attr.deps],
+            runtime_deps = [dep[JavaInfo] for dep in ctx.attr.runtime_deps],
+            exports = [exp[JavaInfo] for exp in ctx.attr.exports],
+            exported_plugins = ctx.attr.exported_plugins,
+            jdeps = target_java_output.jdeps,
+        ),
+    ]
+
+_osgi_jar = rule(
+    implementation = _osgi_jar_impl,
+    outputs = {
+        "output_jar": "lib%{name}.jar",
+    },
+    attrs = {
+        "bundle_copyright": attr.string(),
+        "bundle_description": attr.string(),
+        "bundle_doc_url": attr.string(),
+        "bundle_license": attr.string(),
+        "bundle_name": attr.string(),
+        "bundle_version": attr.string(),
+        "bundle_symbolic_name": attr.string(),
+        "export_package": attr.string_list(),
+        "import_package": attr.string_list(),
+        "target": attr.label(),
+        "deps": attr.label_list(),
+        "runtime_deps": attr.label_list(),
+        "exports": attr.label_list(),
+        "neverlink": attr.bool(),
+        "exported_plugins": attr.label_list(),
+        "_osgi_wrapper_exe": attr.label(
+            executable = True,
+            cfg = "exec",
+            allow_files = True,
+            default = Label("//java/osgi:osgi_wrapper"),
+        ),
+    },
+)
diff --git a/java/util/BUILD.bazel b/java/util/BUILD.bazel
index 3d042d3..1bb2358 100644
--- a/java/util/BUILD.bazel
+++ b/java/util/BUILD.bazel
@@ -1,15 +1,18 @@
 load("@rules_java//java:defs.bzl", "java_proto_library")
-load("@rules_pkg//:mappings.bzl", "pkg_filegroup", "pkg_files", "strip_prefix")
+load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix")
 load("@rules_proto//proto:defs.bzl", "proto_library")
-load("//build_defs:java_opts.bzl", "protobuf_java_export", "protobuf_java_library")
+load("//build_defs:java_opts.bzl", "protobuf_java_export", "protobuf_versioned_java_library")
 load("//:protobuf_version.bzl", "PROTOBUF_JAVA_VERSION")
 load("//java/internal:testing.bzl", "junit_tests")
 
-protobuf_java_library(
+protobuf_versioned_java_library(
     name = "util",
     srcs = glob([
         "src/main/java/com/google/protobuf/util/*.java",
     ]),
+    bundle_description = "Utilities for Protocol Buffers",
+    bundle_name = "Protocol Buffers [Util]",
+    bundle_symbolic_name = "com.google.protobuf.util",
     visibility = ["//visibility:public"],
     deps = [
         "//java/core",
diff --git a/maven_install.json b/maven_install.json
index efb3f03..7d033ce 100644
--- a/maven_install.json
+++ b/maven_install.json
@@ -1,13 +1,60 @@
 {
     "dependency_tree": {
         "__AUTOGENERATED_FILE_DO_NOT_MODIFY_THIS_FILE_MANUALLY": "THERE_IS_NO_DATA_ONLY_ZUUL",
-        "__INPUT_ARTIFACTS_HASH": -1875290602,
-        "__RESOLVED_ARTIFACTS_HASH": -1248440885,
+        "__INPUT_ARTIFACTS_HASH": 867318050,
+        "__RESOLVED_ARTIFACTS_HASH": -2034614194,
         "conflict_resolution": {
             "com.google.errorprone:error_prone_annotations:2.5.1": "com.google.errorprone:error_prone_annotations:2.11.0"
         },
         "dependencies": [
             {
+                "coord": "biz.aQute.bnd:biz.aQute.bnd.util:6.4.0",
+                "dependencies": [],
+                "directDependencies": [],
+                "file": "v1/https/repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bnd.util/6.4.0/biz.aQute.bnd.util-6.4.0.jar",
+                "mirror_urls": [
+                    "https://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bnd.util/6.4.0/biz.aQute.bnd.util-6.4.0.jar",
+                    "https://repo.maven.apache.org/maven2/biz/aQute/bnd/biz.aQute.bnd.util/6.4.0/biz.aQute.bnd.util-6.4.0.jar"
+                ],
+                "sha256": "65b5bd4a0fab16812f1800c98ff74a038f37a38bfe899af382efed4efdc1e3e1",
+                "url": "https://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bnd.util/6.4.0/biz.aQute.bnd.util-6.4.0.jar"
+            },
+            {
+                "coord": "biz.aQute.bnd:biz.aQute.bndlib:6.4.0",
+                "dependencies": [
+                    "biz.aQute.bnd:biz.aQute.bnd.util:6.4.0",
+                    "org.osgi:org.osgi.dto:1.0.0",
+                    "org.osgi:org.osgi.framework:1.8.0",
+                    "org.osgi:org.osgi.resource:1.0.0",
+                    "org.osgi:org.osgi.service.log:1.3.0",
+                    "org.osgi:org.osgi.service.repository:1.1.0",
+                    "org.osgi:org.osgi.util.function:1.2.0",
+                    "org.osgi:org.osgi.util.promise:1.2.0",
+                    "org.osgi:org.osgi.util.tracker:1.5.4",
+                    "org.osgi:osgi.annotation:8.0.1",
+                    "org.slf4j:slf4j-api:1.7.25"
+                ],
+                "directDependencies": [
+                    "biz.aQute.bnd:biz.aQute.bnd.util:6.4.0",
+                    "org.osgi:org.osgi.dto:1.0.0",
+                    "org.osgi:org.osgi.framework:1.8.0",
+                    "org.osgi:org.osgi.resource:1.0.0",
+                    "org.osgi:org.osgi.service.log:1.3.0",
+                    "org.osgi:org.osgi.service.repository:1.1.0",
+                    "org.osgi:org.osgi.util.function:1.2.0",
+                    "org.osgi:org.osgi.util.promise:1.2.0",
+                    "org.osgi:org.osgi.util.tracker:1.5.4",
+                    "org.slf4j:slf4j-api:1.7.25"
+                ],
+                "file": "v1/https/repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bndlib/6.4.0/biz.aQute.bndlib-6.4.0.jar",
+                "mirror_urls": [
+                    "https://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bndlib/6.4.0/biz.aQute.bndlib-6.4.0.jar",
+                    "https://repo.maven.apache.org/maven2/biz/aQute/bnd/biz.aQute.bndlib/6.4.0/biz.aQute.bndlib-6.4.0.jar"
+                ],
+                "sha256": "357145074872f9dbf67e629fcd237e6152707e575d735df4535282f9f588d2d8",
+                "url": "https://repo1.maven.org/maven2/biz/aQute/bnd/biz.aQute.bndlib/6.4.0/biz.aQute.bndlib-6.4.0.jar"
+            },
+            {
                 "coord": "com.google.auto.value:auto-value-annotations:1.8.1",
                 "dependencies": [],
                 "directDependencies": [],
@@ -528,6 +575,18 @@
                 "url": "https://repo1.maven.org/maven2/com/sun/jersey/jersey-core/1.19.4/jersey-core-1.19.4.jar"
             },
             {
+                "coord": "info.picocli:picocli:4.6.3",
+                "dependencies": [],
+                "directDependencies": [],
+                "file": "v1/https/repo1.maven.org/maven2/info/picocli/picocli/4.6.3/picocli-4.6.3.jar",
+                "mirror_urls": [
+                    "https://repo1.maven.org/maven2/info/picocli/picocli/4.6.3/picocli-4.6.3.jar",
+                    "https://repo.maven.apache.org/maven2/info/picocli/picocli/4.6.3/picocli-4.6.3.jar"
+                ],
+                "sha256": "b0a5159e926de8084ff066025142270443533656bc599b8bb31d14d11fd138a4",
+                "url": "https://repo1.maven.org/maven2/info/picocli/picocli/4.6.3/picocli-4.6.3.jar"
+            },
+            {
                 "coord": "javax.annotation:javax.annotation-api:1.3.2",
                 "dependencies": [],
                 "directDependencies": [],
@@ -684,6 +743,128 @@
                 "url": "https://repo1.maven.org/maven2/org/objenesis/objenesis/3.2/objenesis-3.2.jar"
             },
             {
+                "coord": "org.osgi:org.osgi.dto:1.0.0",
+                "dependencies": [],
+                "directDependencies": [],
+                "file": "v1/https/repo1.maven.org/maven2/org/osgi/org.osgi.dto/1.0.0/org.osgi.dto-1.0.0.jar",
+                "mirror_urls": [
+                    "https://repo1.maven.org/maven2/org/osgi/org.osgi.dto/1.0.0/org.osgi.dto-1.0.0.jar",
+                    "https://repo.maven.apache.org/maven2/org/osgi/org.osgi.dto/1.0.0/org.osgi.dto-1.0.0.jar"
+                ],
+                "sha256": "cb75f3c7e48e5a31a31df22e26873346f5bf659e2dcab2369e031e4850d2ff43",
+                "url": "https://repo1.maven.org/maven2/org/osgi/org.osgi.dto/1.0.0/org.osgi.dto-1.0.0.jar"
+            },
+            {
+                "coord": "org.osgi:org.osgi.framework:1.8.0",
+                "dependencies": [],
+                "directDependencies": [],
+                "file": "v1/https/repo1.maven.org/maven2/org/osgi/org.osgi.framework/1.8.0/org.osgi.framework-1.8.0.jar",
+                "mirror_urls": [
+                    "https://repo1.maven.org/maven2/org/osgi/org.osgi.framework/1.8.0/org.osgi.framework-1.8.0.jar",
+                    "https://repo.maven.apache.org/maven2/org/osgi/org.osgi.framework/1.8.0/org.osgi.framework-1.8.0.jar"
+                ],
+                "sha256": "ec194b7871af27681716ff05259319a5c3c9b9727e8000e9e832499b93484b4e",
+                "url": "https://repo1.maven.org/maven2/org/osgi/org.osgi.framework/1.8.0/org.osgi.framework-1.8.0.jar"
+            },
+            {
+                "coord": "org.osgi:org.osgi.resource:1.0.0",
+                "dependencies": [],
+                "directDependencies": [],
+                "file": "v1/https/repo1.maven.org/maven2/org/osgi/org.osgi.resource/1.0.0/org.osgi.resource-1.0.0.jar",
+                "mirror_urls": [
+                    "https://repo1.maven.org/maven2/org/osgi/org.osgi.resource/1.0.0/org.osgi.resource-1.0.0.jar",
+                    "https://repo.maven.apache.org/maven2/org/osgi/org.osgi.resource/1.0.0/org.osgi.resource-1.0.0.jar"
+                ],
+                "sha256": "81fc50f1f1d38a4af28e131907d4afe213249aab05060484edca0e60c4af9b4a",
+                "url": "https://repo1.maven.org/maven2/org/osgi/org.osgi.resource/1.0.0/org.osgi.resource-1.0.0.jar"
+            },
+            {
+                "coord": "org.osgi:org.osgi.service.log:1.3.0",
+                "dependencies": [],
+                "directDependencies": [],
+                "file": "v1/https/repo1.maven.org/maven2/org/osgi/org.osgi.service.log/1.3.0/org.osgi.service.log-1.3.0.jar",
+                "mirror_urls": [
+                    "https://repo1.maven.org/maven2/org/osgi/org.osgi.service.log/1.3.0/org.osgi.service.log-1.3.0.jar",
+                    "https://repo.maven.apache.org/maven2/org/osgi/org.osgi.service.log/1.3.0/org.osgi.service.log-1.3.0.jar"
+                ],
+                "sha256": "ff6710c4856d32684cf3ebdc45248f41036ff734f2b03bbc08c4609a61fecfa0",
+                "url": "https://repo1.maven.org/maven2/org/osgi/org.osgi.service.log/1.3.0/org.osgi.service.log-1.3.0.jar"
+            },
+            {
+                "coord": "org.osgi:org.osgi.service.repository:1.1.0",
+                "dependencies": [],
+                "directDependencies": [],
+                "file": "v1/https/repo1.maven.org/maven2/org/osgi/org.osgi.service.repository/1.1.0/org.osgi.service.repository-1.1.0.jar",
+                "mirror_urls": [
+                    "https://repo1.maven.org/maven2/org/osgi/org.osgi.service.repository/1.1.0/org.osgi.service.repository-1.1.0.jar",
+                    "https://repo.maven.apache.org/maven2/org/osgi/org.osgi.service.repository/1.1.0/org.osgi.service.repository-1.1.0.jar"
+                ],
+                "sha256": "c5553e95b459529192433486d4c4cc22ff45a2eae4968484f9f717319264a532",
+                "url": "https://repo1.maven.org/maven2/org/osgi/org.osgi.service.repository/1.1.0/org.osgi.service.repository-1.1.0.jar"
+            },
+            {
+                "coord": "org.osgi:org.osgi.util.function:1.2.0",
+                "dependencies": [
+                    "org.osgi:osgi.annotation:8.0.1"
+                ],
+                "directDependencies": [
+                    "org.osgi:osgi.annotation:8.0.1"
+                ],
+                "file": "v1/https/repo1.maven.org/maven2/org/osgi/org.osgi.util.function/1.2.0/org.osgi.util.function-1.2.0.jar",
+                "mirror_urls": [
+                    "https://repo1.maven.org/maven2/org/osgi/org.osgi.util.function/1.2.0/org.osgi.util.function-1.2.0.jar",
+                    "https://repo.maven.apache.org/maven2/org/osgi/org.osgi.util.function/1.2.0/org.osgi.util.function-1.2.0.jar"
+                ],
+                "sha256": "208819c7c71690c15a6bb8b187474e7f9d0147946b680182a62b9f222ae014ec",
+                "url": "https://repo1.maven.org/maven2/org/osgi/org.osgi.util.function/1.2.0/org.osgi.util.function-1.2.0.jar"
+            },
+            {
+                "coord": "org.osgi:org.osgi.util.promise:1.2.0",
+                "dependencies": [
+                    "org.osgi:org.osgi.util.function:1.2.0",
+                    "org.osgi:osgi.annotation:8.0.1"
+                ],
+                "directDependencies": [
+                    "org.osgi:org.osgi.util.function:1.2.0",
+                    "org.osgi:osgi.annotation:8.0.1"
+                ],
+                "file": "v1/https/repo1.maven.org/maven2/org/osgi/org.osgi.util.promise/1.2.0/org.osgi.util.promise-1.2.0.jar",
+                "mirror_urls": [
+                    "https://repo1.maven.org/maven2/org/osgi/org.osgi.util.promise/1.2.0/org.osgi.util.promise-1.2.0.jar",
+                    "https://repo.maven.apache.org/maven2/org/osgi/org.osgi.util.promise/1.2.0/org.osgi.util.promise-1.2.0.jar"
+                ],
+                "sha256": "fef86e64f584d012a16a0306160764f6179663b90988a226c4641b920f3a4b36",
+                "url": "https://repo1.maven.org/maven2/org/osgi/org.osgi.util.promise/1.2.0/org.osgi.util.promise-1.2.0.jar"
+            },
+            {
+                "coord": "org.osgi:org.osgi.util.tracker:1.5.4",
+                "dependencies": [
+                    "org.osgi:osgi.annotation:8.0.1"
+                ],
+                "directDependencies": [
+                    "org.osgi:osgi.annotation:8.0.1"
+                ],
+                "file": "v1/https/repo1.maven.org/maven2/org/osgi/org.osgi.util.tracker/1.5.4/org.osgi.util.tracker-1.5.4.jar",
+                "mirror_urls": [
+                    "https://repo1.maven.org/maven2/org/osgi/org.osgi.util.tracker/1.5.4/org.osgi.util.tracker-1.5.4.jar",
+                    "https://repo.maven.apache.org/maven2/org/osgi/org.osgi.util.tracker/1.5.4/org.osgi.util.tracker-1.5.4.jar"
+                ],
+                "sha256": "7d78c2cc9bcb6421c24f17aa097866ce8d9115c219a4f8d6cc753bc4dfb97efa",
+                "url": "https://repo1.maven.org/maven2/org/osgi/org.osgi.util.tracker/1.5.4/org.osgi.util.tracker-1.5.4.jar"
+            },
+            {
+                "coord": "org.osgi:osgi.annotation:8.0.1",
+                "dependencies": [],
+                "directDependencies": [],
+                "file": "v1/https/repo1.maven.org/maven2/org/osgi/osgi.annotation/8.0.1/osgi.annotation-8.0.1.jar",
+                "mirror_urls": [
+                    "https://repo1.maven.org/maven2/org/osgi/osgi.annotation/8.0.1/osgi.annotation-8.0.1.jar",
+                    "https://repo.maven.apache.org/maven2/org/osgi/osgi.annotation/8.0.1/osgi.annotation-8.0.1.jar"
+                ],
+                "sha256": "a0e8a4c362bd3600812f37b0ea45fba966c7bc049d01fed56a09ecc74082759e",
+                "url": "https://repo1.maven.org/maven2/org/osgi/osgi.annotation/8.0.1/osgi.annotation-8.0.1.jar"
+            },
+            {
                 "coord": "org.ow2.asm:asm-analysis:7.2",
                 "dependencies": [
                     "org.ow2.asm:asm-tree:7.2",
@@ -767,6 +948,18 @@
                 ],
                 "sha256": "0df97574914aee92fd349d0cb4e00f3345d45b2c239e0bb50f0a90ead47888e0",
                 "url": "https://repo1.maven.org/maven2/org/ow2/asm/asm/9.0/asm-9.0.jar"
+            },
+            {
+                "coord": "org.slf4j:slf4j-api:1.7.25",
+                "dependencies": [],
+                "directDependencies": [],
+                "file": "v1/https/repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar",
+                "mirror_urls": [
+                    "https://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar",
+                    "https://repo.maven.apache.org/maven2/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar"
+                ],
+                "sha256": "18c4a0095d5c1da6b817592e767bb23d29dd2f560ad74df75ff3961dbde25b79",
+                "url": "https://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar"
             }
         ],
         "version": "0.1.0"
diff --git a/protobuf_deps.bzl b/protobuf_deps.bzl
index 92cb765..7a28404 100644
--- a/protobuf_deps.bzl
+++ b/protobuf_deps.bzl
@@ -13,6 +13,8 @@
     "com.google.truth:truth:1.1.2",
     "junit:junit:4.13.2",
     "org.mockito:mockito-core:4.3.1",
+    "biz.aQute.bnd:biz.aQute.bndlib:6.4.0",
+    "info.picocli:picocli:4.6.3",
 ]
 
 def _github_archive(repo, commit, **kwargs):