geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Geronimo Development > OSGI conversion tips
Date Fri, 23 Oct 2009 09:04:00 GMT
<html>
<head>
    <base href="http://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=GMOxDEV&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/GMOxDEV/OSGI+conversion+tips">OSGI
conversion tips</a></h2>
    <h4>Page  <b>added</b> by             <a href="http://cwiki.apache.org/confluence/display/~djencks">David
Jencks</a>
    </h4>
         <br/>
    <div class="notificationGreySide">
         <h2><a name="OSGIconversiontips-Letscollecttipsonosgiconversionhere"></a>Lets
collect tips on osgi conversion here</h2>

<h3><a name="OSGIconversiontips-jarswithxmlbeanscompilation"></a>jars with
xmlbeans compilation</h3>
<p>To use xmlbeans generated code you need access to the SchemaTypeSystemImpl, which
is not imported by the maven-bundle-plugin.  So you need to add something like this to the
pom:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
            &lt;plugin&gt;
                &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;
                &lt;artifactId&gt;maven-bundle-plugin&lt;/artifactId&gt;
                &lt;configuration&gt;
                    &lt;instructions&gt;
                        &lt;!--packages containing <span class="code-quote">"impl"</span>
or <span class="code-quote">"internal"</span> are excluded by <span class="code-keyword">default</span>
--&gt;
                        &lt;Import-Package&gt;org.apache.xmlbeans.impl.schema;version=<span
class="code-quote">"2.4"</span>,*&lt;/Import-Package&gt;
                        &lt;!--&lt;_versionpolicy&gt;[$(version;==;$(@)),$(version;+;$(@)))&lt;/_versionpolicy&gt;--&gt;
                    &lt;/instructions&gt;
                &lt;/configuration&gt;
            &lt;/plugin&gt;
</pre>
</div></div>

<p>Also, any package we may have with "impl" or "internal" needs to be explicitly listed
in the Export-Packages.</p>

<h3><a name="OSGIconversiontips-Nonbundleinterference"></a>Non-bundle interference</h3>
<p>Many problems with building plugins are caused by non-bundle dependencies getting
installed in felix rather than bundleized equivalents.  Unfortuneately it looks like felix
only says "non-framework bundles cannot be started" without telling us the location of the
non-bundle.  Running</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
mvn dependency:tree
</pre>
</div></div>
<p>helps to find the bad dependencies.  On a related note, generally you have to exclude
original jars from the dependencyManagement dependency entry of a bundleized repackaging.
 This seems like a serious defect in maven-bundle-plugin.</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/GMOxDEV/OSGI+conversion+tips">View
Online</a>
              |
       <a href="http://cwiki.apache.org/confluence/display/GMOxDEV/OSGI+conversion+tips?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
           </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message