Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame^] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 2 | <html><head><title>Apache Felix</title> |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | <link rel="stylesheet" href="maven-bundle-plugin-bnd_files/site.css" type="text/css" media="all"> |
| 8 | <link rel="stylesheet" href="maven-bundle-plugin-bnd_files/print.html" type="text/css" media="print"> |
| 9 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"></head><body> |
| 10 | <div class="title"> |
| 11 | <img alt="Logo" src="maven-bundle-plugin-bnd_files/apache-felix-small.png" align="right"> |
| 12 | </div> |
| 13 | <div class="menu"> |
| 14 | <ul> |
| 15 | <li><a href="http://cwiki.apache.org/FELIX/index.html">home</a></li> |
| 16 | <li><a href="http://cwiki.apache.org/FELIX/news.html">news</a></li> |
| 17 | <li><a href="http://cwiki.apache.org/FELIX/status.html">status</a></li> |
| 18 | <li><a href="http://cwiki.apache.org/FELIX/license.html">license</a></li> |
| 19 | <li><a href="http://cwiki.apache.org/FELIX/downloads.html">downloads</a></li> |
| 20 | <li><a href="http://cwiki.apache.org/FELIX/documentation.html">documentation</a></li> |
| 21 | <li><a href="http://cwiki.apache.org/FELIX/committers.html">committers</a></li> |
| 22 | <li><a href="http://cwiki.apache.org/FELIX/mailinglists.html">mailing lists</a></li> |
| 23 | <li><a href="http://cwiki.apache.org/FELIX/faq.html">faq</a></li> |
| 24 | <li><a href="http://cwiki.apache.org/FELIX/roadmap.html">roadmap</a></li> |
| 25 | <li><a href="http://cwiki.apache.org/FELIX/sourcecode.html">source code</a></li> |
| 26 | <li><a href="http://cwiki.apache.org/FELIX/codingstandards.html">coding standards</a></li> |
| 27 | <li><a href="http://cwiki.apache.org/FELIX/issuetracking.html">issue tracking</a></li> |
| 28 | <li><a href="http://cwiki.apache.org/FELIX/dependencies.html">dependencies</a></li> |
| 29 | </ul> |
| 30 | </div> |
| 31 | <div class="main"> |
| 32 | <h1><a name="MavenBundlePlugin(BND)-BundlePluginforMaven"></a>Bundle Plugin for Maven</h1> |
| 33 | |
| 34 | <p>This plugin for Maven 2 is based on the <span class="nobr"><a href="http://www.aqute.biz/Code/Bnd" title="Visit page outside Confluence" rel="nofollow">BND<sup><img class="rendericon" src="maven-bundle-plugin-bnd_files/linkext7.gif" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span> |
| 35 | tool from Peter Kriens. The way BND works is by treating your project |
| 36 | as a big collection of classes (e.g., project code, dependencies, and |
| 37 | the class path). The way you create a bundle with BND is to tell it the |
| 38 | content of the bundle's JAR file as a subset of the available classes. |
| 39 | This plugin wraps BND to make it work specifically with the Maven 2 |
| 40 | project structure and to provide it with reasonable default behavior |
| 41 | for Maven 2 projects.</p> |
| 42 | |
| 43 | <p><a name="MavenBundlePlugin(BND)-simpleexample"></a></p> |
| 44 | |
| 45 | <h1><a name="MavenBundlePlugin(BND)-SimpleExample"></a>Simple Example</h1> |
| 46 | |
| 47 | <p>Rather than going straight to a detailed list of plugin features, we |
| 48 | will first look at a simple example of how to use the plugin to give an |
| 49 | immediate flavor. A detailed "<a href="#MavenBundlePlugin%2528BND%2529-howto" title="how-to on Maven Bundle Plugin (BND)">how to</a>" will follow.</p> |
| 50 | |
| 51 | <p>Assume that we have a simple bundle project that has a pubic API package an several implementation packages, such as:</p> |
| 52 | <div class="preformatted"><div class="preformattedContent"> |
| 53 | <pre>org.foo.myproject.api |
| 54 | org.foo.myproject.impl1 |
| 55 | org.foo.myproject.impl2 |
| 56 | ... |
| 57 | </pre> |
| 58 | </div></div> |
| 59 | <p>If we also assume that we have a bundle activator in one of the implementation packages, then the <tt><plugins></tt> section of the POM file for this bundle project would look like this:</p> |
| 60 | <div class="preformatted"><div class="preformattedContent"> |
| 61 | <pre>... |
| 62 | <plugins> |
| 63 | <plugin> |
| 64 | <groupId>org.apache.felix</groupId> |
| 65 | <artifactId>maven-bundle-plugin</artifactId> |
| 66 | <extensions>true</extensions> |
| 67 | <configuration> |
| 68 | <instructions> |
| 69 | <Export-Package>org.foo.myproject.api</Export-Package> |
| 70 | <Private-Package>org.foo.myproject.*</Private-Package> |
| 71 | <Bundle-Activator>org.foo.myproject.impl1.Activator</Bundle-Activator> |
| 72 | </instructions> |
| 73 | </configuration> |
| 74 | </plugin> |
| 75 | </plugins> |
| 76 | ... |
| 77 | </pre> |
| 78 | </div></div> |
| 79 | <p>The <tt><Export-Package></tt> and <tt><Private-Package></tt> instructions tell the plugin about the contents of the resulting bundle JAR file. The <tt><Export-Package></tt> instruction tells the plugin which of the available packages to copy into the bundle <b>and</b> export, while the <tt><Private-Package></tt> instruction indicates which of the available packages to copy into the bundle <b>but not</b> |
| 80 | export. If the two sets overlap, as they do in the case, then the |
| 81 | export takes precedence. Since we did not specify any values for any |
| 82 | other bundle manifest headers, they will assume default values which |
| 83 | are described <a href="#MavenBundlePlugin%2528BND%2529-defaultbehavior" title="default-behavior on Maven Bundle Plugin (BND)">below</a>. One specific behavior to highlight is that the plugin generates the <tt>Import-Package</tt> |
| 84 | bundle manifest header based on the contents of the bundle, which means |
| 85 | that you generally do not ever need to explicitly specify it yourself. |
| 86 | That's it.</p> |
| 87 | |
| 88 | <h1><a name="MavenBundlePlugin(BND)-Features"></a>Features</h1> |
| 89 | |
| 90 | <p>The BND library underlying the plugin defines instructions to direct |
| 91 | its behavior. For this Maven plugin, these instructions are issued in |
| 92 | the plugin configuration section of the POM file, as was illustrated <a href="#MavenBundlePlugin%2528BND%2529-simpleexample" title="simple-example on Maven Bundle Plugin (BND)">above</a>. BND recognizes three types of instructions:</p> |
| 93 | <ol> |
| 94 | <li><em>Manifest headers</em> - Any instruction that starts with |
| 95 | a capital letter will appear in the resulting bundle's manifest file; |
| 96 | the value for the header will either be copied, augmented, or generated |
| 97 | by BND depending on the instruction.</li> |
| 98 | <li><em>Variables</em> - Any instruction starting with a lowercase letter is assumed to be a variable in the form of a name-value pair, such as <tt>version=3.0</tt>, that can be used for property substitution, but is not copied to the manifest.</li> |
| 99 | <li><em>Directives</em> |
| 100 | - Any instruction starting with a '-' character is considered to be a |
| 101 | directive that informs BND to perform some special processing and is |
| 102 | not copied to the manifest.</li> |
| 103 | </ol> |
| 104 | |
| 105 | |
| 106 | <p>The remainder of this section covers the most important aspects of BND's instructions; for complete details refer to the <span class="nobr"><a href="http://www.aqute.biz/Code/Bnd" title="Visit page outside Confluence" rel="nofollow">BND documentation<sup><img class="rendericon" src="maven-bundle-plugin-bnd_files/linkext7.gif" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span>.</p> |
| 107 | |
| 108 | <p><a name="MavenBundlePlugin(BND)-instructions"></a></p> |
| 109 | |
| 110 | <h2><a name="MavenBundlePlugin(BND)-Instructions"></a>Instructions</h2> |
| 111 | |
| 112 | |
| 113 | <h3><a name="MavenBundlePlugin(BND)-{{<ExportPackage>}}"></a><tt><Export-Package></tt></h3> |
| 114 | |
| 115 | <p>The <tt><Export-Package></tt> instruction is a list of |
| 116 | packages for the bundle to export. These packages are copied into the |
| 117 | resulting bundle JAR file from the available classes (i.e., project |
| 118 | classes, dependencies, and class path); thus, it is possible to include |
| 119 | classes into your bundle that are not associated with source files in |
| 120 | your project. <tt><Export-Package></tt> can be specified with |
| 121 | package patterns using the '*' wildcard. Also, it is possible to |
| 122 | exclude packages using negation by starting the package pattern with |
| 123 | '!'. Thus, non-negated patterns indicate which of the available |
| 124 | packages to include in the bundle, whereas negated patterns indicate |
| 125 | which should not be included in the bundle.</p> |
| 126 | |
| 127 | <p>The list of package patterns is ordered and earlier patterns are applied before later patterns. For example, if you specify "<tt>org.foo.*,!org.foo.impl</tt>" the second pattern has no effect since all <tt>org.foo</tt> packages have already been selected by the first pattern. Instead, you should specify "<tt>!org.foo.impl,org.foo.*</tt>", which will export all <tt>org.foo</tt> packages except <tt>org.foo.impl</tt>.</p> |
| 128 | |
| 129 | <p>Following standard OSGi R4 syntax, package patterns can include both |
| 130 | directives and attributes, which will be copied appropriately into the |
| 131 | generated Export-Package manifest header. Besides explicitly listing |
| 132 | package version attributes, BND will also determine package versions by |
| 133 | examining the source JAR file or from <tt>packageinfo</tt> files in the package directory.</p> |
| 134 | |
| 135 | <h3><a name="MavenBundlePlugin(BND)-{{<PrivatePackage>}}"></a><tt><Private-Package></tt></h3> |
| 136 | |
| 137 | <p>The <tt><Private-Package></tt> instruction is similar in every way to the <tt><Export-Package></tt> instruction, except for the fact that these packages will <b>not</b> |
| 138 | be exported by the bundle. If a package is selected by both the export |
| 139 | and private package headers, then the export takes precedence.</p> |
| 140 | |
| 141 | <h3><a name="MavenBundlePlugin(BND)-{{<IncludeResource>}}"></a><tt><Include-Resource></tt></h3> |
| 142 | |
| 143 | <p>The <tt><Include-Resource></tt> instruction is a list of |
| 144 | arbitrary resources that should be copied into the bundle JAR file. The |
| 145 | specified resources are declared as clauses that can have the following |
| 146 | forms:</p> |
| 147 | <div class="preformatted"><div class="preformattedContent"> |
| 148 | <pre>clause ::= assignment | inline | simple |
| 149 | assignment ::= PATH '=' PATH |
| 150 | simple ::= PATH |
| 151 | inline ::= '@' PATH |
| 152 | </pre> |
| 153 | </div></div> |
| 154 | <p>For the <tt><Include-Resource></tt> instruction, actual file paths are relative to the <tt>pom.xml</tt>, while file copy destinations are relative to the root of the resulting bundle JAR file. In the case of <tt>assignment</tt> or <tt>simple</tt> forms, the <tt>PATH</tt> parameter can point to a file or directory. The <tt>simple</tt> |
| 155 | form will place the resource in the bundle JAR with only the file name, |
| 156 | i.e., without any path component. For example, including <tt>src/main/resources/a/b.c</tt> will result in a resource <tt>b.c</tt> in the root of the bundle JAR. If the <tt>PATH</tt> |
| 157 | points to a directory, the entire directory hierarchy is copied into |
| 158 | the resulting bundle JAR file relative to the specified directory. If a |
| 159 | specific resource must be placed into a subdirectory of the bundle jar, |
| 160 | then use the <tt>assignment</tt> form, where the first path is the the |
| 161 | destination path (including file name if the resource is a file) and |
| 162 | the second path is the resource to copy. The <tt>inline</tt> form requires a ZIP or JAR file, which will be completely expanded in the bundle JAR.</p> |
| 163 | |
| 164 | <p>If a resource clause is specified inside of "{ ... }" brackets, then |
| 165 | variable substitution will be performed on the resource, where |
| 166 | variables in the resources are denoted with "${ ... }" syntax.</p> |
| 167 | |
| 168 | <h3><a name="MavenBundlePlugin(BND)-{{<ImportPackage>}}"></a><tt><Import-Package></tt></h3> |
| 169 | |
| 170 | <p>The <tt><Import-Package></tt> instruction is a list of |
| 171 | packages that are required by the bundle's contained packages. The |
| 172 | default for this header is "*", resulting in importing all referred |
| 173 | packages. This header rarely has to be explicitly specified. However, |
| 174 | in certain cases when there is an unwanted import, such an import can |
| 175 | be removed by using a negation package pattern. The package patterns |
| 176 | work in the same way as for <tt><Export-Package></tt>, which means they are ordered. For example, if you wanted to import all packages except <tt>org.foo.impl</tt> you would specify "<tt>!org.foo.impl,*</tt>"</p> |
| 177 | |
| 178 | <p><a name="MavenBundlePlugin(BND)-defaultbehavior"></a></p> |
| 179 | |
| 180 | <h2><a name="MavenBundlePlugin(BND)-DefaultBehavior"></a>Default Behavior</h2> |
| 181 | |
| 182 | <p>To use this plugin, very little information is required by BND. As |
| 183 | part of the Maven integration, the plugin tries to set reasonable |
| 184 | defaults for various instructions. For example:</p> |
| 185 | <ul> |
| 186 | <li><tt><Bundle-SymbolicName></tt> is assumed to be "<tt>${groupId}.${artifactId</tt>}".</li> |
| 187 | <li><tt><Export-Package></tt> is assumed to be "<tt>${groupId}.${artifactId}.*</tt>", unless <tt><Private-Package></tt> is specified, then <tt><Export-Package></tt> is assumed to be empty.</li> |
| 188 | <li><tt><Private-Package></tt> is assumed to be empty by default.</li> |
| 189 | <li><tt><Import-Package></tt> is assumed to be "<tt>*</tt>", which imports everything referred to by the bundle content, but not contained in the bundle.</li> |
| 190 | <li><tt><Include-Resource></tt> is assumed to be "<tt>src/main/resources/</tt>", |
| 191 | which will copy the specified project directory hierarchy into the |
| 192 | resulting bundle JAR file, mirroring standard Maven behavior.</li> |
| 193 | <li><tt><Bundle-Version></tt> is assumed to be "<tt>${pom.version</tt>}" with '-' character separator of the qualifier replaced with a '.' character.</li> |
| 194 | <li><tt><Bundle-Name></tt> is assumed to be "<tt>${pom.name</tt>}".</li> |
| 195 | <li><tt><Bundle-Description></tt> is assumed to be "<tt>${pom.description</tt>}".</li> |
| 196 | <li><tt><Bundle-License></tt> is assumed to be "<tt>${pom.licenses</tt>}".</li> |
| 197 | <li><tt><Bundle-Vendor></tt> is assumed to be "<tt>${pom.organization.name</tt>}".</li> |
| 198 | <li><tt><Bundle-DocURL></tt> is assumed to be "<tt>${pom.organization.url</tt>}".</li> |
| 199 | </ul> |
| 200 | |
| 201 | |
| 202 | <p>Since the plugin creates bundles for OSGi R4, it hard codes <tt>Bundle-ManifestVersion</tt> |
| 203 | to be '2'. Additionally, it generates imports for every export to |
| 204 | ensure package substitutability, which is very important when working |
| 205 | with collaborating services. It is possible to override any of these |
| 206 | values (except <tt>Bundle-ManifestVersion</tt>) just by specifying the desired value in the plugin configuration section of the POM file.</p> |
| 207 | |
| 208 | <p><a name="MavenBundlePlugin(BND)-howto"></a></p> |
| 209 | |
| 210 | <h1><a name="MavenBundlePlugin(BND)-Detailed"HowTo""></a>Detailed "How To"</h1> |
| 211 | |
| 212 | <h2><a name="MavenBundlePlugin(BND)-GetMaven2"></a>Get Maven2</h2> |
| 213 | |
| 214 | <p>The first step in the process of using the plugin is downloading and |
| 215 | installing the latest version of the Maven2 runtime. The latest Maven2 |
| 216 | release and instuctions for getting started with Maven2 can be found at |
| 217 | the <span class="nobr"><a href="http://maven.apache.org/index.html" title="Visit page outside Confluence" rel="nofollow">Maven website<sup><img class="rendericon" src="maven-bundle-plugin-bnd_files/linkext7.gif" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span>.</p> |
| 218 | |
| 219 | <h2><a name="MavenBundlePlugin(BND)-UsingthePlugin"></a>Using the Plugin</h2> |
| 220 | |
| 221 | <p>To use the maven-bundle-plugin, you first need to add the plugin and |
| 222 | some appropriate plugin configuration to your bundle project's POM. |
| 223 | Below is an example of a simple OSGi bundle POM for Maven2:</p> |
| 224 | <div class="preformatted"><div class="preformattedContent"> |
| 225 | <pre><project> |
| 226 | <modelVersion>4.0.0</modelVersion> |
| 227 | <groupId>my-osgi-bundles</groupId> |
| 228 | <artifactId>examplebundle</artifactId> |
| 229 | <packaging>bundle</packaging> <!-- (1) --> |
| 230 | <version>1.0</version> |
| 231 | <name>Example Bundle</name> |
| 232 | <dependencies> |
| 233 | <dependency> |
| 234 | <groupId>org.apache.felix</groupId> |
| 235 | <artifactId>org.osgi.core</artifactId> |
| 236 | <version>0.8.0-incubator</version> |
| 237 | </dependency> |
| 238 | </dependencies> |
| 239 | <build> |
| 240 | <plugins> |
| 241 | <plugin> <!-- (2) START --> |
| 242 | <groupId>org.apache.felix</groupId> |
| 243 | <artifactId>maven-bundle-plugin</artifactId> |
| 244 | <extensions>true</extensions> |
| 245 | <configuration> |
| 246 | <instructions> |
| 247 | <Export-Package>com.my.company.api</Export-Package> |
| 248 | <Private-Package>com.my.company.*</Private-Package> |
| 249 | <Bundle-Activator>com.my.company.Activator</Bundle-Activator> |
| 250 | </instructions> |
| 251 | </configuration> |
| 252 | </plugin> <!-- (2) END --> |
| 253 | </plugins> |
| 254 | </build> |
| 255 | <repositories> |
| 256 | <repository> <!-- (3) START --> |
| 257 | <id>apache.m2.incubator</id> |
| 258 | <name>Apache M2 Incubator Repository</name> |
| 259 | <url>http://people.apache.org/repo/m2-incubating-repository/</url> |
| 260 | </repository> <!-- (3) END --> |
| 261 | </repositories> |
| 262 | <pluginRepositories> |
| 263 | <pluginRepository> <!-- (4) START --> |
| 264 | <id>apache.m2.incubator</id> |
| 265 | <name>Apache M2 Incubator Repository</name> |
| 266 | <url>http://people.apache.org/repo/m2-incubating-repository/</url> |
| 267 | </pluginRepository> <!-- (4) END --> |
| 268 | </pluginRepositories> |
| 269 | </project> |
| 270 | </pre> |
| 271 | </div></div> |
| 272 | <p>There are four main things to note: (1) the <tt><packaging></tt> |
| 273 | specifier must be "bundle", (2) the plugin and configuration must be |
| 274 | specified (the configuration section is where you will issue |
| 275 | instructions to the plugin), and the snapshot repository to resolve |
| 276 | dependencies (3) and plugins (4).</p> |
| 277 | |
| 278 | <h2><a name="MavenBundlePlugin(BND)-RealWorldExample"></a>Real-World Example</h2> |
| 279 | |
| 280 | <p>Consider this more real-world example using Felix' Log Service |
| 281 | implementation. The Log Service project is comprised of a single |
| 282 | package: <tt>org.apache.felix.log.impl</tt>. It has a dependency on |
| 283 | the core OSGi interfaces as well as a dependency on the compendium OSGi |
| 284 | interfaces for the specific log service interfaces. The following is |
| 285 | its POM file:</p> |
| 286 | <div class="preformatted"><div class="preformattedContent"> |
| 287 | <pre><project> |
| 288 | <modelVersion>4.0.0</modelVersion> |
| 289 | <groupId>org.apache.felix</groupId> |
| 290 | <artifactId>org.apache.felix.log</artifactId> |
| 291 | <packaging>bundle</packaging> |
| 292 | <name>Apache Felix Log Service</name> |
| 293 | <version>0.8.0-SNAPSHOT</version> |
| 294 | <description> |
| 295 | This bundle provides an implementation of the OSGi R4 Log service. |
| 296 | </description> |
| 297 | <dependencies> |
| 298 | <dependency> |
| 299 | <groupId>${pom.groupId}</groupId> |
| 300 | <artifactId>org.osgi.core</artifactId> |
| 301 | <version>0.8.0-incubator</version> |
| 302 | </dependency> |
| 303 | <dependency> |
| 304 | <groupId>${pom.groupId}</groupId> |
| 305 | <artifactId>org.osgi.compendium</artifactId> |
| 306 | <version>0.9.0-incubator-SNAPSHOT</version> |
| 307 | </dependency> |
| 308 | </dependencies> |
| 309 | <build> |
| 310 | <plugins> |
| 311 | <plugin> |
| 312 | <groupId>org.apache.felix</groupId> |
| 313 | <artifactId>maven-bundle-plugin</artifactId> |
| 314 | <extensions>true</extensions> |
| 315 | <configuration> |
| 316 | <instructions> |
| 317 | <Export-Package>org.osgi.service.log</Export-Package> |
| 318 | <Private-Package>org.apache.felix.log.impl</Private-Package> |
| 319 | <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName> |
| 320 | <Bundle-Activator>${pom.artifactId}.impl.Activator</Bundle-Activator> |
| 321 | <Export-Service>org.osgi.service.log.LogService,org.osgi.service.log.LogReaderService</Export-Service> |
| 322 | </instructions> |
| 323 | </configuration> |
| 324 | </plugin> |
| 325 | </plugins> |
| 326 | </build> |
| 327 | <repositories> |
| 328 | <repository> |
| 329 | <id>apache.m2.incubator</id> |
| 330 | <name>Apache M2 Incubator Repository</name> |
| 331 | <url>http://people.apache.org/repo/m2-incubating-repository/</url> |
| 332 | </repository> |
| 333 | </repositories> |
| 334 | <pluginRepositories> |
| 335 | <pluginRepository> |
| 336 | <id>apache.m2.incubator</id> |
| 337 | <name>Apache M2 Incubator Repository</name> |
| 338 | <url>http://people.apache.org/repo/m2-incubating-repository/</url> |
| 339 | </pluginRepository> |
| 340 | </pluginRepositories> |
| 341 | </project> |
| 342 | </pre> |
| 343 | </div></div> |
| 344 | <p>Notice that the <tt><Export-Package></tt> instruction |
| 345 | specifies that the bundle exports the Log Service package, even though |
| 346 | this package is not contained in the bundle project. By declaring this, |
| 347 | the plugin will copy the Log Service package into the resulting bundle |
| 348 | JAR file. This is useful in this case because now the bundle can |
| 349 | resolve without having to download the entire compendium bundle. The |
| 350 | resulting manifest for the Log Service bundle looks like this (notice |
| 351 | how the imports/exports automatically have version information |
| 352 | associated with them, which was obtained from packageinfo files in the |
| 353 | source packages):</p> |
| 354 | <div class="preformatted"><div class="preformattedContent"> |
| 355 | <pre>Manifest-Version: 1 |
| 356 | Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt |
| 357 | Bundle-Activator: org.apache.felix.log.impl.Activator |
| 358 | Import-Package: org.osgi.framework;version=1.3, org.osgi.service.log;v |
| 359 | ersion=1.3 |
| 360 | Include-Resource: src/main/resources |
| 361 | Export-Package: org.osgi.service.log;uses:=org.osgi.framework;version= |
| 362 | 1.3 |
| 363 | Bundle-Version: 0.8.0.SNAPSHOT |
| 364 | Bundle-Name: Apache Felix Log Service |
| 365 | Bundle-Description: This bundle provides an implementation of the OSGi |
| 366 | R4 Log service. |
| 367 | Private-Package: org.apache.felix.log.impl |
| 368 | Bundle-ManifestVersion: 2 |
| 369 | Export-Service: org.osgi.service.log.LogService,org.osgi.service.log.L |
| 370 | ogReaderService |
| 371 | Bundle-SymbolicName: org.apache.felix.log |
| 372 | </pre> |
| 373 | </div></div> |
| 374 | <p>The resulting bundle JAR file has the following content (notice how |
| 375 | the LICENSE and NOTICE files were automatically copied from the <tt>src/main/resources/</tt> directory of the project):</p> |
| 376 | <div class="preformatted"><div class="preformattedContent"> |
| 377 | <pre>META-INF/MANIFEST.MF |
| 378 | LICENSE |
| 379 | META-INF/ |
| 380 | META-INF/maven/ |
| 381 | META-INF/maven/org.apache.felix/ |
| 382 | META-INF/maven/org.apache.felix/org.apache.felix.log/ |
| 383 | META-INF/maven/org.apache.felix/org.apache.felix.log/pom.properties |
| 384 | META-INF/maven/org.apache.felix/org.apache.felix.log/pom.xml |
| 385 | NOTICE |
| 386 | org/ |
| 387 | org/apache/ |
| 388 | org/apache/felix/ |
| 389 | org/apache/felix/log/ |
| 390 | org/apache/felix/log/impl/ |
| 391 | org/apache/felix/log/impl/Activator.class |
| 392 | org/apache/felix/log/impl/Log.class |
| 393 | org/apache/felix/log/impl/LogEntryImpl.class |
| 394 | org/apache/felix/log/impl/LogException.class |
| 395 | org/apache/felix/log/impl/LogListenerThread.class |
| 396 | org/apache/felix/log/impl/LogNode.class |
| 397 | org/apache/felix/log/impl/LogNodeEnumeration.class |
| 398 | org/apache/felix/log/impl/LogReaderServiceFactory.class |
| 399 | org/apache/felix/log/impl/LogReaderServiceImpl.class |
| 400 | org/apache/felix/log/impl/LogServiceFactory.class |
| 401 | org/apache/felix/log/impl/LogServiceImpl.class |
| 402 | org/osgi/ |
| 403 | org/osgi/service/ |
| 404 | org/osgi/service/log/ |
| 405 | org/osgi/service/log/LogEntry.class |
| 406 | org/osgi/service/log/LogListener.class |
| 407 | org/osgi/service/log/LogReaderService.class |
| 408 | org/osgi/service/log/LogService.class |
| 409 | org/osgi/service/log/package.html |
| 410 | org/osgi/service/log/packageinfo |
| 411 | </pre> |
| 412 | </div></div> |
| 413 | |
| 414 | <h2><a name="MavenBundlePlugin(BND)-BuildingthePlugin"></a>Building the Plugin</h2> |
| 415 | |
| 416 | <p>The plugin is hosted at the Apache Felix incubator project. The |
| 417 | following steps describe how to build and install the plugin into your |
| 418 | local Maven2 repository.</p> |
| 419 | |
| 420 | <p>Using the SVN client of your choice, checkout the maven-bundle-plugin project.</p> |
| 421 | <div class="preformatted"><div class="preformattedContent"> |
| 422 | <pre>$ svn co http://svn.apache.org/repos/asf/felix/trunk/tools/maven2/maven-bundle-plugin |
| 423 | </pre> |
| 424 | </div></div> |
| 425 | <p>Using Maven2, build and install the maven-bundle-plugin by issuing |
| 426 | the following Maven2 command in the project directory that was created |
| 427 | as a result of the previous step.</p> |
| 428 | <div class="preformatted"><div class="preformattedContent"> |
| 429 | <pre>$ mvn install |
| 430 | </pre> |
| 431 | </div></div> |
| 432 | </div> |
| 433 | |
| 434 | </body></html> |