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 ed49e46 commit 52cf6cd
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
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<executions>
<execution>
<id>bundle-manifest</id>
Expand All @@ -148,13 +147,10 @@
<Import-Package>
ch.qos.logback.core.rolling,
ch.qos.logback.core.rolling.helper,
javax.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
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<executions>
<execution>
<id>bundle-manifest</id>
Expand All @@ -315,8 +314,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 @@ -326,16 +323,11 @@
sun.reflect;resolution:=optional,
javax.*;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
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>

<executions>
<execution>
Expand All @@ -141,8 +140,6 @@
</executions>
<configuration>
<instructions>
<_noee>true</_noee> <!-- Jigsaw -->
<_failok>true</_failok> <!-- Jigsaw -->
<Export-Package>ch.qos.logback.core.*</Export-Package>
<Import-Package>
javax.*;resolution:=optional,
Expand All @@ -152,8 +149,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
Original file line number Diff line number Diff line change
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 52cf6cd

Please sign in to comment.