blob: d931f306747aca02c095cc990792542bac75b1ec [file] [log] [blame]
Daniele Morocc41a942020-02-03 23:33:55 -08001load("//tools/build/bazel:osgi_java_library.bzl", "wrapped_osgi_jar")
2
3# This OSGi bundle is needed to import extra packages on log4j2 library
4
5# To include other packages, specify them as comma separated list.
6# As reference for packages that can be imported see:
7# https://github.com/ops4j/org.ops4j.pax.logging/blob/master/pax-logging-log4j2-extra/osgi.bnd
8IMPORT_PACKAGES = "org.apache.kafka.clients.producer,org.apache.kafka.common.serialization"
9
10# An empty OSGi jar bundle including a Manifest that will be merged with
11# the specified fragment_host bundle.
12wrapped_osgi_jar(
13 name = "onos-log4j2-extra",
14 fragment_host = "org.ops4j.pax.logging.pax-logging-log4j2",
15 generate_pom = False,
16 import_packages = IMPORT_PACKAGES,
17 jar = ":empty-log4j2-extra-jar",
18 visibility = ["//visibility:public"],
19 deps = [],
20)
21
22# An empty jar so we can wrap it inside an OSGi bundle.
23# The parameter resource_strip_prefix is needed to not export packages in the OSGi bundle.
24java_library(
25 name = "empty-log4j2-extra-jar",
26 resource_strip_prefix = "tools/package/log4j2-extra",
27 resources = ["empty.txt"],
28)