incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Sling Website > Maven Launchpad Plugin
Date Thu, 18 Feb 2010 04:19:00 GMT
<html>
<head>
    <base href="http://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=SLINGxSITE&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background-color: white" bgcolor="white">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
     <h2><a href="http://cwiki.apache.org/confluence/display/SLINGxSITE/Maven+Launchpad+Plugin">Maven
Launchpad Plugin</a></h2>
     <h4>Page <b>edited</b> by             <a href="http://cwiki.apache.org/confluence/display/~justinedelson">Justin
Edelson</a>
    </h4>
     fixing default bundle list artifact id
          <div id="versionComment" class="noteMacro" style="display:none; padding: 5px;">
     fixing default bundle list artifact id<br />
     </div>
          <br/>
     <div class="notificationGreySide">
         <h1><a name="MavenLaunchpadPlugin-MavenLaunchpadPlugin"></a>Maven
Launchpad Plugin</h1>

<p>The Maven Launchpad Plugin provides goals which facilitate the creation of OSGi applications.
It supports the following runtime scenarios:</p>
<ul>
	<li>A WAR file suitable for running in a JavaEE servlet container.</li>
	<li>A standalone Java application.</li>
	<li>Inside Apache Karaf</li>
</ul>


<p>In addition, the Maven Launchpad Plugin supports the publishing of an application
descriptor, in the form of a <b>bundle list</b>, as a Maven artifact. This descriptor
can then be used by downstream application builders as the basis for other applications. In
Sling, this is embodied by two Maven projects:</p>
<ul>
	<li><a href="http://svn.apache.org/repos/asf/sling/trunk/launchpad/builder" rel="nofollow">org.apache.sling.launchpad</a>
- produces an application descriptor.</li>
	<li><a href="http://svn.apache.org/repos/asf/sling/trunk/launchpad/builder/testing"
rel="nofollow">org.apache.sling.launchpad.testing</a> - uses the application descriptor
from <tt>org.apache.sling.launchpad</tt> and adds two bundles.</li>
</ul>


<p>Maven Launchpad Plugin provides the following goals: </p>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Goals </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> launchpad:prepare-package </td>
<td class='confluenceTd'> Create the file system structure required by Sling's Launchpad
framework. </td>
</tr>
<tr>
<td class='confluenceTd'> launchpad:attach-bundle-list </td>
<td class='confluenceTd'> Attach the bundle list descriptor to the current project as
a Maven artifact. </td>
</tr>
<tr>
<td class='confluenceTd'> launchpad:create-karaf-descriptor </td>
<td class='confluenceTd'> Create an Apache Karaf Feature descriptor. </td>
</tr>
<tr>
<td class='confluenceTd'> launchpad:create-bundle-jar </td>
<td class='confluenceTd'> Create a JAR file containing the bundles in a Launchpad-structured
JAR file. </td>
</tr>
<tr>
<td class='confluenceTd'> launchpad:check-bundle-list-for-snapshots </td>
<td class='confluenceTd'> Validate that the bundle list does not contain any SNAPSHOT
versions. </td>
</tr>
</tbody></table>

<h3><a name="MavenLaunchpadPlugin-GeneralConfiguration"></a>General Configuration</h3>

<p>In general, the bulk of the configuration of the Maven Launchpad Plugin is concerned
with setting up the bundle list which all of the goals will use. This bundle list is created
using the following steps:</p>
<ol>
	<li>If <tt>includeDefaultBundles</tt> is <tt>true</tt> (the
default), the default bundle list is loaded. By default, this is <tt>org.apache.sling.launchpad:org.apache.sling.launchpad:RELEASE:xml:bundlelist</tt>,
but can be overridden by setting the <tt>defaultBundleList</tt> plugin parameter.</li>
	<li>If <tt>includeDefaultBundles</tt> is <tt>false</tt>, an
empty list is created.</li>
	<li>If the bundle list file exists (by default, at <tt>src/main/bundles/list.xml</tt>),
the bundles defined in it are added to the bundle list.</li>
	<li>If the <tt>additionalBundles</tt> plugin parameter is defined, those
bundles are added to the bundle list.</li>
	<li>If the <tt>bundleExclusions</tt> plugin parameter is defined, those
bundles are removed from the bundle list.</li>
</ol>


<p>When a bundle is added to the bundle list, if a bundle with the same groupId, artifactId,
type, and classifier is already in the bundle list, the version of the existing bundle is
modified. However, the start level of a bundle is never changed once that bundle is added
to the bundle list.</p>

<p>The plugin may also contribute bundles to (or remove bundles from) the bundle list
as it sees fit.</p>

<h2><a name="MavenLaunchpadPlugin-BundleListFiles"></a>Bundle List Files</h2>

<p>The bundle list file uses a simple XML syntax representing a list of bundles organized
into start levels:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;?xml version=<span class="code-quote">"1.0"</span>?&gt;</span>
<span class="code-tag">&lt;bundles&gt;</span>
    <span class="code-tag">&lt;startLevel level=<span class="code-quote">"0"</span>&gt;</span>
        <span class="code-tag">&lt;bundle&gt;</span>
            <span class="code-tag">&lt;groupId&gt;</span>commons-io<span
class="code-tag">&lt;/groupId&gt;</span>
            <span class="code-tag">&lt;artifactId&gt;</span>commons-io<span
