DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
Consider this more real-world example using Felix' Log Service implementation. The Log Service project is comprised of a single package: org.apache.felix.log.impl. It has a dependency on the core OSGi interfaces as well as a dependency on the compendium OSGi interfaces for the specific log service interfaces. The following is its POM file:
| No Format |
|---|
<project> <parent> <modelVersion>4.0.0</modelVersion> <groupId>org.apache.felix</groupId> <artifactId>felix</artifactId> <version>0.8.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion><artifactId>org.apache.felix.log</artifactId> <packaging>bundle</packaging> <name>Apache Felix Log Service</name> <version>0.8.0-SNAPSHOT</version> <description> This bundle provides an implementation of the OSGi R4 Log service. </description> <artifactId>org.apache.felix.log</artifactId> <dependencies> <dependencies> <dependency> <groupId>${pom.groupId}</groupId> <artifactId>org.osgi.core</artifactId> </dependency> <dependency> <groupId>${pom.groupId}</groupId> <artifactId>org.osgi.compendium</artifactId> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <extensions>true</extensions> <configuration> <instructions> <Export-Package>org.osgi.service.log</Export-Package> <Private-Package>org.apache.felix.log.impl</Private-Package> <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName> <Bundle-Activator>${pom.artifactId}.impl.Activator</Bundle-Activator> <Export-Service>org.osgi.service.log.LogService,org.osgi.service.log.LogReaderService</Export-Service> </instructions> </configuration> </plugin> </plugins> </build> <repositories> <repository> <id>apache.snapshots</id> <name>Apache Snapshot Repository</name> <url>http://cvs.apache.org/maven-snapshot-repository</url> </repository> </repositories> </project> |
{Note: The Log Service POM file does not specify the snapshot repository for the plugin because the
Notice that the <Export-Package> instruction specifies that the bundle exports the Log Service package, even though this package is not contained in the bundle project. By declaring this, the plugin will copy the Log Service package into the resulting bundle JAR file. This is useful in this case because now the bundle can resolve without having to download the entire compendium bundle. The resulting manifest for the Log Service bundle looks like this (notice how the imports/exports automatically have version information associated with them, which was obtained from packageinfo files in the source packages):
...