[#154] [#727] Use maven-plugin-plugin to generate OSGi manifest

This commit is contained in:
dantran 2012-11-11 13:35:56 -08:00 committed by Norman Maurer
parent 45de76f58d
commit e236f5b77d
9 changed files with 263 additions and 15 deletions

View File

@ -24,7 +24,7 @@
</parent>
<artifactId>netty</artifactId>
<packaging>jar</packaging>
<packaging>bundle</packaging>
<name>Netty/All-in-One</name>
@ -320,6 +320,25 @@
<locale>en_US</locale>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Import-Package>
!io.netty.*,
sun.misc;resolution:=optional,
*
</Import-Package>
<Export-Package>
!io.netty.example.*,
io.netty.*
</Export-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -24,7 +24,7 @@
</parent>
<artifactId>netty-buffer</artifactId>
<packaging>jar</packaging>
<packaging>bundle</packaging>
<name>Netty/Buffer</name>
@ -35,5 +35,30 @@
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Import-Package>
!io.netty.buffer.*,
sun.misc;resolution:=optional,
*
</Import-Package>
<Export-Package>
io.netty.bufer
</Export-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -24,7 +24,7 @@
</parent>
<artifactId>netty-codec-http</artifactId>
<packaging>jar</packaging>
<packaging>bundle</packaging>
<name>Netty/Codec/HTTP</name>
@ -40,5 +40,37 @@
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Import-Package>
!io.netty.handler.codec.http,
!io.netty.handler.codec.http.multipart,
!io.netty.handler.codec.http.websocket,
!io.netty.handler.codec.rtsp,
!io.netty.handler.codec.spdy,
*
</Import-Package>
<Export-Package>
io.netty.handler.codec.http,
io.netty.handler.codec.http.multipart,
io.netty.handler.codec.http.websocket,
io.netty.handler.codec.rtsp,
io.netty.handler.codec.spdy
</Export-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -24,7 +24,7 @@
</parent>
<artifactId>netty-codec</artifactId>
<packaging>jar</packaging>
<packaging>bundle</packaging>
<name>Netty/Codec</name>
@ -57,5 +57,45 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Import-Package>
!io.netty.handler.codec,
!io.netty.handler.codec.base64,
!io.netty.handler.codec.bytes,
!io.netty.handler.codec.compression,
!io.netty.handler.codec.marshalling,
!io.netty.handler.codec.protobuf,
!io.netty.handler.codec.sctp
!io.netty.handler.codec.serialization,
!io.netty.handler.codec.string,
*
</Import-Package>
<Export-Package>
io.netty.handler.codec,
io.netty.handler.codec.base64,
io.netty.handler.codec.bytes,
io.netty.handler.codec.compression,
io.netty.handler.codec.marshalling,
io.netty.handler.codec.protobuf,
io.netty.handler.codec.sctp
io.netty.handler.codec.serialization,
io.netty.handler.codec.string
</Export-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -17,6 +17,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>io.netty</groupId>
<artifactId>netty-parent</artifactId>
@ -24,7 +25,7 @@
</parent>
<artifactId>netty-common</artifactId>
<packaging>jar</packaging>
<packaging>bundle</packaging>
<name>Netty/Common</name>
@ -67,5 +68,42 @@
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Import-Package>
!io.netty.logging,
!io.netty.monitor,
!io.netty.monitor.spi
!io.netty.util,
!io.netty.util.internal,
!io.netty.util.internal.zlib,
sun.misc;resolution:=optional,
*
</Import-Package>
<Export-Package>
io.netty.logging,
io.netty.monitor,
io.netty.monitor.spi,
io.netty.util,
io.netty.util.internal,
io.netty.util.internal.zlib
</Export-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -24,7 +24,7 @@
</parent>
<artifactId>netty-handler</artifactId>
<packaging>jar</packaging>
<packaging>bundle</packaging>
<name>Netty/Handler</name>
@ -43,7 +43,32 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Import-Package>
!io.netty.handler.logging,
!io.netty.handler.ssl,
!io.netty.handler.stream,
!io.netty.handler.timeout,
*
</Import-Package>
<Export-Package>
io.netty.handler.logging,
io.netty.handler.ssl,
io.netty.handler.stream,
io.netty.handler.timeout
</Export-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>
</project>

View File

@ -24,7 +24,7 @@
</parent>
<artifactId>netty-metrics-yammer</artifactId>
<packaging>jar</packaging>
<packaging>bundle</packaging>
<name>Netty/Yammer Metrics Provider</name>
@ -41,5 +41,29 @@
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Import-Package>
!io.netty.monitor.yammer,
!io.netty.monitor.yammer.spi,
*
</Import-Package>
<Export-Package>
io.netty.monitor.yammer,
io.netty.monitor.yammer.spi
</Export-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>

17
pom.xml
View File

@ -419,6 +419,23 @@
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.7</version>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.7</version>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<_versionpolicy>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy>
</instructions>
</configuration>
</plugin>
<!-- Workaround for the 'M2E plugin execution not covered' problem.
See: http://wiki.eclipse.org/M2E_plugin_execution_not_covered -->

View File

@ -24,7 +24,7 @@
</parent>
<artifactId>netty-transport</artifactId>
<packaging>jar</packaging>
<packaging>bundle</packaging>
<name>Netty/Transport</name>
@ -38,16 +38,44 @@
<build>
<plugins>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<excludes>
<!-- Exclude the com.sun.nio stuff as this is included in the jdk if its supported by the running os -->
<exclude>**/com/**</exclude>
</excludes>
<instructions>
<Import-Package>
!io.netty.bootstrap,
!io.netty.channel,
!io.netty.channel.embedded,
!io.netty.channel.group,
!io.netty.channel.local,
!io.netty.channel.socket,
!io.netty.channel.socket.aio,
!io.netty.channel.socket.nio,
!io.netty.channel.socket.oio,
sun.misc;resolution:=optional,
*
</Import-Package>
<Export-Package>
io.netty.bootstrap,
io.netty.channel,
io.netty.channel.embedded,
io.netty.channel.group,
io.netty.channel.local,
io.netty.channel.socket,
io.netty.channel.socket.aio,
io.netty.channel.socket.nio,
io.netty.channel.socket.oio
</Export-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>
</project>