class="code-tag">&lt;/artifactId&gt;</span>
            <span class="code-tag">&lt;version&gt;</span>1.4<span class="code-tag">&lt;/version&gt;</span>
        <span class="code-tag">&lt;/bundle&gt;</span>
        <span class="code-tag">&lt;bundle&gt;</span>
            <span class="code-tag">&lt;groupId&gt;</span>commons-collections<span
class="code-tag">&lt;/groupId&gt;</span>
            <span class="code-tag">&lt;artifactId&gt;</span>commons-collections<span
class="code-tag">&lt;/artifactId&gt;</span>
            <span class="code-tag">&lt;version&gt;</span>3.2.1<span
class="code-tag">&lt;/version&gt;</span>
        <span class="code-tag">&lt;/bundle&gt;</span>
    <span class="code-tag">&lt;/startLevel&gt;</span>

    <span class="code-tag">&lt;startLevel level=<span class="code-quote">"10"</span>&gt;</span>
        <span class="code-tag">&lt;bundle&gt;</span>
            <span class="code-tag">&lt;groupId&gt;</span>org.apache.felix<span
class="code-tag">&lt;/groupId&gt;</span>
            <span class="code-tag">&lt;artifactId&gt;</span>org.apache.felix.eventadmin<span
class="code-tag">&lt;/artifactId&gt;</span>
            <span class="code-tag">&lt;version&gt;</span>1.0.0<span
class="code-tag">&lt;/version&gt;</span>
        <span class="code-tag">&lt;/bundle&gt;</span>
    <span class="code-tag">&lt;/startLevel&gt;</span>

    <span class="code-tag">&lt;startLevel level=<span class="code-quote">"15"</span>&gt;</span>
        <span class="code-tag">&lt;bundle&gt;</span>
            <span class="code-tag">&lt;groupId&gt;</span>org.apache.sling<span
class="code-tag">&lt;/groupId&gt;</span>
            <span class="code-tag">&lt;artifactId&gt;</span>org.apache.sling.jcr.api<span
class="code-tag">&lt;/artifactId&gt;</span>
            <span class="code-tag">&lt;version&gt;</span>2.0.2-incubator<span
class="code-tag">&lt;/version&gt;</span>
        <span class="code-tag">&lt;/bundle&gt;</span>
    <span class="code-tag">&lt;/startLevel&gt;</span>
<span class="code-tag">&lt;/bundles&gt;</span>
</pre>
</div></div>

<p>Within each <tt>bundle</tt> element, <tt>type</tt> and <tt>classifier</tt>
are also supported.</p>

<h2><a name="MavenLaunchpadPlugin-ArtifactDefinition"></a>Artifact Definition</h2>

<p>The <tt>defaultBundleList</tt>, <tt>jarWebSupport</tt>, <tt>additionalBundles</tt>,
and <tt>bundleExclusions</tt> parameters are configured with artifact definitions.
This is done using a syntax similar to Maven dependency elements:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;configuration&gt;</span>
...
  <span class="code-tag">&lt;jarWebSupport&gt;</span>
    <span class="code-tag">&lt;groupId&gt;</span>GROUP_ID<span class="code-tag">&lt;/groupId&gt;</span>
    <span class="code-tag">&lt;artifactId&gt;</span>ARTIFACT_ID<span
class="code-tag">&lt;/artifactId&gt;</span>
    <span class="code-tag">&lt;version&gt;</span>VERSION<span class="code-tag">&lt;/version&gt;</span>
    <span class="code-tag"><span class="code-comment">&lt;!-- type and classifier
can also be specified if needed --&gt;</span></span>
  <span class="code-tag">&lt;/jarWebSupport&gt;</span>
...
<span class="code-tag">&lt;/configuration&gt;</span>
</pre>
</div></div>

<p>In the case of <tt>additionalBundles</tt> and <tt>bundleExclusions</tt>,
these are arrays of definitions, so an intermediate <tt>bundle</tt> element is
necessary:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
<span class="code-tag">&lt;configuration&gt;</span>
...
  <span class="code-tag">&lt;additionalBundles&gt;</span>
    <span class="code-tag">&lt;bundle&gt;</span>
      <span class="code-tag">&lt;groupId&gt;</span>GROUP_ID<span class="code-tag">&lt;/groupId&gt;</span>
      <span class="code-tag">&lt;artifactId&gt;</span>ARTIFACT_ID<span
class="code-tag">&lt;/artifactId&gt;</span>
      <span class="code-tag">&lt;version&gt;</span>VERSION<span class="code-tag">&lt;/version&gt;</span>
      <span class="code-tag"><span class="code-comment">&lt;!-- type and classifier
can also be specified if needed --&gt;</span></span>
    <span class="code-tag">&lt;/bundle&gt;</span>
  <span class="code-tag">&lt;/additionalBundles&gt;</span>
...
<span class="code-tag">&lt;/configuration&gt;</span>
</pre>
</div></div>

<p>By default, bundles are added to start level 0. To change, this use the <tt>startLevel</tt>
element within each additional bundle definition.</p>

     </div>
     <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
       </div>

       <a href="http://cwiki.apache.org/confluence/display/SLINGxSITE/Maven+Launchpad+Plugin">View
Online</a>
       |
       <a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=13271080&revisedVersion=2&originalVersion=1">View
Change</a>
              |
       <a href="http://cwiki.apache.org/confluence/display/SLINGxSITE/Maven+Launchpad+Plugin?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message