Stuart McCulloch | 7c961f5 | 2008-01-02 08:56:07 +0000 | [diff] [blame^] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 2 | <html><head><title>Apache Felix - Maven Obr Plugin</title> |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | <link rel="stylesheet" href="maven-obr-plugin_files/site.css" type="text/css" media="all"> |
| 8 | <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"></head><body> |
| 9 | <div class="title"><div class="logo"><a href="http://felix.apache.org/site/index.html"><img alt="Apache Felix" src="maven-obr-plugin_files/logo.png" border="0"></a></div><div class="header"><a href="http://www.apache.org/"><img alt="Apache" src="maven-obr-plugin_files/apache.png" border="0"></a></div></div> |
| 10 | <div class="menu"> |
| 11 | <ul> |
| 12 | <li><a href="http://felix.apache.org/site/index.html" title="Index">home</a></li> |
| 13 | <li><a href="http://felix.apache.org/site/news.html" title="news">news</a></li> |
| 14 | <li><a href="http://felix.apache.org/site/status.html" title="status">status</a></li> |
| 15 | <li><a href="http://felix.apache.org/site/license.html" title="license">license</a></li> |
| 16 | <li><span class="nobr"><a href="http://felix.apache.org/site/downloads.cgi" title="Visit page outside Confluence" rel="nofollow">downloads<sup><img class="rendericon" src="maven-obr-plugin_files/linkext7.gif" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span></li> |
| 17 | <li><a href="http://felix.apache.org/site/documentation.html" title="documentation">documentation</a></li> |
| 18 | <li><a href="http://felix.apache.org/site/mailinglists.html" title="mailinglists">mailing lists</a></li> |
| 19 | <li><span class="nobr"><a href="http://cwiki.apache.org/confluence/x/O-" title="Visit page outside Confluence" rel="nofollow">wiki<sup><img class="rendericon" src="maven-obr-plugin_files/linkext7.gif" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span></li> |
| 20 | <li><a href="http://felix.apache.org/site/committers.html" title="committers">committers</a></li> |
| 21 | <li><a href="http://felix.apache.org/site/faq.html" title="faq">faq</a></li> |
| 22 | <li><a href="http://felix.apache.org/site/roadmap.html" title="roadmap">roadmap</a></li> |
| 23 | <li><a href="http://felix.apache.org/site/sourcecode.html" title="sourcecode">source code</a></li> |
| 24 | <li><a href="http://felix.apache.org/site/codingstandards.html" title="codingstandards">coding standards</a></li> |
| 25 | <li><a href="http://felix.apache.org/site/issuetracking.html" title="issuetracking">issue tracking</a></li> |
| 26 | <li><a href="http://felix.apache.org/site/dependencies.html" title="dependencies">dependencies</a></li> |
| 27 | <li><span class="nobr"><a href="http://www.apache.org/" title="Visit page outside Confluence" rel="nofollow">apache software foundation<sup><img class="rendericon" src="maven-obr-plugin_files/linkext7.gif" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span></li> |
| 28 | <li><span class="nobr"><a href="http://www.apache.org/foundation/sponsorship.html" title="Visit page outside Confluence" rel="nofollow">sponsorship<sup><img class="rendericon" src="maven-obr-plugin_files/linkext7.gif" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span></li> |
| 29 | <li><span class="nobr"><a href="http://www.apache.org/foundation/thanks.html" title="Visit page outside Confluence" rel="nofollow">sponsors<sup><img class="rendericon" src="maven-obr-plugin_files/linkext7.gif" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span></li> |
| 30 | </ul> </div> |
| 31 | <div class="main"> |
| 32 | <p>This Maven plug-in aims to automate OBR (<span class="nobr"><a href="http://www2.osgi.org/Repository/HomePage" title="Visit page outside Confluence" rel="nofollow">OSGi Bundle Repository<sup><img class="rendericon" src="maven-obr-plugin_files/linkext7.gif" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span>) |
| 33 | management. It creates a local OBR repository and can create a remote |
| 34 | OBR to distribute bundles. This plug-in allows you to install your |
| 35 | bundles inside an OBR repository at the same time you install it in |
| 36 | your Maven repository. It can also deploy your bundle in a remote Maven |
| 37 | repository when you deploy your Maven artefact. The plug-in computes |
| 38 | capabilities and requirements and edits the repository description file |
| 39 | to add (or update) the bundle description.</p> |
| 40 | |
| 41 | <h2><a name="MavenObrPlugin-Features:"></a>Features:</h2> |
| 42 | |
| 43 | <p>The plug-in allows:</p> |
| 44 | <ul> |
| 45 | <li>Installing Maven artefact inside an OBR repository, |
| 46 | automatically or manually (for legacy bundles). This OBR could be |
| 47 | remote or local.</li> |
| 48 | <li>Discovering bundle capabilities and requirements</li> |
| 49 | <li>Customizing bundle descriptions</li> |
| 50 | </ul> |
| 51 | |
| 52 | |
| 53 | <h2><a name="MavenObrPlugin-Howtousetheplugin?"></a>How to use the plug-in?</h2> |
| 54 | |
| 55 | <p>The plug-in offers five Maven goals:</p> |
| 56 | <ul> |
| 57 | <li>A: The standard 'install' goal: it will install your bundle |
| 58 | in the repository at the same time it install it in your Maven |
| 59 | repository.</li> |
| 60 | <li>B: An 'install-file' goal which takes a jar file, |
| 61 | and installs it in the local Maven repository and update the |
| 62 | remote repository descriptor file.</li> |
| 63 | <li>C: A 'deploy' goal which upload a bundle on a remote repository and update the remote repository descriptor file.</li> |
| 64 | <li>D: A 'deploy-file' goal which upload jar file on a remote repository and update the remote repository descriptor file. </li> |
| 65 | <li>E : A 'clean' goal cleaning the local obr repository. </li> |
| 66 | </ul> |
| 67 | |
| 68 | |
| 69 | <h3><a name="MavenObrPlugin-A:InstallingbundlesinalocalOBRrepository"></a>A: Installing bundles in a local OBR repository</h3> |
| 70 | |
| 71 | <p>The plug-in can create a local OBR repository at the root of the |
| 72 | local Maven repository. At each time the artefact is installed in the |
| 73 | local maven repository (by using the 'mvn install' command), a local |
| 74 | OBR repository is updated to contain the description of the artefact. |
| 75 | This feature is automated inside the <span class="nobr"><a href="http://felix.apache.org/site/maven-bundle-plugin-bnd.html" title="Visit page outside Confluence" rel="nofollow">maven-bundle-plugin<sup><img class="rendericon" src="maven-obr-plugin_files/linkext7.gif" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span>.</p> |
| 76 | |
| 77 | <h3><a name="MavenObrPlugin-B:InstallinganexistingMavenartefactinalocalOBRrepository"></a>B: Installing an existing Maven artefact in a local OBR repository</h3> |
| 78 | |
| 79 | <p>This second way, to use the plug-in is to add an already existing bundle in the OBR. The bundle <b>must</b> |
| 80 | be already in the Maven local repository (you can use the Maven |
| 81 | install:install-file plug-in to install an external bundle in your |
| 82 | Maven repository).<br> |
| 83 | To use this goal, the user must provide information in command line:</p> |
| 84 | <table class="confluenceTable"><tbody> |
| 85 | <tr> |
| 86 | <td class="confluenceTd"> Variable name (prefixed by --D) </td> |
| 87 | <td class="confluenceTd"> status </td> |
| 88 | <td class="confluenceTd"> description </td> |
| 89 | </tr> |
| 90 | <tr> |
| 91 | <td class="confluenceTd"> file </td> |
| 92 | <td class="confluenceTd"> require </td> |
| 93 | <td class="confluenceTd"> Path to the jar file (used to install bundle only) </td> |
| 94 | </tr> |
| 95 | <tr> |
| 96 | <td class="confluenceTd"> artefactId </td> |
| 97 | <td class="confluenceTd"> require </td> |
| 98 | <td class="confluenceTd"> artefactId of the bundle Use to determine |
| 99 | path to the jar file in local maven Repository use as symbolic name if |
| 100 | it isn't define in manifest </td> |
| 101 | </tr> |
| 102 | <tr> |
| 103 | <td class="confluenceTd"> groupId </td> |
| 104 | <td class="confluenceTd"> require </td> |
| 105 | <td class="confluenceTd"> groupId of the bundle Use to determine path to the jar file on local maven repository </td> |
| 106 | </tr> |
| 107 | <tr> |
| 108 | <td class="confluenceTd"> version </td> |
| 109 | <td class="confluenceTd"> require </td> |
| 110 | <td class="confluenceTd"> Version of the bundle Use to determine path to the jar file on local maven repository </td> |
| 111 | </tr> |
| 112 | <tr> |
| 113 | <td class="confluenceTd"> packaging </td> |
| 114 | <td class="confluenceTd"> require </td> |
| 115 | <td class="confluenceTd"> File type Use by maven to install the file (used to install bundle only) </td> |
| 116 | </tr> |
| 117 | <tr> |
| 118 | <td class="confluenceTd"> repository-path </td> |
| 119 | <td class="confluenceTd"> optional </td> |
| 120 | <td class="confluenceTd"> Path to the repository descriptor file (if not define: default path is : MavenRepo\repository.xml </td> |
| 121 | </tr> |
| 122 | <tr> |
| 123 | <td class="confluenceTd"> obr-file </td> |
| 124 | <td class="confluenceTd"> optional </td> |
| 125 | <td class="confluenceTd"> Path to the obr.xml, file which describe |
| 126 | capabilities requirement and category given manually by user. (if not |
| 127 | define: nothing is added to the resource description). </td> |
| 128 | </tr> |
| 129 | </tbody></table> |
| 130 | |
| 131 | <h4><a name="MavenObrPlugin-Exampleofcommandline:"></a>Example of command line:</h4> |
| 132 | |
| 133 | <p>mvn homega.tools:obrPlugin:install-file \<br> |
| 134 | -Drepository-path=<span class="nobr"><a href="file:///c:repository.xml" title="Visit page outside Confluence" rel="nofollow">file:/c:\repository.xml<sup><img class="rendericon" src="maven-obr-plugin_files/linkext7.gif" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span> \<br> |
| 135 | -obr-file=<span class="nobr"><a href="file:///c:projecthomegaobr.xml" title="Visit page outside Confluence" rel="nofollow">file:/c:\project\homega\obr.xml<sup><img class="rendericon" src="maven-obr-plugin_files/linkext7.gif" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span> \<br> |
| 136 | -DartifactId=multicast.discovery \<br> |
| 137 | -DgroupId=<font color="black">homega.utils</font> <font color="black">{color}</font><br> |
| 138 | <font color="black">-Dversion=1.0.0</font></p> |
| 139 | |
| 140 | <p>By using this command, the plug-in will look at the artefact |
| 141 | MavenRepo\homega\utils\multicast.discovery\1.0.0\multicast.discovery-1.0.0.jar |
| 142 | <br clear="all"></p> |
| 143 | |
| 144 | <p>Then it will compute bundle description by using <span class="nobr"><a href="http://www2.osgi.org/Repository/BIndex" title="Visit page outside Confluence" rel="nofollow">bindex <sup><img class="rendericon" src="maven-obr-plugin_files/linkext7.gif" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span>and information from the command line (artifactId, groupId, version, and obr file (if set)).</p> |
| 145 | |
| 146 | <h4><a name="MavenObrPlugin-"></a><font color="black">Note:</font></h4> |
| 147 | |
| 148 | <p><font color="black">As said previously, the plug-in does not install |
| 149 | the file in the Maven repository but target an already install |
| 150 | artefact. However, it is possible to install the bundle in the |
| 151 | repository and to add it in the OBR repository file in one command:</font><br> |
| 152 | <font color="black"> mvn install:install-file homega.tools:obrPlugin:install-file {color}</font><br> |
| 153 | <font color="black">-Dfile=</font><font color="black"><span class="nobr"><a href="file:///c:projethomegamulticast.discovery-1.0.0.jar" title="Visit page outside Confluence" rel="nofollow">file:/c:\projet\homega\multicast.discovery-1.0.0.jar<sup><img class="rendericon" src="maven-obr-plugin_files/linkext7.gif" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span></font> <font color="black">{color}</font><br> |
| 154 | <font color="black">-Drepository-path=</font><font color="black"><span class="nobr"><a href="file:///c:repository.xml" title="Visit page outside Confluence" rel="nofollow">file:/c:\repository.xml<sup><img class="rendericon" src="maven-obr-plugin_files/linkext7.gif" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span></font> <font color="black">{color}</font><br> |
| 155 | <font color="black">-Dobr-file=</font><font color="black"><span class="nobr"><a href="file:///c:projecthomegaobr.xml" title="Visit page outside Confluence" rel="nofollow">file:/c:\project\homega\obr.xml<sup><img class="rendericon" src="maven-obr-plugin_files/linkext7.gif" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span></font> <font color="black">{color}</font><br> |
| 156 | <font color="black">-DartifactId=multicast.discovery {color}</font><br> |
| 157 | <font color="black">-DgroupId=</font><font color="black">homega.utils</font> <font color="black">{color}</font><br> |
| 158 | <font color="black">-Dversion=1.0.0 {color}</font><br> |
| 159 | <font color="black">-Dpackaging=jar</font></p> |
| 160 | |
| 161 | <h3><a name="MavenObrPlugin-"></a><font color="black">C: Deploying a bundle on a remote OBR</font></h3> |
| 162 | |
| 163 | <p><font color="black">To use the deploy goal, you must change your pom.xml:</font></p> |
| 164 | <ul> |
| 165 | <li><font color="black">Add the "</font><font color="black">deployment"</font> <font color="black">goal</font></li> |
| 166 | </ul> |
| 167 | |
| 168 | |
| 169 | <ul> |
| 170 | <li> |
| 171 | <ul> |
| 172 | <li><font color="black">Indicate the repository-name |
| 173 | property. This is the name of the repository descriptor file (this |
| 174 | property is optional; default value is "repository.xml"). This file is |
| 175 | located on url provided by user.</font><br> |
| 176 | <font color="teal"><</font><font color="#3f7f7f">plugin</font><font color="teal">></font><br> |
| 177 | <font color="teal"> <</font><font color="#3f7f7f">groupId</font><font color="teal">></font><font color="black">org.apache.felix</font><font color="teal"></</font><font color="#3f7f7f">groupId</font><font color="teal">></font><br> |
| 178 | <font color="teal"><</font><font color="#3f7f7f">artifactId</font><font color="teal">></font><font color="black">maven-obr-plugin</font><font color="teal"></</font><font color="#3f7f7f">artifactId</font><font color="teal">></font><br> |
| 179 | <font color="teal"><</font><font color="#3f7f7f">configuration</font><font color="teal">></font><br> |
| 180 | <font color="black"> </font> <font color="teal"><</font><font color="#3f7f7f">repository-name</font><font color="teal">></font><font color="black">repository.xml</font><font color="teal"></</font><font color="#3f7f7f">repository-name</font><font color="teal">></font><br> |
| 181 | <font color="teal"></</font><font color="#3f7f7f">configuration</font><font color="teal">></font><br> |
| 182 | <font color="teal"><</font><font color="#3f7f7f">executions</font><font color="teal">></font><br> |
| 183 | <font color="teal"><</font><font color="#3f7f7f">execution</font><font color="teal">></font><br> |
| 184 | <font color="teal"><</font><font color="#3f7f7f">goals</font><font color="teal">></font><br> |
| 185 | <font color="teal"><</font><font color="#3f7f7f">goal</font><font color="teal">></font><font color="black">deployment</font><font color="teal"></</font><font color="#3f7f7f">goal</font><font color="teal">></font><br> |
| 186 | <font color="teal"></</font><font color="#3f7f7f">goals</font><font color="teal">></font><br> |
| 187 | <font color="teal"></</font><font color="#3f7f7f">execution</font><font color="teal">></font><br> |
| 188 | <font color="teal"></</font><font color="#3f7f7f">executions</font><font color="teal">></font><br> |
| 189 | <font color="teal"></</font><font color="#3f7f7f">plugin</font><font color="teal">></font></li> |
| 190 | <li>You must also configure where the plugin will upload bundles and repository descriptor file. You could do it in maven as this:<br> |
| 191 | <font color="teal"><</font><font color="#3f7f7f">distributionManagement</font><font color="teal">></font><br> |
| 192 | <font color="teal"> <</font><font color="#3f7f7f">repository</font><font color="teal">></font><br> |
| 193 | <font color="teal"> <</font><font color="#3f7f7f">id</font><font color="teal">></font><font color="black">ftp-repository</font><font color="teal"></</font><font color="#3f7f7f">id</font><font color="teal">></font><br> |
| 194 | <font color="teal"><</font><font color="#3f7f7f">name</font><font color="teal">></font><font color="black">RepoName</font><font color="teal"></</font><font color="#3f7f7f">name</font><font color="teal">></font><br> |
| 195 | <font color="teal"><</font><font color="#3f7f7f">url</font><font color="teal">></font><font color="black"><span class="nobr"><a href="ftp://ftp.youraddress.com/obr" title="Visit page outside Confluence" rel="nofollow">ftp://ftp.youraddress.com/obr<sup><img class="rendericon" src="maven-obr-plugin_files/linkext7.gif" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span></font><font color="teal"></</font><font color="#3f7f7f">url</font><font color="teal">></font><br> |
| 196 | <font color="teal"></</font><font color="#3f7f7f">repository</font><font color="teal">></font><br> |
| 197 | <font color="teal"></</font><font color="#3f7f7f">distributionManagement</font><font color="teal">></font></li> |
| 198 | <li>Now maven will upload your bundle on this ftp site.</li> |
| 199 | </ul> |
| 200 | </li> |
| 201 | <li>Launch the 'mvn deploy' command</li> |
| 202 | </ul> |
| 203 | |
| 204 | |
| 205 | <p>In fact, all protocols are not supported by maven. For example ftp |
| 206 | protocol as describe above require wagon plugin to run correctly. So |
| 207 | you could add this part in your pom.xml to use wagon in ftp protocol:</p> |
| 208 | |
| 209 | <p><font color="teal"><</font><font color="#3f7f7f">build</font><font color="teal">></font><br> |
| 210 | <font color="teal"> <</font><font color="#3f7f7f">extensions</font><font color="teal">></font><br> |
| 211 | <font color="teal"><</font><font color="#3f7f7f">extension</font><font color="teal">></font><br> |
| 212 | <font color="teal"><</font><font color="#3f7f7f">groupId</font><font color="teal">></font><font color="black">org.apache.maven.wagon</font><font color="teal"></</font><font color="#3f7f7f">groupId</font><font color="teal">></font><br> |
| 213 | <font color="teal"><</font><font color="#3f7f7f">artifactId</font><font color="teal">></font><font color="black">wagon-ftp</font><font color="teal"></</font><font color="#3f7f7f">artifactId</font><font color="teal">></font><br> |
| 214 | <font color="teal"><</font><font color="#3f7f7f">version</font><font color="teal">></font><font color="black">1.0-alpha-6</font><font color="teal"></</font><font color="#3f7f7f">version</font><font color="teal">></font><br> |
| 215 | <font color="teal"></</font><font color="#3f7f7f">extension</font><font color="teal">></font><br> |
| 216 | <font color="teal"></</font><font color="#3f7f7f">extensions</font><font color="teal">></font></p> |
| 217 | |
| 218 | <p>By this way, the deploy goal supports all protocols supported by wagon.</p> |
| 219 | |
| 220 | <h3><a name="MavenObrPlugin-D:DeploynonmavenbundleonaremoteOBRrepository"></a>D: Deploy non maven bundle on a remote OBR repository</h3> |
| 221 | |
| 222 | <p>This goal is useful if you want add a non-maven project on your |
| 223 | remote repository, for example a legacy bundles.The command line is |
| 224 | compozed by :</p> |
| 225 | <table class="confluenceTable"><tbody> |
| 226 | <tr> |
| 227 | <td class="confluenceTd"> Variable name (preceded by --D) </td> |
| 228 | <td class="confluenceTd"> status </td> |
| 229 | <td class="confluenceTd"> description </td> |
| 230 | </tr> |
| 231 | <tr> |
| 232 | <td class="confluenceTd"> file </td> |
| 233 | <td class="confluenceTd"> require </td> |
| 234 | <td class="confluenceTd"> Path to the jar file </td> |
| 235 | </tr> |
| 236 | <tr> |
| 237 | <td class="confluenceTd"> artefactId </td> |
| 238 | <td class="confluenceTd"> require </td> |
| 239 | <td class="confluenceTd"> artefactId of the bundle Use to determine |
| 240 | path to the jar file in local maven Repository use as symbolic name if |
| 241 | it isn't define in manifest </td> |
| 242 | </tr> |
| 243 | <tr> |
| 244 | <td class="confluenceTd"> groupId </td> |
| 245 | <td class="confluenceTd"> require </td> |
| 246 | <td class="confluenceTd"> groupId of the bundle Use to determine path to the jar file on local maven repository </td> |
| 247 | </tr> |
| 248 | <tr> |
| 249 | <td class="confluenceTd"> version </td> |
| 250 | <td class="confluenceTd"> require </td> |
| 251 | <td class="confluenceTd"> Version of the bundle Use to determine path to the jar file on local maven repository </td> |
| 252 | </tr> |
| 253 | <tr> |
| 254 | <td class="confluenceTd"> packaging </td> |
| 255 | <td class="confluenceTd"> require </td> |
| 256 | <td class="confluenceTd"> File type Use by maven to install the file (used to install bundle only) </td> |
| 257 | </tr> |
| 258 | <tr> |
| 259 | <td class="confluenceTd"> url </td> |
| 260 | <td class="confluenceTd"> require </td> |
| 261 | <td class="confluenceTd"> url to the remote server </td> |
| 262 | </tr> |
| 263 | <tr> |
| 264 | <td class="confluenceTd"> uniqueVersion </td> |
| 265 | <td class="confluenceTd"> optional </td> |
| 266 | <td class="confluenceTd"> Set it to false to avoid unique filename when you upload </td> |
| 267 | </tr> |
| 268 | <tr> |
| 269 | <td class="confluenceTd"> repositoryId </td> |
| 270 | <td class="confluenceTd"> optional </td> |
| 271 | <td class="confluenceTd"> Name of the repository use to upload file </td> |
| 272 | </tr> |
| 273 | <tr> |
| 274 | <td class="confluenceTd"> obr-file </td> |
| 275 | <td class="confluenceTd"> optional </td> |
| 276 | <td class="confluenceTd"> Path to the obr.xml, file which describe |
| 277 | capabilities requirement and category given manually by user. (if not |
| 278 | define: nothing is added to the resource description). </td> |
| 279 | </tr> |
| 280 | </tbody></table> |
| 281 | |
| 282 | <h4><a name="MavenObrPlugin-Exampleofcompletecommandline:"></a>Example of complete command line:</h4> |
| 283 | |
| 284 | <p>mvn deploy:deploy-file homega.tools:obrPlugin:deploy-file \<br> |
| 285 | -DartifactId=echo2<br> |
| 286 | -DgroupId=tools<br> |
| 287 | -Dversion=2.0.0<br> |
| 288 | -Dpackaging=jar<br> |
| 289 | -DrepositoryId=ftp-repository<br> |
| 290 | -DuniqueVersion=false<br> |
| 291 | -Durl=<span class="nobr"><a href="ftp://ftp.plop-plop.net/obr" title="Visit page outside Confluence" rel="nofollow">ftp://ftp.plop-plop.net/obr<sup><img class="rendericon" src="maven-obr-plugin_files/linkext7.gif" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span><br> |
| 292 | -Dobr-file=c:\obr.xml<br> |
| 293 | -Dfile=echo2.jar</p> |
| 294 | |
| 295 | <p>To upload your file, you must create a small pom file declaring a |
| 296 | repositoryManagement to indicates which remote server you use and the |
| 297 | component to use for the protocol transfer. This file must contain also |
| 298 | groupId, artifactId version and packaging information (in fact those |
| 299 | data are redundant with the command line, so you could omit them in |
| 300 | command line).<br> |
| 301 | <em>Example of additional pom.xml:</em><br> |
| 302 | <font color="teal"><</font><font color="#3f7f7f">project</font><font color="teal">></font><br> |
| 303 | <font color="teal"><</font><font color="#3f7f7f">modelVersion</font><font color="teal">></font><font color="black">4.0.0</font><font color="teal"></</font><font color="#3f7f7f">modelVersion</font><font color="teal">></font><br> |
| 304 | <font color="teal"><</font><font color="#3f7f7f">packaging</font><font color="teal">></font><font color="black">jar</font><font color="teal"></</font><font color="#3f7f7f">packaging</font><font color="teal">></font><br> |
| 305 | <font color="teal"><</font><font color="#3f7f7f">groupId</font><font color="teal">></font><font color="black">tools</font><font color="teal"></</font><font color="#3f7f7f">groupId</font><font color="teal">></font><br> |
| 306 | <font color="teal"><</font><font color="#3f7f7f">artifactId</font><font color="teal">></font><font color="black">echo2</font><font color="teal"></</font><font color="#3f7f7f">artifactId</font><font color="teal">></font><br> |
| 307 | <font color="teal"><</font><font color="#3f7f7f">version</font><font color="teal">></font><font color="black">2.0.0</font><font color="teal"></</font><font color="#3f7f7f">version</font><font color="teal">></font><br> |
| 308 | <font color="teal"><</font><font color="#3f7f7f">distributionManagement</font><font color="teal">></font><br> |
| 309 | <font color="teal"><</font><font color="#3f7f7f">repository</font><font color="teal">></font><br> |
| 310 | <font color="teal"><</font><font color="#3f7f7f">id</font><font color="teal">></font><font color="black">ftp-repository</font><font color="teal"></</font><font color="#3f7f7f">id</font><font color="teal">></font><br> |
| 311 | <font color="teal"><</font><font color="#3f7f7f">name</font><font color="teal">></font><font color="black">RepoName</font><font color="teal"></</font><font color="#3f7f7f">name</font><font color="teal">></font><br> |
| 312 | <font color="teal"><</font><font color="#3f7f7f">url</font><font color="teal">></font><font color="black"><span class="nobr"><a href="ftp://ftp.plop-plop.net/obr" title="Visit page outside Confluence" rel="nofollow">ftp://ftp.plop-plop.net/obr<sup><img class="rendericon" src="maven-obr-plugin_files/linkext7.gif" alt="" align="absmiddle" border="0" height="7" width="7"></sup></a></span></font><font color="teal"></</font><font color="#3f7f7f">url</font><font color="teal">></font><br> |
| 313 | <font color="teal"></</font><font color="#3f7f7f">repository</font><font color="teal">></font><br> |
| 314 | <font color="teal"></</font><font color="#3f7f7f">distributionManagement</font><font color="teal">></font><br> |
| 315 | <font color="teal"><</font><font color="#3f7f7f">build</font><font color="teal">></font><br> |
| 316 | <font color="teal"><</font><font color="#3f7f7f">extensions</font><font color="teal">></font><br> |
| 317 | <font color="teal"><</font><font color="#3f7f7f">extension</font><font color="teal">></font><br> |
| 318 | <font color="teal"><</font><font color="#3f7f7f">groupId</font><font color="teal">></font><font color="black">org.apache.maven.wagon</font><font color="teal"></</font><font color="#3f7f7f">groupId</font><font color="teal">></font><br> |
| 319 | <font color="teal"><</font><font color="#3f7f7f">artifactId</font><font color="teal">></font><font color="black">wagon-ftp</font><font color="teal"></</font><font color="#3f7f7f">artifactId</font><font color="teal">></font><br> |
| 320 | <font color="teal"><</font><font color="#3f7f7f">version</font><font color="teal">></font><font color="black">1.0-alpha-6</font><font color="teal"></</font><font color="#3f7f7f">version</font><font color="teal">></font><br> |
| 321 | <font color="teal"></</font><font color="#3f7f7f">extension</font><font color="teal">></font><br> |
| 322 | <font color="teal"></</font><font color="#3f7f7f">extensions</font><font color="teal">></font><br> |
| 323 | <font color="teal"></</font><font color="#3f7f7f">build</font><font color="teal">></font><br> |
| 324 | <font color="teal"></</font><font color="#3f7f7f">project</font><font color="teal">></font></p> |
| 325 | |
| 326 | <h4><a name="MavenObrPlugin-Concurrentupdates&nbsp;"></a>Concurrent updates </h4> |
| 327 | |
| 328 | <p>As the obr file is remote, several uploads can occur at the same |
| 329 | time. However, the obr repository is centralized in one file, so |
| 330 | concurrent modification need to be avoided. To achieve this, the |
| 331 | plug-in implement a locking systems. At each time the plug-in try |
| 332 | to modify the file, it set a lock on it. If it can't take the lock, it |
| 333 | will wait and retry. After 3 tries, the upload process failed.</p> |
| 334 | |
| 335 | <h3><a name="MavenObrPlugin-E:Cleaningthelocalobrrepository&nbsp;"></a>E: Cleaning the local obr repository </h3> |
| 336 | |
| 337 | <p>Sometimes, you would like to clean your obr repository because it |
| 338 | contains no more existing bundles. This case often occurs when |
| 339 | artifacts were deleted manually from the maven repository. The plug-in |
| 340 | provides a simple goal to look for missing bundle and to remove them |
| 341 | from the obr repository.</p> |
| 342 | |
| 343 | <p>To launch this feature, launch the following command from a folder |
| 344 | of one of your bundle 'mvn org.apache.felix:maven-obr-plugin:clean'.</p> |
| 345 | |
| 346 | <h2><a name="MavenObrPlugin-Howtheplugincomputethedescriptionofthebundle"></a>How the plug-in compute the description of the bundle</h2> |
| 347 | |
| 348 | <p>The description of the bundle comes from three different sources:</p> |
| 349 | <ul> |
| 350 | <li>Bindex : Bindex is a tool analyzing a bundle manifest to generate OBR description</li> |
| 351 | <li>The Pom file : by analyzing the pom file, some information are collected (symbolic name ...)</li> |
| 352 | <li>The obr.xml file : this file contains customized description of the bundle</li> |
| 353 | </ul> |
| 354 | |
| 355 | |
| 356 | <p>In order to create the bundle description, the plug-in gets |
| 357 | information from bindex, the pom.xml and the obr.xml file. Information |
| 358 | can be overridden:<br> |
| 359 | Bindex<br> |
| 360 | | (overrides)<br> |
| 361 | Pom.xml<br> |
| 362 | | (overrides)<br> |
| 363 | Obr.xml</p> |
| 364 | |
| 365 | <p>A warning message is displayed each time already existing |
| 366 | information is overridden. In case of install-file goal, the |
| 367 | information given by user (i.e.: artefactId, groupId, version) is |
| 368 | considered as pom.xml properties.</p> |
| 369 | |
| 370 | <h2><a name="MavenObrPlugin-Knownissues&limitations:"></a>Known issues & limitations:</h2> |
| 371 | |
| 372 | <p>1. Do not support relative paths when you specify the repository descriptor in command line use.<br> |
| 373 | 2. obr.xml (file given by the user to describe some |
| 374 | properties not found by Bindex) must be correct, because the plug-in |
| 375 | does not check the syntax.</p> |
| 376 | </div> |
| 377 | |
| 378 | </body></html> |