Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
Stuart McCulloch | 5f3ddf7 | 2008-05-03 12:49:39 +0000 | [diff] [blame] | 2 | <html><head> |
Stuart McCulloch | 5f3ddf7 | 2008-05-03 12:49:39 +0000 | [diff] [blame] | 3 | <title>Apache Felix - Apache Felix Maven Bundle Plugin (BND)</title> |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 4 | <link rel="stylesheet" href="apache-felix-maven-bundle-plugin-bnd_files/site.css" type="text/css" media="all"> |
Stuart McCulloch | 5f3ddf7 | 2008-05-03 12:49:39 +0000 | [diff] [blame] | 5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 6 | </head> |
| 7 | <body> |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 8 | <div class="title"><div class="logo"><a href="http://felix.apache.org/site/index.html"><img alt="Apache Felix" src="apache-felix-maven-bundle-plugin-bnd_files/logo.png" border="0"></a></div><div class="header"><a href="http://www.apache.org/"><img alt="Apache" src="apache-felix-maven-bundle-plugin-bnd_files/apache.png" border="0"></a></div></div> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 9 | <div class="menu"> |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 10 | <ul> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 11 | <li><a href="http://felix.apache.org/site/news.html" title="news">news</a></li> |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 12 | <li><a href="http://www.apache.org/licenses/" class="external-link" rel="nofollow">license</a></li> |
| 13 | <li><a href="http://felix.apache.org/site/downloads.cgi" class="external-link" rel="nofollow">downloads</a></li> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 14 | <li><a href="http://felix.apache.org/site/documentation.html" title="documentation">documentation</a></li> |
| 15 | <li><a href="http://felix.apache.org/site/mailinglists.html" title="mailinglists">mailing lists</a></li> |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 16 | <li><a href="http://felix.apache.org/site/contributing.html" title="Contributing">contributing</a></li> |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 17 | <li><a href="http://www.apache.org/" class="external-link" rel="nofollow">asf</a></li> |
| 18 | <li><a href="http://www.apache.org/security/" class="external-link" rel="nofollow">security</a></li> |
| 19 | <li><a href="http://www.apache.org/foundation/sponsorship.html" class="external-link" rel="nofollow">sponsorship</a></li> |
| 20 | <li><a href="http://www.apache.org/foundation/thanks.html" class="external-link" rel="nofollow">sponsors</a> |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 21 | <!-- ApacheCon Ad --> |
Stuart McCulloch | fc1018e | 2013-06-07 23:34:51 +0000 | [diff] [blame] | 22 | <iframe src="apache-felix-maven-bundle-plugin-bnd_files/button.html" style="border-width:0; float: left" frameborder="0" height="135" scrolling="no" width="135"></iframe> |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 23 | <p style="height: 100px"> |
| 24 | <!-- ApacheCon Ad --></p></li> |
| 25 | </ul> |
| 26 | </div> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 27 | <div class="main"> |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 28 | <h1><a name="ApacheFelixMavenBundlePlugin(BND)-BundlePluginforMaven"></a>Bundle Plugin for Maven</h1> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 29 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 30 | <p>This plugin for Maven 2 is based on the <a href="http://www.aqute.biz/Bnd/Bnd" class="external-link" rel="nofollow">BND</a> |
| 31 | tool from Peter Kriens. The way BND works is by treating your project |
| 32 | as a big collection of classes (e.g., project code, dependencies, and |
| 33 | the class path). The way you create a bundle with BND is to tell it the |
| 34 | content of the bundle's JAR file as a subset of the available classes. |
| 35 | This plugin wraps BND to make it work specifically with the Maven 2 |
| 36 | project structure and to provide it with reasonable default behavior for |
| 37 | Maven 2 projects.</p> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 38 | |
Stuart McCulloch | fc1018e | 2013-06-07 23:34:51 +0000 | [diff] [blame] | 39 | <div class="panelMacro"><table class="infoMacro"><colgroup><col width="24"><col></colgroup><tbody><tr><td valign="top"><img src="apache-felix-maven-bundle-plugin-bnd_files/information.gif" alt="" height="16" align="absmiddle" border="0" width="16"></td><td>If you have questions about the maven-bundle-plugin please read the <a href="http://felix.apache.org/site/apache-felix-bundle-plugin-faq.html" class="external-link" rel="nofollow">FAQ</a> first. If you still have questions you can ask them on the <a href="http://felix.apache.org/site/mailinglists.html" class="external-link" rel="nofollow">Felix user list</a>.</td></tr></tbody></table></div> |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 40 | |
Stuart McCulloch | 2eb6112 | 2009-02-27 06:38:33 +0000 | [diff] [blame] | 41 | <p><em>NOTE: test scoped dependencies are <b>not</b> included in the classpath seen by BND.</em></p> |
Stuart McCulloch | e23ec84 | 2008-08-05 06:36:05 +0000 | [diff] [blame] | 42 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 43 | <p>Since the 1.4.0 release, this plugin also aims to automate OBR (OSGi |
| 44 | Bundle Repository) management. It helps manage a local OBR for your |
| 45 | local Maven repository, and also supports remote OBRs for bundle |
| 46 | distribution. The plug-in automatically computes bundle capabilities and |
| 47 | requirements, using a combination of Bindex and Maven metadata.</p> |
| 48 | |
Stuart McCulloch | fc1018e | 2013-06-07 23:34:51 +0000 | [diff] [blame] | 49 | <div class="panelMacro"><table class="tipMacro"><colgroup><col width="24"><col></colgroup><tbody><tr><td valign="top"><img src="apache-felix-maven-bundle-plugin-bnd_files/check.gif" alt="" height="16" align="absmiddle" border="0" width="16"></td><td><b><a href="http://svn.apache.org/repos/asf/felix/releases/maven-bundle-plugin-2.3.7/doc/site/index.html" class="external-link" rel="nofollow">Standard Maven Documentation is now available for maven-bundle-plugin 2.3.7</a></b></td></tr></tbody></table></div> |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 50 | |
Stuart McCulloch | fc1018e | 2013-06-07 23:34:51 +0000 | [diff] [blame] | 51 | <div class="panelMacro"><table class="tipMacro"><colgroup><col width="24"><col></colgroup><tbody><tr><td valign="top"><img src="apache-felix-maven-bundle-plugin-bnd_files/check.gif" alt="" height="16" align="absmiddle" border="0" width="16"></td><td><b><a href="http://www.aqute.biz/Bnd/Format" class="external-link" rel="nofollow">A complete list of instructions and their format is available from the BND website</a></b></td></tr></tbody></table></div> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 52 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 53 | <p><a name="ApacheFelixMavenBundlePlugin(BND)-simpleexample"></a></p> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 54 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 55 | <h1><a name="ApacheFelixMavenBundlePlugin(BND)-SimpleExample"></a>Simple Example</h1> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 56 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 57 | <p>Rather than going straight to a detailed list of plugin features, we |
| 58 | will first look at a simple example of how to use the plugin to give an |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 59 | immediate flavor. A detailed "<a href="#ApacheFelixMavenBundlePlugin%2528BND%2529-howto">how to</a>" will follow.</p> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 60 | |
| 61 | <p>Assume that we have a simple bundle project that has a pubic API package an several implementation packages, such as:</p> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 62 | |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 63 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 64 | <pre>org.foo.myproject.api |
| 65 | org.foo.myproject.impl1 |
| 66 | org.foo.myproject.impl2 |
| 67 | ... |
| 68 | </pre> |
| 69 | </div></div> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 70 | |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 71 | <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> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 72 | |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 73 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 74 | <pre>... |
| 75 | <plugins> |
| 76 | <plugin> |
| 77 | <groupId>org.apache.felix</groupId> |
| 78 | <artifactId>maven-bundle-plugin</artifactId> |
| 79 | <extensions>true</extensions> |
| 80 | <configuration> |
| 81 | <instructions> |
| 82 | <Export-Package>org.foo.myproject.api</Export-Package> |
| 83 | <Private-Package>org.foo.myproject.*</Private-Package> |
| 84 | <Bundle-Activator>org.foo.myproject.impl1.Activator</Bundle-Activator> |
| 85 | </instructions> |
| 86 | </configuration> |
| 87 | </plugin> |
| 88 | </plugins> |
| 89 | ... |
| 90 | </pre> |
| 91 | </div></div> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 92 | |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 93 | <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> |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 94 | export. If the two sets overlap, as they do in the case, then the |
| 95 | export takes precedence. Since we did not specify any values for any |
| 96 | other bundle manifest headers, they will assume default values which are |
| 97 | described <a href="#ApacheFelixMavenBundlePlugin%2528BND%2529-defaultbehavior">below</a>. One specific behavior to highlight is that the plugin generates the <tt>Import-Package</tt> |
| 98 | bundle manifest header based on the contents of the bundle, which means |
| 99 | that you generally do not ever need to explicitly specify it yourself. |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 100 | That's it.</p> |
| 101 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 102 | <h1><a name="ApacheFelixMavenBundlePlugin(BND)-Features"></a>Features</h1> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 103 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 104 | <p>The BND library underlying the plugin defines instructions to direct |
| 105 | its behavior. For this Maven plugin, these instructions are issued in |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 106 | the plugin configuration section of the POM file, as was illustrated <a href="#ApacheFelixMavenBundlePlugin%2528BND%2529-simpleexample">above</a>. BND recognizes three types of instructions:</p> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 107 | |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 108 | <ol> |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 109 | <li><em>Manifest headers</em> - Any instruction that starts with a |
| 110 | capital letter will appear in the resulting bundle's manifest file; the |
| 111 | value for the header will either be copied, augmented, or generated by |
| 112 | BND depending on the instruction.</li> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 113 | <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> |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 114 | <li><em>Directives</em> - Any instruction starting with a '-' character |
| 115 | is considered to be a directive that informs BND to perform some |
| 116 | special processing and is not copied to the manifest.</li> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 117 | </ol> |
| 118 | |
| 119 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 120 | <p>The remainder of this section covers the most important aspects of BND's instructions; for complete details refer to the <a href="http://www.aqute.biz/Code/Bnd" class="external-link" rel="nofollow">BND documentation</a>.</p> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 121 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 122 | <p><a name="ApacheFelixMavenBundlePlugin(BND)-instructions"></a></p> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 123 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 124 | <h2><a name="ApacheFelixMavenBundlePlugin(BND)-Instructions"></a>Instructions</h2> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 125 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 126 | <h3><a name="ApacheFelixMavenBundlePlugin(BND)-{{<ExportPackage>}}"></a><tt><Export-Package></tt></h3> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 127 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 128 | <p>The <tt><Export-Package></tt> instruction is a list of packages |
| 129 | for the bundle to export. These packages are copied into the resulting |
| 130 | bundle JAR file from the available classes (i.e., project classes, |
| 131 | dependencies, and class path); thus, it is possible to include classes |
| 132 | into your bundle that are not associated with source files in your |
| 133 | project. <tt><Export-Package></tt> can be specified with package |
| 134 | patterns using the '*' wildcard. Also, it is possible to exclude |
| 135 | packages using negation by starting the package pattern with '!'. Thus, |
| 136 | non-negated patterns indicate which of the available packages to include |
| 137 | in the bundle, whereas negated patterns indicate which should not be |
| 138 | included in the bundle.</p> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 139 | |
| 140 | <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> |
| 141 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 142 | <p>Following standard OSGi R4 syntax, package patterns can include both |
| 143 | directives and attributes, which will be copied appropriately into the |
| 144 | generated Export-Package manifest header. Besides explicitly listing |
| 145 | package version attributes, BND will also determine package versions by |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 146 | examining the source JAR file or from <tt>packageinfo</tt> files in the package directory.</p> |
| 147 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 148 | <h3><a name="ApacheFelixMavenBundlePlugin(BND)-{{<PrivatePackage>}}"></a><tt><Private-Package></tt></h3> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 149 | |
| 150 | <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> |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 151 | be exported by the bundle. If a package is selected by both the export |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 152 | and private package headers, then the export takes precedence.</p> |
| 153 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 154 | <h3><a name="ApacheFelixMavenBundlePlugin(BND)-{{<IncludeResource>}}"></a><tt><Include-Resource></tt></h3> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 155 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 156 | <p>The <tt><Include-Resource></tt> instruction is a list of |
| 157 | arbitrary resources that should be copied into the bundle JAR file. The |
| 158 | specified resources are declared as clauses that can have the following |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 159 | forms:</p> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 160 | |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 161 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 162 | <pre>clause ::= assignment | inline | simple |
| 163 | assignment ::= PATH '=' PATH |
| 164 | simple ::= PATH |
| 165 | inline ::= '@' PATH |
| 166 | </pre> |
| 167 | </div></div> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 168 | |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 169 | <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> |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 170 | form will place the resource in the bundle JAR with only the file name, |
| 171 | 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> |
| 172 | points to a directory, the entire directory hierarchy is copied into |
| 173 | the resulting bundle JAR file relative to the specified directory. If a |
| 174 | specific resource must be placed into a subdirectory of the bundle jar, |
| 175 | then use the <tt>assignment</tt> form, where the first path is the the |
| 176 | destination path (including file name if the resource is a file) and the |
| 177 | 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> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 178 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 179 | <p>If a resource clause is specified inside of "{ ... }" brackets, then |
| 180 | variable substitution will be performed on the resource, where variables |
| 181 | in the resources are denoted with "${ ... }" syntax.</p> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 182 | |
Stuart McCulloch | 7c961f5 | 2008-01-02 08:56:07 +0000 | [diff] [blame] | 183 | <p>By default the bundle plugin converts the project's Maven resource directories into a single <tt><Include-Resource></tt> instruction. If you specify your own <tt><Include-Resource></tt> instruction, this will replace the generated one. To include the generated list of Maven resources in your own <tt><Include-Resource></tt> instruction just add {<tt>maven-resources</tt>} to the list and it will be expanded automatically.</p> |
| 184 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 185 | <h3><a name="ApacheFelixMavenBundlePlugin(BND)-{{<ImportPackage>}}"></a><tt><Import-Package></tt></h3> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 186 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 187 | <p>The <tt><Import-Package></tt> instruction is a list of packages |
| 188 | that are required by the bundle's contained packages. The default for |
| 189 | this header is "*", resulting in importing all referred packages. This |
| 190 | header rarely has to be explicitly specified. However, in certain cases |
| 191 | when there is an unwanted import, such an import can be removed by using |
| 192 | a negation package pattern. The package patterns work in the same way |
| 193 | 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> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 194 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 195 | <p><a name="ApacheFelixMavenBundlePlugin(BND)-defaultbehavior"></a></p> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 196 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 197 | <h2><a name="ApacheFelixMavenBundlePlugin(BND)-DefaultBehavior"></a>Default Behavior</h2> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 198 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 199 | <p>To use this plugin, very little information is required by BND. As |
| 200 | part of the Maven integration, the plugin tries to set reasonable |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 201 | defaults for various instructions. For example:</p> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 202 | |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 203 | <ul> |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 204 | <li><tt><Bundle-SymbolicName></tt> is computed using the shared <a href="http://svn.apache.org/repos/asf/maven/shared/trunk/maven-osgi/src/main/java/org/apache/maven/shared/osgi/DefaultMaven2OsgiConverter.java" class="external-link" rel="nofollow">Maven2OsgiConverter</a> component, which uses the following algorithm:<br> |
Stuart McCulloch | e23ec84 | 2008-08-05 06:36:05 +0000 | [diff] [blame] | 205 | Get the symbolic name as groupId + "." + artifactId, with the following exceptions: |
| 206 | <ul> |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 207 | <li>if artifact.getFile is not null and the jar contains a OSGi |
| 208 | Manifest with Bundle-SymbolicName property then that value is returned</li> |
| 209 | <li>if groupId has only one section (no dots) and artifact.getFile is |
| 210 | not null then the first package name with classes is returned. eg. |
Stuart McCulloch | e23ec84 | 2008-08-05 06:36:05 +0000 | [diff] [blame] | 211 | commons-logging:commons-logging -> org.apache.commons.logging</li> |
| 212 | <li>if artifactId is equal to last section of groupId then groupId is returned. eg. org.apache.maven:maven -> org.apache.maven</li> |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 213 | <li>if artifactId starts with last section of groupId that portion is |
| 214 | removed. eg. org.apache.maven:maven-core -> org.apache.maven.core<br> |
Stuart McCulloch | 2eb6112 | 2009-02-27 06:38:33 +0000 | [diff] [blame] | 215 | The computed symbolic name is also stored in the <tt>$(maven-symbolicname)</tt> property in case you want to add attributes or directives to it.</li> |
Stuart McCulloch | e23ec84 | 2008-08-05 06:36:05 +0000 | [diff] [blame] | 216 | </ul> |
| 217 | </li> |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 218 | <li><tt><Export-Package></tt> is now assumed to be the set of |
| 219 | packages in your local Java sources, excluding the default package '.' |
| 220 | and any packages containing 'impl' or 'internal'.<br> |
Stuart McCulloch | 2eb6112 | 2009-02-27 06:38:33 +0000 | [diff] [blame] | 221 | <em>(before version 2 of the bundleplugin it was based on the symbolic name)</em></li> |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 222 | <li>Since 2.2.0 you can also use {<tt>local-packages</tt>} inside <tt><Export-Package></tt> and it will be expanded to the set of local packages.</li> |
Stuart McCulloch | 2eb6112 | 2009-02-27 06:38:33 +0000 | [diff] [blame] | 223 | <li><tt><Private-Package></tt> is now assumed to be the set of packages in your local Java sources (note that any packages in both <tt><Export-Package></tt> and <tt><Private-Package></tt> will be exported).<br> |
| 224 | <em>(before version 2 of the bundleplugin it was assumed to be empty by default)</em></li> |
| 225 | <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.<br> |
| 226 | <em>Any exported packages are also imported by default, to ensure a consistent class space.</em></li> |
Stuart McCulloch | 7c961f5 | 2008-01-02 08:56:07 +0000 | [diff] [blame] | 227 | <li><tt><Include-Resource></tt> is generated from the project's Maven resources, typically "<tt>src/main/resources/</tt>", |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 228 | which will copy the specified project directory hierarchy into the |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 229 | resulting bundle JAR file, mirroring standard Maven behavior.</li> |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 230 | <li><tt><Bundle-Version></tt> is assumed to be "<tt>${pom.version</tt>}" but is normalized to the OSGi version format of "<tt>MAJOR.MINOR.MICRO.QUALIFIER</tt>", for example "<tt>2.1-SNAPSHOT</tt>" would become "<tt>2.1.0.SNAPSHOT</tt>".</li> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 231 | <li><tt><Bundle-Name></tt> is assumed to be "<tt>${pom.name</tt>}".</li> |
| 232 | <li><tt><Bundle-Description></tt> is assumed to be "<tt>${pom.description</tt>}".</li> |
| 233 | <li><tt><Bundle-License></tt> is assumed to be "<tt>${pom.licenses</tt>}".</li> |
| 234 | <li><tt><Bundle-Vendor></tt> is assumed to be "<tt>${pom.organization.name</tt>}".</li> |
| 235 | <li><tt><Bundle-DocURL></tt> is assumed to be "<tt>${pom.organization.url</tt>}".</li> |
| 236 | </ul> |
| 237 | |
| 238 | |
Stuart McCulloch | 7c961f5 | 2008-01-02 08:56:07 +0000 | [diff] [blame] | 239 | <p>Since the plugin creates bundles for OSGi R4, it hard-codes <tt>Bundle-ManifestVersion</tt> |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 240 | to be '2'. Additionally, it generates imports for every export to |
| 241 | ensure package substitutability, which is very important when working |
| 242 | with collaborating services. It is possible to override any of these |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 243 | values (except <tt>Bundle-ManifestVersion</tt>) just by specifying the desired value in the plugin configuration section of the POM file.</p> |
| 244 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 245 | <p><a name="ApacheFelixMavenBundlePlugin(BND)-howto"></a></p> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 246 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 247 | <h1><a name="ApacheFelixMavenBundlePlugin(BND)-Detailed"HowTo""></a>Detailed "How To"</h1> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 248 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 249 | <h2><a name="ApacheFelixMavenBundlePlugin(BND)-GetMaven2"></a>Get Maven2</h2> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 250 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 251 | <p>The first step in the process of using the plugin is downloading and |
| 252 | installing the latest version of the Maven2 runtime. The latest Maven2 |
| 253 | release and instuctions for getting started with Maven2 can be found at |
| 254 | the <a href="http://maven.apache.org/index.html" class="external-link" rel="nofollow">Maven website</a>.</p> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 255 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 256 | <h2><a name="ApacheFelixMavenBundlePlugin(BND)-UsingthePlugin"></a>Using the Plugin</h2> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 257 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 258 | <p>To use the maven-bundle-plugin, you first need to add the plugin and |
| 259 | some appropriate plugin configuration to your bundle project's POM. |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 260 | Below is an example of a simple OSGi bundle POM for Maven2:</p> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 261 | |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 262 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 263 | <pre><project> |
| 264 | <modelVersion>4.0.0</modelVersion> |
| 265 | <groupId>my-osgi-bundles</groupId> |
| 266 | <artifactId>examplebundle</artifactId> |
| 267 | <packaging>bundle</packaging> <!-- (1) --> |
| 268 | <version>1.0</version> |
| 269 | <name>Example Bundle</name> |
| 270 | <dependencies> |
| 271 | <dependency> |
| 272 | <groupId>org.apache.felix</groupId> |
| 273 | <artifactId>org.osgi.core</artifactId> |
Stuart McCulloch | 7c961f5 | 2008-01-02 08:56:07 +0000 | [diff] [blame] | 274 | <version>1.0.0</version> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 275 | </dependency> |
| 276 | </dependencies> |
| 277 | <build> |
| 278 | <plugins> |
| 279 | <plugin> <!-- (2) START --> |
| 280 | <groupId>org.apache.felix</groupId> |
| 281 | <artifactId>maven-bundle-plugin</artifactId> |
| 282 | <extensions>true</extensions> |
| 283 | <configuration> |
| 284 | <instructions> |
| 285 | <Export-Package>com.my.company.api</Export-Package> |
| 286 | <Private-Package>com.my.company.*</Private-Package> |
| 287 | <Bundle-Activator>com.my.company.Activator</Bundle-Activator> |
| 288 | </instructions> |
| 289 | </configuration> |
| 290 | </plugin> <!-- (2) END --> |
| 291 | </plugins> |
| 292 | </build> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 293 | </project> |
| 294 | </pre> |
| 295 | </div></div> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 296 | |
| 297 | <p>There are two main things to note: (1) the <tt><packaging></tt> |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 298 | specifier must be "bundle" and (2) the plugin and configuration must be |
| 299 | specified (the configuration section is where you will issue |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 300 | instructions to the plugin).</p> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 301 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 302 | <h2><a name="ApacheFelixMavenBundlePlugin(BND)-RealWorldExample"></a>Real-World Example</h2> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 303 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 304 | <p>Consider this more real-world example using Felix' Log Service |
| 305 | implementation. The Log Service project is comprised of a single |
| 306 | package: <tt>org.apache.felix.log.impl</tt>. It has a dependency on the |
| 307 | core OSGi interfaces as well as a dependency on the compendium OSGi |
| 308 | interfaces for the specific log service interfaces. The following is its |
| 309 | POM file:</p> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 310 | |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 311 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 312 | <pre><project> |
| 313 | <modelVersion>4.0.0</modelVersion> |
| 314 | <groupId>org.apache.felix</groupId> |
| 315 | <artifactId>org.apache.felix.log</artifactId> |
| 316 | <packaging>bundle</packaging> |
| 317 | <name>Apache Felix Log Service</name> |
| 318 | <version>0.8.0-SNAPSHOT</version> |
| 319 | <description> |
| 320 | This bundle provides an implementation of the OSGi R4 Log service. |
| 321 | </description> |
| 322 | <dependencies> |
| 323 | <dependency> |
| 324 | <groupId>${pom.groupId}</groupId> |
| 325 | <artifactId>org.osgi.core</artifactId> |
| 326 | <version>0.8.0-incubator</version> |
| 327 | </dependency> |
| 328 | <dependency> |
| 329 | <groupId>${pom.groupId}</groupId> |
| 330 | <artifactId>org.osgi.compendium</artifactId> |
| 331 | <version>0.9.0-incubator-SNAPSHOT</version> |
| 332 | </dependency> |
| 333 | </dependencies> |
| 334 | <build> |
| 335 | <plugins> |
| 336 | <plugin> |
| 337 | <groupId>org.apache.felix</groupId> |
| 338 | <artifactId>maven-bundle-plugin</artifactId> |
| 339 | <extensions>true</extensions> |
| 340 | <configuration> |
| 341 | <instructions> |
| 342 | <Export-Package>org.osgi.service.log</Export-Package> |
| 343 | <Private-Package>org.apache.felix.log.impl</Private-Package> |
| 344 | <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName> |
| 345 | <Bundle-Activator>${pom.artifactId}.impl.Activator</Bundle-Activator> |
| 346 | <Export-Service>org.osgi.service.log.LogService,org.osgi.service.log.LogReaderService</Export-Service> |
| 347 | </instructions> |
| 348 | </configuration> |
| 349 | </plugin> |
| 350 | </plugins> |
| 351 | </build> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 352 | </project> |
| 353 | </pre> |
| 354 | </div></div> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 355 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 356 | <p>Notice that the <tt><Export-Package></tt> instruction specifies |
| 357 | that the bundle exports the Log Service package, even though this |
| 358 | package is not contained in the bundle project. By declaring this, the |
| 359 | plugin will copy the Log Service package into the resulting bundle JAR |
| 360 | file. This is useful in this case because now the bundle can resolve |
| 361 | without having to download the entire compendium bundle. The resulting |
| 362 | manifest for the Log Service bundle looks like this (notice how the |
| 363 | imports/exports automatically have version information associated with |
| 364 | them, which was obtained from packageinfo files in the source packages):</p> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 365 | |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 366 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 367 | <pre>Manifest-Version: 1 |
| 368 | Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt |
| 369 | Bundle-Activator: org.apache.felix.log.impl.Activator |
| 370 | Import-Package: org.osgi.framework;version=1.3, org.osgi.service.log;v |
| 371 | ersion=1.3 |
| 372 | Include-Resource: src/main/resources |
| 373 | Export-Package: org.osgi.service.log;uses:=org.osgi.framework;version= |
| 374 | 1.3 |
| 375 | Bundle-Version: 0.8.0.SNAPSHOT |
| 376 | Bundle-Name: Apache Felix Log Service |
| 377 | Bundle-Description: This bundle provides an implementation of the OSGi |
| 378 | R4 Log service. |
| 379 | Private-Package: org.apache.felix.log.impl |
| 380 | Bundle-ManifestVersion: 2 |
| 381 | Export-Service: org.osgi.service.log.LogService,org.osgi.service.log.L |
| 382 | ogReaderService |
| 383 | Bundle-SymbolicName: org.apache.felix.log |
| 384 | </pre> |
| 385 | </div></div> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 386 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 387 | <p>The resulting bundle JAR file has the following content (notice how |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 388 | the LICENSE and NOTICE files were automatically copied from the <tt>src/main/resources/</tt> directory of the project):</p> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 389 | |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 390 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 391 | <pre>META-INF/MANIFEST.MF |
| 392 | LICENSE |
| 393 | META-INF/ |
| 394 | META-INF/maven/ |
| 395 | META-INF/maven/org.apache.felix/ |
| 396 | META-INF/maven/org.apache.felix/org.apache.felix.log/ |
| 397 | META-INF/maven/org.apache.felix/org.apache.felix.log/pom.properties |
| 398 | META-INF/maven/org.apache.felix/org.apache.felix.log/pom.xml |
| 399 | NOTICE |
| 400 | org/ |
| 401 | org/apache/ |
| 402 | org/apache/felix/ |
| 403 | org/apache/felix/log/ |
| 404 | org/apache/felix/log/impl/ |
| 405 | org/apache/felix/log/impl/Activator.class |
| 406 | org/apache/felix/log/impl/Log.class |
| 407 | org/apache/felix/log/impl/LogEntryImpl.class |
| 408 | org/apache/felix/log/impl/LogException.class |
| 409 | org/apache/felix/log/impl/LogListenerThread.class |
| 410 | org/apache/felix/log/impl/LogNode.class |
| 411 | org/apache/felix/log/impl/LogNodeEnumeration.class |
| 412 | org/apache/felix/log/impl/LogReaderServiceFactory.class |
| 413 | org/apache/felix/log/impl/LogReaderServiceImpl.class |
| 414 | org/apache/felix/log/impl/LogServiceFactory.class |
| 415 | org/apache/felix/log/impl/LogServiceImpl.class |
| 416 | org/osgi/ |
| 417 | org/osgi/service/ |
| 418 | org/osgi/service/log/ |
| 419 | org/osgi/service/log/LogEntry.class |
| 420 | org/osgi/service/log/LogListener.class |
| 421 | org/osgi/service/log/LogReaderService.class |
| 422 | org/osgi/service/log/LogService.class |
| 423 | org/osgi/service/log/package.html |
| 424 | org/osgi/service/log/packageinfo |
| 425 | </pre> |
| 426 | </div></div> |
| 427 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 428 | <h2><a name="ApacheFelixMavenBundlePlugin(BND)-AddingOSGimetadatatoexistingprojectswithoutchangingthepackagingtype"></a>Adding OSGi metadata to existing projects without changing the packaging type</h2> |
Stuart McCulloch | dd4ae5f | 2008-02-05 12:38:46 +0000 | [diff] [blame] | 429 | |
| 430 | <p>If you want to keep your project packaging type (for example "jar") but would like to add OSGi metadata<br> |
| 431 | you can use the manifest goal to generate a bundle manifest. The maven-jar-plugin can then be used to<br> |
| 432 | add this manifest to the final artifact. For example:</p> |
| 433 | |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 434 | <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> |
Stuart McCulloch | dd4ae5f | 2008-02-05 12:38:46 +0000 | [diff] [blame] | 435 | <pre class="code-xml"><span class="code-tag"><plugin></span> |
| 436 | <span class="code-tag"><artifactId></span>maven-jar-plugin<span class="code-tag"></artifactId></span> |
| 437 | <span class="code-tag"><configuration></span> |
| 438 | <span class="code-tag"><archive></span> |
| 439 | <span class="code-tag"><manifestFile></span>${project.build.outputDirectory}/META-INF/MANIFEST.MF<span class="code-tag"></manifestFile></span> |
| 440 | <span class="code-tag"></archive></span> |
| 441 | <span class="code-tag"></configuration></span> |
| 442 | <span class="code-tag"></plugin></span> |
| 443 | <span class="code-tag"><plugin></span> |
| 444 | <span class="code-tag"><groupId></span>org.apache.felix<span class="code-tag"></groupId></span> |
| 445 | <span class="code-tag"><artifactId></span>maven-bundle-plugin<span class="code-tag"></artifactId></span> |
| 446 | <span class="code-tag"><executions></span> |
| 447 | <span class="code-tag"><execution></span> |
| 448 | <span class="code-tag"><id></span>bundle-manifest<span class="code-tag"></id></span> |
| 449 | <span class="code-tag"><phase></span>process-classes<span class="code-tag"></phase></span> |
| 450 | <span class="code-tag"><goals></span> |
| 451 | <span class="code-tag"><goal></span>manifest<span class="code-tag"></goal></span> |
| 452 | <span class="code-tag"></goals></span> |
| 453 | <span class="code-tag"></execution></span> |
| 454 | <span class="code-tag"></executions></span> |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 455 | <span class="code-tag"></plugin></span> |
| 456 | </pre> |
Stuart McCulloch | dd4ae5f | 2008-02-05 12:38:46 +0000 | [diff] [blame] | 457 | </div></div> |
| 458 | |
Stuart McCulloch | 1bcd795 | 2009-02-26 21:29:51 +0000 | [diff] [blame] | 459 | <p>If you want to use packaging types other than "jar" and "bundle" then you also need to enable support<br> |
| 460 | for them in the bundleplugin configuration, for example if you want to use the plugin with WAR files:</p> |
| 461 | |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 462 | <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> |
Stuart McCulloch | 1bcd795 | 2009-02-26 21:29:51 +0000 | [diff] [blame] | 463 | <pre class="code-xml"><span class="code-tag"><plugin></span> |
| 464 | <span class="code-tag"><groupId></span>org.apache.felix<span class="code-tag"></groupId></span> |
| 465 | <span class="code-tag"><artifactId></span>maven-bundle-plugin<span class="code-tag"></artifactId></span> |
| 466 | <span class="code-tag"><executions></span> |
| 467 | <span class="code-tag"><execution></span> |
| 468 | <span class="code-tag"><id></span>bundle-manifest<span class="code-tag"></id></span> |
| 469 | <span class="code-tag"><phase></span>process-classes<span class="code-tag"></phase></span> |
| 470 | <span class="code-tag"><goals></span> |
| 471 | <span class="code-tag"><goal></span>manifest<span class="code-tag"></goal></span> |
| 472 | <span class="code-tag"></goals></span> |
| 473 | <span class="code-tag"></execution></span> |
| 474 | <span class="code-tag"></executions></span> |
| 475 | <span class="code-tag"><configuration></span> |
| 476 | <span class="code-tag"><supportedProjectTypes></span> |
| 477 | <span class="code-tag"><supportedProjectType></span>jar<span class="code-tag"></supportedProjectType></span> |
| 478 | <span class="code-tag"><supportedProjectType></span>bundle<span class="code-tag"></supportedProjectType></span> |
| 479 | <span class="code-tag"><supportedProjectType></span>war<span class="code-tag"></supportedProjectType></span> |
| 480 | <span class="code-tag"></supportedProjectTypes></span> |
| 481 | <span class="code-tag"><instructions></span> |
| 482 | <span class="code-tag"><span class="code-comment"><!-- ...etc... --></span></span> |
| 483 | <span class="code-tag"></instructions></span> |
| 484 | <span class="code-tag"></configuration></span> |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 485 | <span class="code-tag"></plugin></span> |
| 486 | </pre> |
Stuart McCulloch | 1bcd795 | 2009-02-26 21:29:51 +0000 | [diff] [blame] | 487 | </div></div> |
| 488 | |
Stuart McCulloch | fc1018e | 2013-06-07 23:34:51 +0000 | [diff] [blame] | 489 | <p>You'll also need to configure the other plugin to pick up and use the generated manifest, which is written to <tt>${project.build.outputDirectory}/META-INF/MANIFEST.MF</tt> by default (unless you choose a different <tt>manifestLocation</tt> in the maven-bundle-plugin configuration). Continuing with our WAR example:</p> |
| 490 | |
| 491 | <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> |
| 492 | <pre class="code-java"><plugin> |
| 493 | <groupId>org.apache.maven.plugins</groupId> |
| 494 | <artifactId>maven-war-plugin</artifactId> |
| 495 | <configuration> |
| 496 | <archive> |
| 497 | <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile> |
| 498 | </archive> |
| 499 | </configuration> |
| 500 | </plugin> |
| 501 | </pre> |
| 502 | </div></div> |
| 503 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 504 | <h2><a name="ApacheFelixMavenBundlePlugin(BND)-BuildingthePlugin"></a>Building the Plugin</h2> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 505 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 506 | <p>The plugin is hosted at the Apache Felix project. The following steps |
| 507 | describe how to build and install the plugin into your local Maven2 |
| 508 | repository.</p> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 509 | |
| 510 | <p>Using the SVN client of your choice, checkout the maven-bundle-plugin project.</p> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 511 | |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 512 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 513 | <pre>$ svn co http://svn.apache.org/repos/asf/felix/trunk/bundleplugin |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 514 | </pre> |
| 515 | </div></div> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 516 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 517 | <p>Using Maven2, build and install the maven-bundle-plugin by issuing |
| 518 | the following Maven2 command in the project directory that was created |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 519 | as a result of the previous step.</p> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 520 | |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 521 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 522 | <pre>$ mvn install |
| 523 | </pre> |
| 524 | </div></div> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 525 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 526 | <h1><a name="ApacheFelixMavenBundlePlugin(BND)-Goals"></a>Goals</h1> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 527 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 528 | <p>The maven-bundle-plugin also provides additional functionality via |
| 529 | some Maven goals. Command-line execution of a goal is performed as |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 530 | follows:</p> |
| 531 | |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 532 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 533 | <pre>mvn org.apache.felix:maven-bundle-plugin:GOAL |
| 534 | </pre> |
| 535 | </div></div> |
| 536 | |
| 537 | <p>Where GOAL is one of the following:</p> |
| 538 | |
| 539 | <ul> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 540 | <li><b><tt>bundle</tt></b> - build an OSGi bundle jar for the current project<br> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 541 | configuration options: |
| 542 | <ul> |
Stuart McCulloch | dd4ae5f | 2008-02-05 12:38:46 +0000 | [diff] [blame] | 543 | <li><em><tt>manifestLocation</tt></em> defaults to ${project.build.outputDirectory}/META-INF</li> |
| 544 | <li><em><tt>unpackBundle</tt></em> unpack bundle contents to output directory, defaults to false</li> |
Stuart McCulloch | 2eb6112 | 2009-02-27 06:38:33 +0000 | [diff] [blame] | 545 | <li><em><tt>excludeDependencies</tt></em> comma-separated list of dependency artifactIds to exclude from the classpath passed to Bnd, use "true" to exclude everything.<br> |
| 546 | Version 2 of the bundleplugin now supports the same style of filter clauses in <tt>excludeDependencies</tt> as <tt>Embed-Dependency</tt>.</li> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 547 | <li><em><tt>classifier</tt></em> attach bundle to the project using the given classifier</li> |
Stuart McCulloch | 1bcd795 | 2009-02-26 21:29:51 +0000 | [diff] [blame] | 548 | <li><em><tt>supportedProjectTypes</tt></em> defaults to "jar","bundle"</li> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 549 | </ul> |
| 550 | </li> |
Stuart McCulloch | dd4ae5f | 2008-02-05 12:38:46 +0000 | [diff] [blame] | 551 | </ul> |
| 552 | |
| 553 | |
| 554 | <ul> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 555 | <li><b><tt>bundleall</tt></b> - build OSGi bundle jars for all transitive dependencies<br> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 556 | configuration options: |
| 557 | <ul> |
Stuart McCulloch | 5f3ddf7 | 2008-05-03 12:49:39 +0000 | [diff] [blame] | 558 | <li><em><tt>wrapImportPackage</tt></em> defaults to "*"</li> |
Stuart McCulloch | 1bcd795 | 2009-02-26 21:29:51 +0000 | [diff] [blame] | 559 | <li><em><tt>supportedProjectTypes</tt></em> defaults to "jar","bundle"</li> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 560 | </ul> |
| 561 | </li> |
Stuart McCulloch | dd4ae5f | 2008-02-05 12:38:46 +0000 | [diff] [blame] | 562 | </ul> |
| 563 | |
| 564 | |
| 565 | <ul> |
| 566 | <li><b><tt>wrap</tt></b> - as above, but limited to the first level of dependencies<br> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 567 | configuration options: |
| 568 | <ul> |
Stuart McCulloch | 5f3ddf7 | 2008-05-03 12:49:39 +0000 | [diff] [blame] | 569 | <li><em><tt>wrapImportPackage</tt></em> defaults to "*"</li> |
Stuart McCulloch | 1bcd795 | 2009-02-26 21:29:51 +0000 | [diff] [blame] | 570 | <li><em><tt>supportedProjectTypes</tt></em> defaults to "jar","bundle"</li> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 571 | </ul> |
| 572 | </li> |
Stuart McCulloch | dd4ae5f | 2008-02-05 12:38:46 +0000 | [diff] [blame] | 573 | </ul> |
| 574 | |
| 575 | |
| 576 | <ul> |
| 577 | <li><b><tt>manifest</tt></b> - create an OSGi manifest for the current project<br> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 578 | configuration options: |
| 579 | <ul> |
Stuart McCulloch | dd4ae5f | 2008-02-05 12:38:46 +0000 | [diff] [blame] | 580 | <li><em><tt>manifestLocation</tt></em> defaults to ${project.build.outputDirectory}/META-INF</li> |
| 581 | <li><em><tt>supportedProjectTypes</tt></em> defaults to "jar","bundle"</li> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 582 | </ul> |
| 583 | </li> |
| 584 | </ul> |
| 585 | |
| 586 | |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 587 | <ul> |
| 588 | <li><b><tt>install</tt></b> - adds the current bundle project to the local OBR<br> |
| 589 | configuration options: |
| 590 | <ul> |
| 591 | <li><em><tt>obrRepository</tt></em> path to local OBR, defaults to <em><local-maven-repository></em><tt>/repository.xml</tt></li> |
Stuart McCulloch | 1bcd795 | 2009-02-26 21:29:51 +0000 | [diff] [blame] | 592 | <li><em><tt>supportedProjectTypes</tt></em> defaults to "jar","bundle"</li> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 593 | </ul> |
| 594 | </li> |
| 595 | </ul> |
| 596 | |
| 597 | |
| 598 | <p>More GOALs are available in the <b>1.4.0</b> release:</p> |
| 599 | |
| 600 | <ul> |
| 601 | <li><b><tt>ant</tt></b> - create an Ant build script to rebuild the bundle</li> |
| 602 | </ul> |
| 603 | |
| 604 | |
| 605 | <ul> |
| 606 | <li><b><tt>install-file</tt></b> - adds a local bundle file to the local OBR<br> |
| 607 | configuration options: |
| 608 | <ul> |
| 609 | <li><em><tt>obrRepository</tt></em> path to local OBR, defaults to <em><local-maven-repository></em><tt>/repository.xml</tt></li> |
| 610 | <li><em><tt>groupId</tt></em> Maven groupId for the bundle, taken from <em>pomFile</em> if given</li> |
| 611 | <li><em><tt>artifactId</tt></em> Maven artifactId for the bundle, taken from <em>pomFile</em> if given</li> |
| 612 | <li><em><tt>version</tt></em> Maven version for the bundle, taken from <em>pomFile</em> if given</li> |
| 613 | <li><em><tt>packaging</tt></em> Maven packaging type for the bundle, taken from <em>pomFile</em> if given</li> |
| 614 | <li><em><tt>classifier</tt></em> Maven classifier type, defaults to none</li> |
| 615 | <li><em><tt>pomFile</tt></em> optional Pom file describing the bundle</li> |
| 616 | <li><em><tt>file</tt></em> bundle file, defaults to the bundle from the local Maven repository</li> |
| 617 | <li><em><tt>obrXml</tt></em> optional additional properties for the bundle</li> |
| 618 | </ul> |
| 619 | </li> |
| 620 | </ul> |
| 621 | |
| 622 | |
| 623 | <ul> |
| 624 | <li><b><tt>deploy</tt></b> - adds the current bundle project to a remote OBR<br> |
| 625 | configuration options: |
| 626 | <ul> |
| 627 | <li><em><tt>remoteOBR</tt></em> name of remote OBR, defaults to NONE (which means no remote OBR deployment)</li> |
| 628 | <li><em><tt>obrRepository</tt></em> used when the remoteOBR name is blank, defaults to <tt>repository.xml</tt></li> |
Stuart McCulloch | 1bcd795 | 2009-02-26 21:29:51 +0000 | [diff] [blame] | 629 | <li><em><tt>prefixUrl</tt></em> optional public URL prefix for the remote repository</li> |
| 630 | <li><em><tt>bundleUrl</tt></em> optional public URL where the bundle has been deployed</li> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 631 | <li><em><tt>altDeploymentRepository</tt></em> alternative remote repository, <em>id::layout::url</em></li> |
Stuart McCulloch | 1bcd795 | 2009-02-26 21:29:51 +0000 | [diff] [blame] | 632 | <li><em><tt>obrDeploymentRepository</tt></em> optional OBR specific deployment repository.</li> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 633 | <li><em><tt>ignoreLock</tt></em> ignore remote locking when updating the OBR</li> |
Stuart McCulloch | 1bcd795 | 2009-02-26 21:29:51 +0000 | [diff] [blame] | 634 | <li><em><tt>supportedProjectTypes</tt></em> defaults to "jar","bundle"</li> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 635 | </ul> |
| 636 | </li> |
| 637 | </ul> |
| 638 | |
| 639 | |
| 640 | <ul> |
| 641 | <li><b><tt>deploy-file</tt></b> - adds a local bundle file to a remote OBR<br> |
| 642 | configuration options: |
| 643 | <ul> |
| 644 | <li><em><tt>remoteOBR</tt></em> name of remote OBR, defaults to an empty string</li> |
| 645 | <li><em><tt>obrRepository</tt></em> used when the remoteOBR name is blank, defaults to <tt>repository.xml</tt></li> |
| 646 | <li><em><tt>repositoryId</tt></em> optional repository id, used to lookup authentication settings</li> |
| 647 | <li><em><tt>url</tt></em> remote repository transport URL, like |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 648 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 649 | <pre>scpexe://host/path/to/obr |
| 650 | </pre> |
| 651 | </div></div></li> |
| 652 | <li><em><tt>bundleUrl</tt></em> public URL of deployed bundle, like |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 653 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 654 | <pre>http://www.foo.org/bundles/foo.jar |
| 655 | </pre> |
| 656 | </div></div></li> |
| 657 | <li><em><tt>groupId</tt></em> Maven groupId for the bundle, taken from <em>pomFile</em> if given</li> |
| 658 | <li><em><tt>artifactId</tt></em> Maven artifactId for the bundle, taken from <em>pomFile</em> if given</li> |
| 659 | <li><em><tt>version</tt></em> Maven version for the bundle, taken from <em>pomFile</em> if given</li> |
| 660 | <li><em><tt>packaging</tt></em> Maven packaging type for the bundle, taken from <em>pomFile</em> if given</li> |
| 661 | <li><em><tt>classifier</tt></em> Maven classifier type, defaults to none</li> |
| 662 | <li><em><tt>pomFile</tt></em> optional Pom file describing the bundle</li> |
| 663 | <li><em><tt>file</tt></em> bundle file, defaults to the bundle from the local Maven repository</li> |
| 664 | <li><em><tt>obrXml</tt></em> optional additional properties for the bundle</li> |
| 665 | <li><em><tt>ignoreLock</tt></em> ignore remote locking when updating the OBR</li> |
| 666 | </ul> |
| 667 | </li> |
| 668 | </ul> |
| 669 | |
| 670 | |
| 671 | <ul> |
| 672 | <li><b><tt>clean</tt></b> - cleans the local OBR, removing missing bundles<br> |
| 673 | configuration options: |
| 674 | <ul> |
| 675 | <li><em><tt>obrRepository</tt></em> path to local OBR, defaults to <em><local-maven-repository></em><tt>/repository.xml</tt></li> |
| 676 | </ul> |
| 677 | </li> |
| 678 | </ul> |
| 679 | |
| 680 | |
Stuart McCulloch | 1bcd795 | 2009-02-26 21:29:51 +0000 | [diff] [blame] | 681 | <ul> |
| 682 | <li><b><tt>remote-clean</tt></b> - cleans a remote OBR, removing missing bundles<br> |
| 683 | configuration options: |
| 684 | <ul> |
| 685 | <li><em><tt>remoteOBR</tt></em> name of remote OBR, defaults to NONE (which means no remote cleaning)</li> |
| 686 | <li><em><tt>obrRepository</tt></em> used when the remoteOBR name is blank, defaults to <tt>repository.xml</tt></li> |
| 687 | <li><em><tt>prefixUrl</tt></em> optional public URL prefix for the remote repository</li> |
| 688 | <li><em><tt>altDeploymentRepository</tt></em> alternative remote repository, <em>id::layout::url</em></li> |
| 689 | <li><em><tt>obrDeploymentRepository</tt></em> optional OBR specific deployment repository.</li> |
| 690 | <li><em><tt>ignoreLock</tt></em> ignore remote locking when updating the OBR</li> |
| 691 | </ul> |
| 692 | </li> |
| 693 | </ul> |
| 694 | |
| 695 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 696 | <p>There are also new instructions available from the underlying BND |
| 697 | tool, which continues to be improved independently; for the latest see <a href="http://aqute.biz/Code/Bnd" class="external-link" rel="nofollow">BND documentation</a>.</p> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 698 | |
Stuart McCulloch | dd4ae5f | 2008-02-05 12:38:46 +0000 | [diff] [blame] | 699 | <p>The default goal <b><tt>bundle</tt></b> will be initialized by setting the <packaging> entry to "bundle".</p> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 700 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 701 | <h1><a name="ApacheFelixMavenBundlePlugin(BND)-Thefollowingfeaturesareonlyavailablefromversion1.2.0onwards"></a>The following features are only available from version 1.2.0 onwards</h1> |
Stuart McCulloch | 7c961f5 | 2008-01-02 08:56:07 +0000 | [diff] [blame] | 702 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 703 | <h2><a name="ApacheFelixMavenBundlePlugin(BND)-Embeddingdependencies"></a>Embedding dependencies</h2> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 704 | |
Stuart McCulloch | 7c961f5 | 2008-01-02 08:56:07 +0000 | [diff] [blame] | 705 | <p>The Maven Bundle Plugin supports embedding of selected project dependencies inside the bundle by using the <tt><Embed-Dependency></tt> instruction:</p> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 706 | |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 707 | <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> |
| 708 | <pre class="code-xml"><span class="code-tag"><Embed-Dependency></span>dependencies<span class="code-tag"></Embed-Dependency></span> |
| 709 | </pre> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 710 | </div></div> |
| 711 | |
| 712 | <p>where:</p> |
| 713 | |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 714 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 715 | <pre>dependencies ::= clause ( ',' clause ) * |
Stuart McCulloch | 1bcd795 | 2009-02-26 21:29:51 +0000 | [diff] [blame] | 716 | clause ::= MATCH ( ';' attr '=' MATCH | ';inline=' inline ) |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 717 | attr ::= 'groupId' | 'artifactId' | 'version' | 'scope' | 'type' | 'classifier' | 'optional' |
Stuart McCulloch | 1bcd795 | 2009-02-26 21:29:51 +0000 | [diff] [blame] | 718 | inline ::= 'true' | 'false' | PATH ( '|' PATH ) * |
| 719 | MATCH ::= <globbed regular expression> |
| 720 | PATH ::= <Ant-style path expression> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 721 | </pre> |
| 722 | </div></div> |
| 723 | |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 724 | <p>The plugin uses the <tt><Embed-Dependency></tt> instruction to transform the project dependencies into <tt><Include-Resource></tt> and <tt><Bundle-ClassPath></tt> |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 725 | clauses, which are then appended to the current set of instructions and |
| 726 | passed onto BND. If you want the embedded dependencies to be at the |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 727 | start or middle of <tt><Include-Resource></tt> or <tt><Bundle-ClassPath></tt> then you can use {<tt>maven-dependencies</tt>}, which will automatically expand to the relevant clauses.</p> |
Stuart McCulloch | 7c961f5 | 2008-01-02 08:56:07 +0000 | [diff] [blame] | 728 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 729 | <p>The MATCH section accepts alternatives, separated by <b>|</b>, and can be negated by using <b>!</b> at the <em>beginning</em> of the MATCH. Use <b>*</b> to represent zero or more unknown characters and <b>?</b> to represent zero or one character. You can also use standard Java <a href="http://java.sun.com/javase/6/docs/api/java/util/regex/Pattern.html" class="external-link" rel="nofollow">regexp</a> constructs. There is no need to escape the <b>.</b> character inside MATCH. The first MATCH in a clause will filter against the artifactId.</p> |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 730 | |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 731 | <p>some examples:</p> |
| 732 | |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 733 | <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 734 | <pre class="code-xml"><span class="code-tag"><span class="code-comment"><!-- embed all compile and runtime scope dependencies --></span></span> |
| 735 | <span class="code-tag"><Embed-Dependency></span>*;scope=compile|runtime<span class="code-tag"></Embed-Dependency></span> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 736 | |
Stuart McCulloch | 1bcd795 | 2009-02-26 21:29:51 +0000 | [diff] [blame] | 737 | <span class="code-tag"><span class="code-comment"><!-- embed any dependencies with artifactId junit and scope runtime --></span></span> |
| 738 | <span class="code-tag"><Embed-Dependency></span>junit;scope=runtime<span class="code-tag"></Embed-Dependency></span> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 739 | |
Stuart McCulloch | 1bcd795 | 2009-02-26 21:29:51 +0000 | [diff] [blame] | 740 | <span class="code-tag"><span class="code-comment"><!-- inline all non-pom dependencies, except those with scope runtime --></span></span> |
| 741 | <span class="code-tag"><Embed-Dependency></span>*;scope=!runtime;type=!pom;inline=true<span class="code-tag"></Embed-Dependency></span> |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 742 | |
| 743 | <span class="code-tag"><span class="code-comment"><!-- embed all compile and runtime scope dependencies, except those with artifactIds in the given list --></span></span> |
Stuart McCulloch | 1bcd795 | 2009-02-26 21:29:51 +0000 | [diff] [blame] | 744 | <span class="code-tag"><Embed-Dependency></span>*;scope=compile|runtime;inline=false;artifactId=!cli|lang|runtime|tidy|jsch<span class="code-tag"></Embed-Dependency></span> |
| 745 | |
| 746 | <span class="code-tag"><span class="code-comment"><!-- inline contents of selected folders from all dependencies --></span></span> |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 747 | <span class="code-tag"><Embed-Dependency></span>*;inline=images/**|icons/**<span class="code-tag"></Embed-Dependency></span> |
| 748 | </pre> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 749 | </div></div> |
| 750 | |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 751 | <p>examples of using {<tt>maven-dependencies</tt>}:</p> |
| 752 | |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 753 | <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 754 | <pre class="code-xml"><span class="code-tag"><Include-Resource></span> |
| 755 | {maven-resources}, {maven-dependencies}, |
| 756 | org/foo/Example.class=target/classes/org/foo/Example.class |
| 757 | <span class="code-tag"></Include-Resource></span> |
| 758 | |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 759 | <span class="code-tag"><Bundle-ClassPath></span>.,{maven-dependencies},some.jar<span class="code-tag"></Bundle-ClassPath></span> |
| 760 | </pre> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 761 | </div></div> |
| 762 | |
Stuart McCulloch | 7c961f5 | 2008-01-02 08:56:07 +0000 | [diff] [blame] | 763 | <p>By default matched dependencies are embedded in the bundle as <tt>artifactId-version.jar</tt>. This behaviour can be modified using the following instructions:</p> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 764 | |
| 765 | <ul> |
| 766 | <li><tt><Embed-StripVersion>true</Embed-StripVersion></tt> - removes the version from the file (ie. <em>artifactId.jar</em>)</li> |
| 767 | <li><tt><Embed-StripGroup>false</Embed-StripGroup></tt> - adds the groupId as a subdirectory (ie. <em>groupId/artifactId-version.jar</em>)</li> |
| 768 | <li><tt><Embed-Directory>directory</Embed-Directory></tt> - adds a subdirectory (ie. <em>directory/artifactId-version.jar</em>)</li> |
| 769 | </ul> |
| 770 | |
| 771 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 772 | <p>Normally the plugin only checks direct dependencies, but this can be |
| 773 | changed to include the complete set of transitive dependencies with the |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 774 | following option:</p> |
| 775 | |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 776 | <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> |
| 777 | <pre class="code-xml"><span class="code-tag"><Embed-Transitive></span>true<span class="code-tag"></Embed-Transitive></span> |
| 778 | </pre> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 779 | </div></div> |
| 780 | |
| 781 | <p>If you want a dependency inlined instead of embedded add the <tt>inline=true</tt>. For example to inline all <em>compile</em> and <em>runtime</em> scoped dependencies use:</p> |
| 782 | |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 783 | <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> |
| 784 | <pre class="code-xml"><span class="code-tag"><Embed-Dependency></span>*;scope=compile|runtime;inline=true<span class="code-tag"></Embed-Dependency></span> |
| 785 | </pre> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 786 | </div></div> |
| 787 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 788 | <h3><a name="ApacheFelixMavenBundlePlugin(BND)-EmbedDependencyandExportPackage"></a>Embed-Dependency and Export-Package</h3> |
Stuart McCulloch | 7c961f5 | 2008-01-02 08:56:07 +0000 | [diff] [blame] | 789 | |
| 790 | <p>If you embed a dependency with <tt><Embed-Dependency></tt>, and your <tt><Export-Package></tt> or <tt><Private-Package></tt> instructions match packages inside the embedded jar, you will see some duplication inside the bundle. This is because the <tt><Export-Package></tt> and <tt><Private-Package></tt> |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 791 | instructions will result in classes being inlined in the bundle, even |
| 792 | though they also exist inside the embedded jar. If you want to export |
| 793 | packages from an embedded dependency without such duplication then you |
Stuart McCulloch | 7c961f5 | 2008-01-02 08:56:07 +0000 | [diff] [blame] | 794 | can either inline the dependency, or use a new BND instruction called <tt><_exportcontents></tt>.</p> |
| 795 | |
| 796 | <p><tt><_exportcontents></tt> behaves just like Export-Package, except it doesn't change the content of the bundle, just what content should be exported.</p> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 797 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 798 | <h2><a name="ApacheFelixMavenBundlePlugin(BND)-OBRintegration"></a>OBR integration</h2> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 799 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 800 | <p>The latest Maven Bundle Plugin automatically updates the local OBR |
| 801 | repository.xml file during the install phase, using a default location |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 802 | of:</p> |
| 803 | |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 804 | <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> |
| 805 | <pre class="code-java"><LOCAL-MAVEN-REPOSITORY>/repository.xml |
| 806 | </pre> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 807 | </div></div> |
| 808 | |
| 809 | <p>You can configure the location of the OBR repository by using the command line:</p> |
| 810 | |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 811 | <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> |
| 812 | <pre class="code-java">mvn clean install -DobrRepository=<PATH_TO_OBR> |
| 813 | </pre> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 814 | </div></div> |
| 815 | |
| 816 | <p>or in the configuration section for the maven-bundle-plugin in your Maven POM:</p> |
| 817 | |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 818 | <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 819 | <pre class="code-xml"><span class="code-tag"><groupId></span>org.apache.felix<span class="code-tag"></groupId></span> |
| 820 | <span class="code-tag"><artifactId></span>maven-bundle-plugin<span class="code-tag"></artifactId></span> |
| 821 | <span class="code-tag"><extensions></span>true<span class="code-tag"></extensions></span> |
| 822 | <span class="code-tag"><configuration></span> |
| 823 | <span class="code-tag"><obrRepository></span>PATH_TO_OBR<span class="code-tag"></obrRepository></span> |
| 824 | <span class="code-tag"><instructions></span> |
| 825 | <span class="code-tag"><span class="code-comment"><!-- bnd instructions --></span></span> |
| 826 | <span class="code-tag"></instructions></span> |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 827 | <span class="code-tag"></configuration></span> |
| 828 | </pre> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 829 | </div></div> |
| 830 | |
| 831 | <p>to disable OBR installation set the obrRepository to NONE, for example:</p> |
| 832 | |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 833 | <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 834 | <pre class="code-xml"><span class="code-tag"><groupId></span>org.apache.felix<span class="code-tag"></groupId></span> |
| 835 | <span class="code-tag"><artifactId></span>maven-bundle-plugin<span class="code-tag"></artifactId></span> |
| 836 | <span class="code-tag"><extensions></span>true<span class="code-tag"></extensions></span> |
| 837 | <span class="code-tag"><configuration></span> |
| 838 | <span class="code-tag"><obrRepository></span>NONE<span class="code-tag"></obrRepository></span> |
| 839 | <span class="code-tag"><instructions></span> |
| 840 | <span class="code-tag"><span class="code-comment"><!-- bnd instructions --></span></span> |
| 841 | <span class="code-tag"></instructions></span> |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 842 | <span class="code-tag"></configuration></span> |
| 843 | </pre> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 844 | </div></div> |
| 845 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 846 | <h2><a name="ApacheFelixMavenBundlePlugin(BND)-Eclipse/PDEintegration"></a>Eclipse/PDE integration</h2> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 847 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 848 | <p>It is possible to configure the Maven Bundle Plugin to put the bundle |
| 849 | manifest where Eclipse/PDE expects it, and use the Maven Dependency |
| 850 | Plugin to arrange for any embedded dependencies to appear in a local |
| 851 | directory that matches the Bundle-ClassPath entries. Here is an example |
| 852 | POM that does this:</p> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 853 | |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 854 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 855 | <pre><project> |
| 856 | |
| 857 | <properties> |
| 858 | <bundle.symbolicName>org.example</bundle.symbolicName> |
| 859 | <bundle.namespace>org.example</bundle.namespace> |
| 860 | </properties> |
| 861 | |
| 862 | <modelVersion>4.0.0</modelVersion> |
| 863 | <groupId>examples</groupId> |
| 864 | <artifactId>org.example</artifactId> |
| 865 | <version>1.0-SNAPSHOT</version> |
| 866 | |
| 867 | <name>${bundle.symbolicName} [${bundle.namespace}]</name> |
| 868 | |
| 869 | <packaging>bundle</packaging> |
| 870 | |
| 871 | <build> |
Stuart McCulloch | dd4ae5f | 2008-02-05 12:38:46 +0000 | [diff] [blame] | 872 | <resources> |
| 873 | <resource> |
| 874 | <directory>src/main/resources</directory> |
| 875 | </resource> |
| 876 | <resource> |
| 877 | <directory>.</directory> |
| 878 | <includes> |
| 879 | <include>plugin.xml</include> |
| 880 | </includes> |
| 881 | </resource> |
| 882 | </resources> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 883 | <plugins> |
| 884 | <plugin> |
| 885 | <groupId>org.apache.felix</groupId> |
| 886 | <artifactId>maven-bundle-plugin</artifactId> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 887 | <version>1.2.1</version> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 888 | <extensions>true</extensions> |
| 889 | <!-- |
| 890 | the following instructions build a simple set of public/private classes into an OSGi bundle |
| 891 | --> |
| 892 | <configuration> |
| 893 | <manifestLocation>META-INF</manifestLocation> |
| 894 | <instructions> |
| 895 | <Bundle-SymbolicName>${bundle.symbolicName}</Bundle-SymbolicName> |
| 896 | <Bundle-Version>${pom.version}</Bundle-Version> |
| 897 | <!-- |
| 898 | assume public classes are in the top package, and private classes are under ".internal" |
| 899 | --> |
Stuart McCulloch | dd4ae5f | 2008-02-05 12:38:46 +0000 | [diff] [blame] | 900 | <Export-Package>!${bundle.namespace}.internal.*,${bundle.namespace}.*;version="${pom.version}"</Export-Package> |
| 901 | <Private-Package>${bundle.namespace}.internal.*</Private-Package> |
| 902 | <Bundle-Activator>${bundle.namespace}.internal.ExampleActivator</Bundle-Activator> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 903 | <!-- |
| 904 | embed compile/runtime dependencies using path that matches the copied dependency folder |
| 905 | --> |
| 906 | <Embed-Dependency>*;scope=compile|runtime;inline=false</Embed-Dependency> |
| 907 | <Embed-Directory>target/dependency</Embed-Directory> |
| 908 | <Embed-StripGroup>true</Embed-StripGroup> |
| 909 | </instructions> |
| 910 | </configuration> |
| 911 | </plugin> |
| 912 | <plugin> |
| 913 | <artifactId>maven-dependency-plugin</artifactId> |
| 914 | <executions> |
| 915 | <execution> |
| 916 | <id>copy-dependencies</id> |
| 917 | <phase>package</phase> |
| 918 | <goals> |
| 919 | <goal>copy-dependencies</goal> |
| 920 | </goals> |
| 921 | </execution> |
| 922 | </executions> |
| 923 | </plugin> |
| 924 | </plugins> |
| 925 | </build> |
| 926 | |
| 927 | <dependencies> |
| 928 | <dependency> |
| 929 | <groupId>org.osgi</groupId> |
| 930 | <artifactId>osgi_R4_core</artifactId> |
| 931 | <version>1.0</version> |
| 932 | <scope>provided</scope> |
| 933 | <optional>true</optional> |
| 934 | </dependency> |
| 935 | <dependency> |
| 936 | <groupId>org.osgi</groupId> |
| 937 | <artifactId>osgi_R4_compendium</artifactId> |
| 938 | <version>1.0</version> |
| 939 | <scope>provided</scope> |
| 940 | <optional>true</optional> |
| 941 | </dependency> |
| 942 | <dependency> |
| 943 | <groupId>junit</groupId> |
| 944 | <artifactId>junit</artifactId> |
| 945 | <version>3.8.1</version> |
| 946 | <scope>compile</scope> |
| 947 | <optional>true</optional> |
| 948 | </dependency> |
| 949 | </dependencies> |
| 950 | |
| 951 | </project> |
| 952 | </pre> |
| 953 | </div></div> |
| 954 | |
| 955 | <p>To generate the Eclipse metadata use:</p> |
| 956 | |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 957 | <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> |
| 958 | <pre class="code-java">mvn clean <span class="code-keyword">package</span> eclipse:eclipse -Declipse.pde install |
| 959 | </pre> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 960 | </div></div> |
| 961 | |
| 962 | <p>and you should now be able to import this as an existing Eclipse project.</p> |
| 963 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 964 | <p>FYI: the above POM was generated using the <tt>pax-create-bundle</tt> command from <a href="http://www.ops4j.org/projects/pax/construct/index.html" class="external-link" rel="nofollow">Pax-Construct</a> and then tweaked to demonstrate using the Maven Dependency Plugin to handle embedded jars in Eclipse.</p> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 965 | |
| 966 | <p>With the original Pax-Construct generated POM you would simply use:</p> |
| 967 | |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 968 | <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> |
| 969 | <pre class="code-java">mvn clean <span class="code-keyword">package</span> pax:eclipse |
| 970 | </pre> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 971 | </div></div> |
| 972 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 973 | <p>to create the appropriate Eclipse files and manifest, and also handle |
| 974 | any embedded entries. The pax:eclipse goal extends eclipse:eclipse, and |
| 975 | supports the same parameters.</p> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 976 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 977 | <h2><a name="ApacheFelixMavenBundlePlugin(BND)-Unpackingbundlecontentsto'target/classes'"></a>Unpacking bundle contents to 'target/classes'</h2> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 978 | |
| 979 | <p>Once in a while you may create a bundle which contains additional classes to the ones compiled from <tt>src/main/java</tt>, |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 980 | for example when you embed the classes from another jar. This can |
| 981 | sometimes cause unforeseen problems in Maven, as it will use the output |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 982 | directory (<tt>target/classes</tt>) rather than the final bundle, when compiling against projects in the same reactor (ie. the same build).</p> |
| 983 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 984 | <p>The easiest way to get around this Maven 'feature' is to unpack the |
| 985 | contents of the bundle to the output directory after the packaging step, |
| 986 | so the additional classes will be found where Maven expects them. |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 987 | Thankfully there is now an easy option to do this in the bundle-plugin:</p> |
| 988 | |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 989 | <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> |
Stuart McCulloch | dd4ae5f | 2008-02-05 12:38:46 +0000 | [diff] [blame] | 990 | <pre class="code-xml"><span class="code-tag"><groupId></span>org.apache.felix<span class="code-tag"></groupId></span> |
| 991 | <span class="code-tag"><artifactId></span>maven-bundle-plugin<span class="code-tag"></artifactId></span> |
| 992 | <span class="code-tag"><extensions></span>true<span class="code-tag"></extensions></span> |
| 993 | <span class="code-tag"><configuration></span> |
| 994 | <span class="code-tag"><unpackBundle></span>true<span class="code-tag"></unpackBundle></span> |
| 995 | <span class="code-tag"><instructions></span> |
| 996 | <span class="code-tag"><span class="code-comment"><!-- bnd instructions --></span></span> |
| 997 | <span class="code-tag"></instructions></span> |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 998 | <span class="code-tag"></configuration></span> |
| 999 | </pre> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 1000 | </div></div> |
| 1001 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 1002 | <h2><a name="ApacheFelixMavenBundlePlugin(BND)-UsinganexistingMANIFEST.MFfile"></a>Using an existing MANIFEST.MF file</h2> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 1003 | |
| 1004 | <p>If you have an existing manifest, you can add this to the Bnd instructions, like so:</p> |
| 1005 | |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 1006 | <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> |
Stuart McCulloch | dd4ae5f | 2008-02-05 12:38:46 +0000 | [diff] [blame] | 1007 | <pre class="code-xml"><span class="code-tag"><_include></span>src/main/resources/META-INF/MANIFEST.MF<span class="code-tag"></_include></span> |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 1008 | <span class="code-tag"><Export-Package></span>org.example.*<span class="code-tag"></Export-Package></span> |
| 1009 | </pre> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 1010 | </div></div> |
| 1011 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 1012 | <p>Bnd will use it when calculating the bundle contents, and will also |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 1013 | copy across all manifest attributes starting with a capital letter.<br> |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 1014 | As shown in the above example, you could use this to include a non-OSGi |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 1015 | manifest which you then customize with extra OSGi attributes.</p> |
| 1016 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 1017 | <h1><a name="ApacheFelixMavenBundlePlugin(BND)-Thefollowingfeaturesareonlyavailablefromversion1.4.0onwards"></a>The following features are only available from version 1.4.0 onwards</h1> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 1018 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 1019 | <h2><a name="ApacheFelixMavenBundlePlugin(BND)-bundle:ant"></a>bundle:ant</h2> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 1020 | |
| 1021 | <p>The <b>ant</b> goal creates a customized <tt>build.xml</tt> Ant script along with a collection of BND instructions and properties, taken from the current project and stored in <tt>maven-build.bnd</tt>. You also need to run <b><tt>ant:ant</tt></b> to create the standard Ant support tasks to download Maven dependencies and perform compilation, etc.</p> |
| 1022 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 1023 | <p>The customized Ant script uses the BND tool to rebuild the bundle, so |
| 1024 | any source changes should be reflected in the (re)generated manifest.</p> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 1025 | |
| 1026 | <p>Example:</p> |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 1027 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 1028 | <pre>mvn ant:ant bundle:ant |
| 1029 | |
| 1030 | ant clean package |
| 1031 | </pre> |
| 1032 | </div></div> |
| 1033 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 1034 | <h2><a name="ApacheFelixMavenBundlePlugin(BND)-bundle:installfile"></a>bundle:install-file</h2> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 1035 | |
| 1036 | <p>The <b>install-file</b> goal updates the local OBR with the details of a bundle from the local filesystem.</p> |
| 1037 | |
| 1038 | <p>configuration:</p> |
| 1039 | <ul> |
| 1040 | <li><em>obrRepository</em> path to local OBR, defaults to <em><local-maven-repository></em><tt>/repository.xml</tt></li> |
| 1041 | <li><em>groupId</em> Maven groupId for the bundle, taken from <em>pomFile</em> if given</li> |
| 1042 | <li><em>artifactId</em> Maven artifactId for the bundle, taken from <em>pomFile</em> if given</li> |
| 1043 | <li><em>version</em> Maven version for the bundle, taken from <em>pomFile</em> if given</li> |
| 1044 | <li><em>packaging</em> Maven packaging type for the bundle, taken from <em>pomFile</em> if given</li> |
| 1045 | <li><em>classifier</em> Maven classifier type, defaults to none</li> |
| 1046 | <li><em>pomFile</em> optional Pom file describing the bundle</li> |
| 1047 | <li><em>file</em> bundle file, defaults to the bundle from the local Maven repository</li> |
| 1048 | <li><em>obrXml</em> optional additional properties for the bundle</li> |
| 1049 | </ul> |
| 1050 | |
| 1051 | |
| 1052 | <p>Example:</p> |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 1053 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 1054 | <pre>mvn org.apache.felix:maven-bundle-plugin:1.4.0:install-file \ |
| 1055 | -DpomFile=myPom.xml -Dfile=foo-1.0.jar |
| 1056 | </pre> |
| 1057 | </div></div> |
| 1058 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 1059 | <h2><a name="ApacheFelixMavenBundlePlugin(BND)-bundle:deploy"></a>bundle:deploy</h2> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 1060 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 1061 | <p>The <b>deploy goal</b> updates the remote OBR with the details of the |
| 1062 | deployed bundle from the local Maven repository. The remote OBR is |
| 1063 | found by querying the <tt><distributionManagement></tt> section of the project, unless <tt>-DaltDeploymentRepository</tt> is set. See <a href="http://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html" class="external-link" rel="nofollow">http://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html</a> for more details about these particular settings.</p> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 1064 | |
| 1065 | <p>(If the project has an <tt>obr.xml</tt> file somewhere in its resources, then it will be automatically detected and applied.)</p> |
| 1066 | |
| 1067 | <p>configuration:</p> |
| 1068 | <ul> |
| 1069 | <li><em>remoteOBR</em> name of remote OBR, defaults to NONE (which means no remote OBR deployment)</li> |
| 1070 | <li><em>obrRepository</em> used when the remoteOBR name is blank, defaults to <tt>repository.xml</tt></li> |
| 1071 | <li><em>altDeploymentRepository</em> alternative remote repository, <em>id::layout::url</em></li> |
| 1072 | <li><em>ignoreLock</em> ignore remote locking when updating the OBR</li> |
| 1073 | </ul> |
| 1074 | |
| 1075 | |
| 1076 | <p>This goal is part of the "bundle" packaging lifecycle, but is disabled by default - to enable just set the <tt>remoteOBR</tt> parameter.</p> |
| 1077 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 1078 | <h2><a name="ApacheFelixMavenBundlePlugin(BND)-bundle:deployfile"></a>bundle:deploy-file</h2> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 1079 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 1080 | <p>The <b>deploy-file</b> goal updates the remote OBR with the details of a deployed bundle from the local filesystem. The remote OBR is found using the <tt>-DrepositoryId</tt> and <tt>-Durl</tt> parameters. See <a href="http://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html" class="external-link" rel="nofollow">http://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html</a> for more details about these particular settings.</p> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 1081 | |
| 1082 | <p>You can use the <tt>-DbundleUrl</tt> parameter to give the public location of the deployed bundle, which may differ from the remote OBR location.</p> |
| 1083 | |
| 1084 | <p>configuration:</p> |
| 1085 | <ul> |
| 1086 | <li><em>remoteOBR</em> name of remote OBR, defaults to an empty string</li> |
| 1087 | <li><em>obrRepository</em> used when the remoteOBR name is blank, defaults to <tt>repository.xml</tt></li> |
| 1088 | <li><em>repositoryId</em> optional repository id, used to lookup authentication settings</li> |
| 1089 | <li><em>url</em> remote repository transport URL, like |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 1090 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 1091 | <pre>scpexe://host/path/to/obr |
| 1092 | </pre> |
| 1093 | </div></div></li> |
| 1094 | <li><em>bundleUrl</em> public URL of deployed bundle, like |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 1095 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 1096 | <pre>http://www.foo.org/bundles/foo.jar |
| 1097 | </pre> |
| 1098 | </div></div></li> |
| 1099 | <li><em>groupId</em> Maven groupId for the bundle, taken from <em>pomFile</em> if given</li> |
| 1100 | <li><em>artifactId</em> Maven artifactId for the bundle, taken from <em>pomFile</em> if given</li> |
| 1101 | <li><em>version</em> Maven version for the bundle, taken from <em>pomFile</em> if given</li> |
| 1102 | <li><em>packaging</em> Maven packaging type for the bundle, taken from <em>pomFile</em> if given</li> |
| 1103 | <li><em>classifier</em> Maven classifier type, defaults to none</li> |
| 1104 | <li><em>pomFile</em> optional Pom file describing the bundle</li> |
| 1105 | <li><em>file</em> bundle file, defaults to the bundle from the local Maven repository</li> |
| 1106 | <li><em>obrXml</em> optional additional properties for the bundle</li> |
| 1107 | <li><em>ignoreLock</em> ignore remote locking when updating the OBR</li> |
| 1108 | </ul> |
| 1109 | |
| 1110 | |
Stuart McCulloch | 2eb6112 | 2009-02-27 06:38:33 +0000 | [diff] [blame] | 1111 | |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 1112 | <p>Example:</p> |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 1113 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 1114 | <pre>mvn org.apache.felix:maven-bundle-plugin:1.4.0:deploy-file \ |
| 1115 | -DpomFile=myPom.xml -Dfile=foo-1.0.jar -Durl=file:/tmp/example/OBR \ |
| 1116 | -DbundleUrl=http://www.foo.org/bundles/foo.jar |
| 1117 | </pre> |
| 1118 | </div></div> |
| 1119 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 1120 | <h2><a name="ApacheFelixMavenBundlePlugin(BND)-bundle:clean"></a>bundle:clean</h2> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 1121 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 1122 | <p>Sometimes you would like to clean your local OBR because it contains |
| 1123 | bundles that are no longer in your local Maven repository. This case |
| 1124 | often occurs when artifacts were deleted manually. The |
| 1125 | maven-bundle-plugin provides a simple goal to check for missing bundles, |
| 1126 | and remove them from the local OBR.</p> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 1127 | |
| 1128 | <p>configuration:</p> |
| 1129 | <ul> |
| 1130 | <li><em>obrRepository</em> path to local OBR, defaults to <em><local-maven-repository></em><tt>/repository.xml</tt></li> |
| 1131 | </ul> |
| 1132 | |
| 1133 | |
| 1134 | <p>Example:</p> |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 1135 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 1136 | <pre>mvn bundle:clean |
| 1137 | </pre> |
| 1138 | </div></div> |
| 1139 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 1140 | <h2><a name="ApacheFelixMavenBundlePlugin(BND)-bundle:index"></a>bundle:index</h2> |
| 1141 | |
| 1142 | <p>The <tt>index</tt> goal allows the creation of an OBR repository based on a set of jars in a maven repository.</p> |
| 1143 | |
| 1144 | <p>Configuration:</p> |
| 1145 | <ul> |
| 1146 | <li><em>obrRepository</em> path to local OBR, defaults to <em><local-maven-repository></em><tt>/repository.xml</tt></li> |
| 1147 | <li><em>urlTemplate</em> template for generating urls for OBR resources</li> |
| 1148 | <li><em>mavenRepository</em> path to the maven repository, defaults to <em><local-maven-repository></em></li> |
| 1149 | </ul> |
| 1150 | |
| 1151 | |
| 1152 | <p>Possible values for the <tt>urlTemplate</tt> are:</p> |
| 1153 | <ul> |
| 1154 | <li><em>maven</em> this will create a maven based url such as <tt>mvn:groupid/artifactid/version</tt></li> |
| 1155 | <li>pattern with the following placeholders: |
| 1156 | <ul> |
| 1157 | <li><tt>%v</tt> bundle version</li> |
| 1158 | <li><tt>%s</tt> bundle symbolic name</li> |
| 1159 | <li><tt>%f</tt> file name</li> |
| 1160 | <li><tt>%p</tt> file path</li> |
| 1161 | </ul> |
| 1162 | </li> |
| 1163 | </ul> |
| 1164 | |
| 1165 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 1166 | <h2><a name="ApacheFelixMavenBundlePlugin(BND)-Concurrentupdates"></a>Concurrent updates</h2> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 1167 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 1168 | <p>With a remote OBR, several uploads may occur at the same time. |
| 1169 | However, the remote OBR is centralized in one file, so concurrent |
| 1170 | modification must be avoided. To achieve this, the plug-in implements a |
| 1171 | locking system. Each time the plug-in tries to modify the file it sets a |
| 1172 | file based lock. If it can't take the lock, it will wait and retry. |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 1173 | After 3 attempts the upload process fails. To bypass this lock add <tt>-DignoreLock</tt> to the command-line (or add <tt><ignoreLock>true<ignoreLock></tt> to the configuration section of your Pom).</p> |
| 1174 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 1175 | <h2><a name="ApacheFelixMavenBundlePlugin(BND)-FTPprotocol"></a>FTP protocol</h2> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 1176 | |
| 1177 | <p>Not all protocols are supported by Maven out of the box. For example the ftp protocol requires the <b>wagon-ftp</b> component. To enable the ftp protocol add this to your Pom:</p> |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 1178 | <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent"> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 1179 | <pre class="code-xml"><span class="code-tag"><build></span> |
| 1180 | <span class="code-tag"><extensions></span> |
| 1181 | <span class="code-tag"><extension></span> |
| 1182 | <span class="code-tag"><groupId></span>org.apache.maven.wagon<span class="code-tag"></groupId></span> |
| 1183 | <span class="code-tag"><artifactId></span>wagon-ftp<span class="code-tag"></artifactId></span> |
| 1184 | <span class="code-tag"><version></span>1.0-alpha-6<span class="code-tag"></version></span> |
| 1185 | <span class="code-tag"></extension></span> |
| 1186 | <span class="code-tag"></extensions></span> |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 1187 | <span class="code-tag"></build></span> |
| 1188 | </pre> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 1189 | </div></div> |
| 1190 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 1191 | <h2><a name="ApacheFelixMavenBundlePlugin(BND)-Howtheplugincomputesthedescriptionofthebundle"></a>How the plug-in computes the description of the bundle</h2> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 1192 | |
| 1193 | <p>The description of the bundle comes from three different sources:</p> |
| 1194 | <ul> |
| 1195 | <li>Bindex : Bindex is a tool that analyzes a bundle manifest to generate OBR description</li> |
| 1196 | <li>pom.xml : by analyzing the pom file, various information is collected (symbolic name ...)</li> |
| 1197 | <li>obr.xml : this file contains customized description and capabilities for the bundle</li> |
| 1198 | </ul> |
| 1199 | |
| 1200 | |
| 1201 | <p>These sources are merged together using the following precedence:</p> |
Stuart McCulloch | efb03e4 | 2009-09-16 09:47:50 +0000 | [diff] [blame] | 1202 | <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 1203 | <pre>Bindex |
| 1204 | | (overrides) |
| 1205 | pom.xml |
| 1206 | | (overrides) |
| 1207 | obr.xml |
| 1208 | </pre> |
| 1209 | </div></div> |
| 1210 | <p>A warning message is displayed when existing information is overridden.</p> |
| 1211 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 1212 | <h2><a name="ApacheFelixMavenBundlePlugin(BND)-Knownissues&limitations"></a>Known issues & limitations</h2> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 1213 | |
| 1214 | <ol> |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 1215 | <li>obr.xml (file given by the user to add properties not found by |
| 1216 | Bindex) must be correct, because the plug-in does not check its syntax.</li> |
Stuart McCulloch | 0340ae4 | 2008-02-22 11:27:18 +0000 | [diff] [blame] | 1217 | </ol> |
| 1218 | |
| 1219 | |
Stuart McCulloch | 3f38f73 | 2008-05-03 08:13:09 +0000 | [diff] [blame] | 1220 | <h1><a name="ApacheFelixMavenBundlePlugin(BND)-Feedback"></a>Feedback</h1> |
Stuart McCulloch | 93de649 | 2007-12-16 15:59:05 +0000 | [diff] [blame] | 1221 | |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 1222 | <p>Subscribe to the Felix users mailing list by sending a message to <a href="mailto:users-subscribe@felix.apache.org" class="external-link" rel="nofollow">users-subscribe@felix.apache.org</a>; after subscribing, email questions or feedback to <a href="mailto:users@felix.apache.org" class="external-link" rel="nofollow">users@felix.apache.org</a>.</p> |
| 1223 | <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;"> |
Stuart McCulloch | fc1018e | 2013-06-07 23:34:51 +0000 | [diff] [blame] | 1224 | Last modified by mcculls on Wed Nov 21 20:06:53 EST 2012 |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 1225 | </div> |
| 1226 | <div class="trademarkFooter"> |
| 1227 | Apache Felix, Felix, Apache, the Apache feather logo, and the Apache |
| 1228 | Felix project logo are trademarks of The Apache Software Foundation. All |
| 1229 | other marks mentioned may be trademarks or registered trademarks of |
| 1230 | their respective owners. |
| 1231 | </div> |
Karl Pauls | f87ac14 | 2007-07-06 22:36:17 +0000 | [diff] [blame] | 1232 | </div> |
Stuart McCulloch | 0bb7aba | 2011-11-28 15:58:52 +0000 | [diff] [blame] | 1233 | |
| 1234 | |
Stuart McCulloch | fc1018e | 2013-06-07 23:34:51 +0000 | [diff] [blame] | 1235 | </body></html> |