Make netty-transport-native-epoll-*-linux-x86_64.jar working in OSGi
Motivation: Currenlty, netty-transport-native-epoll-*-linux-x86_64.jar is not packed as OSGi bundle and thus not working in OSGi environment. Modifications: In netty-transport-native-epoll's pom.xml added configuration to attach manifest to the jar with a native library. In netty-common's pom.xml added configuration instruction (DynamicImport-Package) to maven bnd plugin to make sure the native code is loaded from netty-transport-native-epoll bundle. Result: The netty-transport-native-epoll-*-linux-x86_64.jar is a bundle (MANIFEST.MF attached) and the inluced native library can be successfuly loaded in OSGi environment. Fixing #5119
This commit is contained in:
parent
db6b72da19
commit
4c186c4c41
@ -138,6 +138,27 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.felix</groupId>
|
||||||
|
<artifactId>maven-bundle-plugin</artifactId>
|
||||||
|
<version>2.4.0</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>generate-manifest</id>
|
||||||
|
<phase>process-classes</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>manifest</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<instructions>
|
||||||
|
<!-- NativeLibraryLoader can be used to manually load native libraries from other bundles that this bundle does not depend on,
|
||||||
|
hence use DynamicImport-Package instruction to ensure the loading is successful -->
|
||||||
|
<DynamicImport-Package>*</DynamicImport-Package>
|
||||||
|
</instructions>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
@ -105,6 +105,13 @@
|
|||||||
<goal>jar</goal>
|
<goal>jar</goal>
|
||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<archive>
|
||||||
|
<manifest>
|
||||||
|
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
|
||||||
|
</manifest>
|
||||||
|
<index>true</index>
|
||||||
|
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
|
||||||
|
</archive>
|
||||||
<classifier>${epoll.classifier}</classifier>
|
<classifier>${epoll.classifier}</classifier>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
|
Loading…
Reference in New Issue
Block a user