Java Reference
In-Depth Information
Table A.1
maven-bundle-plugin defaults (continued)
OSGi header
Maven metadata
Bundle-Vendor
${project.organization.name}
Export-Package
All Java packages in the current project (except *.internal.* and
*.impl.*)
Private-Package
All Java packages in the current project
All project resources in the current project (with property substitution)
Include-Resource
Although these defaults are usually enough for most Maven projects, you'll occasion-
ally want to tweak or add additional instructions to fine-tune the bundling process.
Because the maven-bundle-plugin uses bnd, you can use the exact same instructions
covered in the first part of this appendix. Let's look at a real-world example. The fol-
lowing listing contains a customized maven-bundle-plugin configuration taken from
the Google Guice project.
Listing A.1 Google-Guice maven-bundle-plugin configuration
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.1.0</version>
<configuration>
<instructions>
<module>com.google.inject</module>
<_include>-${project.basedir}/build.properties</_include>
<Bundle-Copyright>Copyright (C) 2006 Google Inc.</Bundle-Copyright>
<Bundle-DocURL>http://code.google.com/p/google-guice/</Bundle-DocURL>
<Bundle-Name>${project.artifactId}</Bundle-Name>
<Bundle-SymbolicName>$(module)</Bundle-SymbolicName>
<Bundle-RequiredExecutionEnvironment>
J2SE-1.5,JavaSE-1.6
</Bundle-RequiredExecutionEnvironment>
<Import-Package>!com.google.inject.*,*</Import-Package>
<_exportcontents>
!*.internal.*,$(module).*;version=${guice.api.version}
</_exportcontents>
<_versionpolicy>
[$(version;==;$(@)),$(version;+;$(@)))
</_versionpolicy>
<_nouses>true</_nouses>
<_removeheaders>
Embed-Dependency,Embed-Transitive,
Built-By,Tool,Created-By,Build-Jdk,
Originally-Created-By,Archiver-Version,
Include-Resource,Private-Package,
Ignore-Package,Bnd-LastModified
</_removeheaders>
</instructions>
</configuration>
 
Search WWH ::




Custom Search