Bnd tool maven plugin
A bundle is a component and should reflect an implementation of a public API; this model requires that you think about what goes in there and what does not go in there. Adding transitive dependencies inside this bundle tends to create very complex systems that destroy the benefits of OSGi. To use this plugin, very little information is required by bndlib. As part of the Maven integration, the plugin tries to set reasonable defaults based on the POM for various instructions.
The is computed using the shared Maven2OsgiConverter component, which uses the following algorithm:. From a bndlib perspective, this is the wrong default. An exported package is an expensive thing to have and the philosophy of bndlib is to make these expensive choices explicit, this is the reason the bndlib default is to make nothing exported, especially because good bundles should have no or very few exports.
The Log Service project is comprised of a single package: org. 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:. The maven-jar-plugin can then be used to add this manifest to the final artifact. For those who are familiar with maven will find it easier to read and manipulate manually.
You can add a Maven BND repository to your project as follows:. The the contents of the index file central. You can do most of the actions the bndtool does using MVN plugins mvn plugins. This requires you adding an additional pom file in your project to company the bnd configuration. Here are some of the important ones:. Builds all the projects in a workspace and runs the integration test projects name ending with test. You can export all the executable files for.
Bnd tools repositories BND tool requires a set of repositories where resolution process can find the dependencies.
YourKit supports open source projects with its full-featured Java Profiler. NET Profiler , innovative and intelligent tools for profiling Java and. NET applications. Skip to content. Star View license. Branches Tags. Could not load branches. Could not load tags. Latest commit. Git stats 14, commits. As part of the Maven integration, the plugin tries to set reasonable defaults for various instructions.
For example:. Since 2. Any exported packages are also imported by default, to ensure a consistent class space. Additionally, it generates imports for every export to ensure package substitutability, which is very important when working with collaborating services. It is possible to override any of these values except Bundle-ManifestVersion just by specifying the desired value in the plugin configuration section of the POM file.
The first step in the process of using the plugin is downloading and installing the latest version of the Maven2 runtime.
The latest Maven2 release and instuctions for getting started with Maven2 can be found at the Maven website. Consider this more real-world example using Felix' Log Service implementation. The Log Service project is comprised of a single package: org. 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:. This is useful in this case because now the bundle can resolve without having to download the entire compendium bundle. If you want to keep your project packaging type for example "jar" but would like to add OSGi metadata you can use the manifest goal to generate a bundle manifest. The maven-jar-plugin can then be used to add this manifest to the final artifact. If you want to use packaging types other than "jar" and "bundle" then you also need to enable support for them in the bundleplugin configuration, for example if you want to use the plugin with WAR files:.
MF by default unless you choose a different manifestLocation in the maven-bundle-plugin configuration. Continuing with our WAR example:. The plugin is hosted at the Apache Felix project. The following steps describe how to build and install the plugin into your local Maven2 repository. Using Maven2, build and install the maven-bundle-plugin by issuing the following Maven2 command in the project directory that was created as a result of the previous step. The maven-bundle-plugin also provides additional functionality via some Maven goals.
Command-line execution of a goal is performed as follows:. Version 2 of the bundleplugin now supports the same style of filter clauses in excludeDependencies as Embed-Dependency. There are also new instructions available from the underlying BND tool, which continues to be improved independently; for the latest see BND documentation.
You can also use standard Java regexp constructs. There is no need to escape the.
0コメント