Skip to content

Commit

Permalink
Fix LOGBACK-1728: Incorrect OSGi execution-environment requirements
Browse files Browse the repository at this point in the history
Remove the explicitly specified, but out dated,
'Bundle-RequiredExecutionEnvironment: JavaSE-1.6' entry and let the
maven-bundle-plugin instead add a automatically computed ee-requirement
(therefore remove the '_noee' instruction). This ensures the
OSGi-ExecutionEnvironment metadata are always up to date.

Remove all other explicitly configuration that can be derived
automatically and is not necessary, like more Import-Package values or
'_failok'.
Some of the explicitly imported packages are not even referenced in the
code.

Fixes https://jira.qos.ch/browse/LOGBACK-1728

Signed-off-by: Hannes Wellmann <wellmann.hannes1@gmx.net>
  • Loading branch information
HannesWell authored and ceki committed Mar 23, 2023
1 parent ad88c19 commit fccf9e6
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 18 deletions.
4 changes: 0 additions & 4 deletions logback-access/pom.xml
Expand Up @@ -128,7 +128,6 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<executions>
<execution>
<id>bundle-manifest</id>
Expand All @@ -149,13 +148,10 @@
<Import-Package>
ch.qos.logback.core.rolling,
ch.qos.logback.core.rolling.helper,
jakarta.servlet.*;version="4.0.0",
org.apache.catalina.*;version="${tomcat.version}";resolution:=optional,
org.eclipse.jetty.*;version="${jetty.version}";resolution:=optional,
*
</Import-Package>
<Bundle-RequiredExecutionEnvironment>JavaSE-1.6
</Bundle-RequiredExecutionEnvironment>
</instructions>
</configuration>
</plugin>
Expand Down
8 changes: 0 additions & 8 deletions logback-classic/pom.xml
Expand Up @@ -307,7 +307,6 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<executions>
<execution>
<id>bundle-manifest</id>
Expand All @@ -319,8 +318,6 @@
</executions>
<configuration>
<instructions>
<_noee>true</_noee> <!-- Jigsaw -->
<_failok>true</_failok> <!-- Jigsaw -->
<Export-Package>ch.qos.logback.classic*, org.slf4j.impl;version=${slf4j.version}</Export-Package>
<!-- LB-CLASSIC It is necessary to specify the rolling
file packages as classes are created via IOC (xml
Expand All @@ -330,16 +327,11 @@
sun.reflect;resolution:=optional,
jakarta.*;resolution:=optional,
org.xml.*;resolution:=optional,
org.slf4j,
org.slf4j.spi,
org.slf4j.event,
ch.qos.logback.core.rolling,
ch.qos.logback.core.rolling.helper,
ch.qos.logback.core.util,
ch.qos.logback.core.read,
*
</Import-Package>
<Bundle-RequiredExecutionEnvironment>JavaSE-1.6</Bundle-RequiredExecutionEnvironment>
<!-- Needed to integrate ServiceLoader mechanism with OSGi -->
<Require-Capability>osgi.extender; filter:="(osgi.extender=osgi.serviceloader.registrar)"</Require-Capability>
<Provide-Capability>osgi.serviceloader;osgi.serviceloader=org.slf4j.spi.SLF4JServiceProvider</Provide-Capability>
Expand Down
5 changes: 0 additions & 5 deletions logback-core/pom.xml
Expand Up @@ -127,7 +127,6 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>

<executions>
<execution>
Expand All @@ -140,8 +139,6 @@
</executions>
<configuration>
<instructions>
<_noee>true</_noee> <!-- Jigsaw -->
<_failok>true</_failok> <!-- Jigsaw -->
<Export-Package>ch.qos.logback.core.*</Export-Package>
<Import-Package>
jakarta.*;resolution:=optional,
Expand All @@ -151,8 +148,6 @@
org.codehaus.commons.compiler;resolution:=optional,
*
</Import-Package>
<Bundle-RequiredExecutionEnvironment>JavaSE-1.6
</Bundle-RequiredExecutionEnvironment>
</instructions>
</configuration>
</plugin>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -95,7 +95,7 @@
<maven-release-plugin.version>3.0.0-M4</maven-release-plugin.version>
<maven-deploy-plugin.version>3.0.0-M1</maven-deploy-plugin.version>
<maven-dependency-plugin.version>3.2.0</maven-dependency-plugin.version>
<maven-bundle-plugin.version>5.1.6</maven-bundle-plugin.version>
<maven-bundle-plugin.version>5.1.8</maven-bundle-plugin.version>
<maven-antrun-plugin.version>3.1.0</maven-antrun-plugin.version>
<ant.version>1.10.12</ant.version>
<cobertura.maven.plugin.version>2.7</cobertura.maven.plugin.version>
Expand Down

0 comments on commit fccf9e6

Please sign in to comment.