diff --git a/log4j-api/pom.xml b/log4j-api/pom.xml index ecc94af0e60..9c4bdcbd7b7 100644 --- a/log4j-api/pom.xml +++ b/log4j-api/pom.xml @@ -71,6 +71,7 @@ sun.reflect;resolution:=optional, * org.apache.logging.log4j.util.Activator + lazy <_fixupmessages>"Classes found in the wrong directory";is:=warning diff --git a/log4j-core/pom.xml b/log4j-core/pom.xml index d1727d3bd66..46e941da4e9 100644 --- a/log4j-core/pom.xml +++ b/log4j-core/pom.xml @@ -192,6 +192,7 @@ javax.mail.util;version="[1.6,2)";resolution:=optional, sun.reflect;resolution:=optional, * + lazy org.apache.logging.log4j.core.osgi.Activator diff --git a/log4j-slf4j-impl/pom.xml b/log4j-slf4j-impl/pom.xml index c8726f0c016..73029e00ee4 100644 --- a/log4j-slf4j-impl/pom.xml +++ b/log4j-slf4j-impl/pom.xml @@ -111,6 +111,7 @@ org.apache.logging.slf4j, org.slf4j.impl + lazy diff --git a/log4j-slf4j2-impl/pom.xml b/log4j-slf4j2-impl/pom.xml index 8e19cd5a592..65b3d1f0b7c 100644 --- a/log4j-slf4j2-impl/pom.xml +++ b/log4j-slf4j2-impl/pom.xml @@ -108,6 +108,7 @@ org.apache.logging.slf4j, org.slf4j.impl + lazy osgi.extender;filter:="(osgi.extender=osgi.serviceloader.registrar)" osgi.serviceloader;osgi.serviceloader=org.slf4j.spi.SLF4JServiceProvider diff --git a/src/changelog/.2.x.x/1367_Missing-Bundle-Activation-OSGiMetadata.xml b/src/changelog/.2.x.x/1367_Missing-Bundle-Activation-OSGiMetadata.xml new file mode 100644 index 00000000000..10d27565a1f --- /dev/null +++ b/src/changelog/.2.x.x/1367_Missing-Bundle-Activation-OSGiMetadata.xml @@ -0,0 +1,30 @@ + + + + + + + + + Adapt the OSGi metadata of `log4j-api`, `log4j-core`, `log4j-slf4j-impl` and `log4j-slf4j2-impl` to activate the bundle when it is accessed. + To achieve that set the `Bundle-ActivationPolicy` to `lazy` for the log4j bundles. + +