mirror of https://github.com/qos-ch/slf4j
Fully automate OSGi metadata creation and fix brocken OSGi-metadata in slf4j-api (#330)
* Improve generated OSGi metadata and restore Bundle-SymbolicName Enhance the generated OSGi metadata for all slf4j-modules in the following ways: - Restore the Bundle-SymbolicName, Bundle-Name, Bundle-Vendor and Bundle-DocURL from SLF4J-2.0.5 and before - Removes Export-Package: META-INF.versions.9 - Removes self-Imports of exported package (has to be added again in a follow up, where desired) - Remove unnecessary BND-internal headers Additionally move the maven-bundle-plugin configuration from the execution configuration up into the configuration of the plugin so that it can be easier overwritten in child-modules. Signed-off-by: Hannes Wellmann <wellmann.hannes1@gmx.net> * Automate OSGi metadata creation and restore package-exports of slf4j-api Only use the maven-bundle-plugin to generate all OSGi metadata into slf4j-api's Manifest.MF file. This unifies the resulting MANIFEST.MFs that are currently partly generated and partly statically defined. Furthermore it fixes the following flaws in the currently generated OSGi metadata of slf4j-api: - Import only the exported org.slf4j.spi package (like in slf4j 2.0.5 and before) - Replace the deprecated 'Bundle-RequiredExecutionEnvironment' header by a corresponding required 'osgi.ee' capability Signed-off-by: Hannes Wellmann <wellmann.hannes1@gmx.net> --------- Signed-off-by: Hannes Wellmann <wellmann.hannes1@gmx.net>
This commit is contained in:
parent
a5540ad510
commit
2235d3c698
30
pom.xml
30
pom.xml
|
|
@ -241,6 +241,25 @@
|
|||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<version>${maven-bundle-plugin.version}</version>
|
||||
<configuration>
|
||||
<supportIncrementalBuild>true</supportIncrementalBuild>
|
||||
<!-- populated by the plugin itself -->
|
||||
<instructions>
|
||||
<Bundle-SymbolicName>${replacestring;${project.artifactId};-;.}</Bundle-SymbolicName>
|
||||
<Bundle-Name>${project.artifactId}</Bundle-Name>
|
||||
<Bundle-Vendor>SLF4J.ORG</Bundle-Vendor>
|
||||
<_snapshot/>
|
||||
<_exportcontents>!META-INF.versions.9,*;-noimport:=true</_exportcontents>
|
||||
<Bundle-Description>${project.description}</Bundle-Description>
|
||||
<Bundle-DocURL>${project.url}</Bundle-DocURL>
|
||||
<X-Compile-Source-JDK>${maven.compiler.source}</X-Compile-Source-JDK>
|
||||
<X-Compile-Target-JDK>${maven.compiler.target}</X-Compile-Target-JDK>
|
||||
<Implementation-Version>${project.version}</Implementation-Version>
|
||||
<Implementation-Title>${project.artifactId}</Implementation-Title>
|
||||
<Multi-Release>true</Multi-Release>
|
||||
<_removeheaders>Private-Package,Bundle-SCM, Bundle-Developers, Include-Resource</_removeheaders>
|
||||
</instructions>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>bundle-manifest</id>
|
||||
|
|
@ -248,17 +267,6 @@
|
|||
<goals>
|
||||
<goal>manifest</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<!-- populated by the plugin itself -->
|
||||
<Bundle-Version>${parsedVersion.osgiVersion}</Bundle-Version>
|
||||
<Bundle-Description>${project.description}</Bundle-Description>
|
||||
<X-Compile-Source-JDK>${maven.compiler.source}</X-Compile-Source-JDK>
|
||||
<X-Compile-Target-JDK>${maven.compiler.target}</X-Compile-Target-JDK>
|
||||
<Implementation-Version>${project.version}</Implementation-Version>
|
||||
<Multi-Release>true</Multi-Release>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
|
|
|||
|
|
@ -53,6 +53,20 @@
|
|||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<Import-Package>org.slf4j.spi;version="${range;[===,+);${version;===;${maven_version;${project.version}}}}"</Import-Package>
|
||||
<Require-Capability><![CDATA[
|
||||
osgi.extender;filter:="(&(osgi.extender=osgi.serviceloader.processor)(version>=1.0.0)(!(version>=2.0.0)))",
|
||||
osgi.serviceloader;filter:="(osgi.serviceloader=org.slf4j.spi.SLF4JServiceProvider)";osgi.serviceloader="org.slf4j.spi.SLF4JServiceProvider"
|
||||
]]></Require-Capability>
|
||||
</instructions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
|
||||
</build>
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
Implementation-Title: slf4j-api
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-SymbolicName: slf4j.api
|
||||
Bundle-Name: slf4j-api
|
||||
Bundle-Vendor: SLF4J.ORG
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Export-Package: org.slf4j;version=${parsedVersion.osgiVersion},
|
||||
org.slf4j.spi;version=${parsedVersion.osgiVersion},
|
||||
org.slf4j.helpers;version=${parsedVersion.osgiVersion},
|
||||
org.slf4j.event;version=${parsedVersion.osgiVersion}
|
||||
Import-Package: org.slf4j.spi;version=${parsedVersion.osgiVersion}
|
||||
Require-Capability: osgi.extender;filter:="(&(osgi.extender=osgi.servi
|
||||
celoader.processor)(version>=1.0.0)(!(version>=2.0.0)))",osgi.service
|
||||
loader;filter:="(osgi.serviceloader=org.slf4j.spi.SLF4JServiceProvide
|
||||
r)";osgi.serviceloader="org.slf4j.spi.SLF4JServiceProvider"
|
||||
Loading…
Reference in New Issue