felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Felix > iPOJO Maven Plug-in
Date Sun, 02 Jan 2011 10:19:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1810/9/1/_/styles/combined.css?spaceKey=FELIX&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/FELIX/iPOJO+Maven+Plug-in">iPOJO
Maven Plug-in</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~clement.escoffier">Clement
Escoffier</a>
    </h4>
        <br/>
                         <h4>Changes (4)</h4>
                                 
    
<div id="page-diffs">
            <table class="diff" cellpadding="0" cellspacing="0">
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >The maven-ipojo-plugin provides a
way to generate the skeleton of your project. To generate this structure, just launch the
following command: <br>{code} <br></td></tr>
            <tr><td class="diff-changed-lines" >mvn <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">org.apache.maven.plugins:maven-archetype-plugin:create</span>
<span class="diff-added-words"style="background-color: #dfd;">org.apache.maven.plugins:maven-archetype-plugin:generate</span>
\ <br></td></tr>
            <tr><td class="diff-unchanged" >-DarchetypeArtifactId=maven-ipojo-plugin
\ <br>-DarchetypeGroupId=org.apache.felix \ <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >{code} <br>This command generates
: <br></td></tr>
            <tr><td class="diff-changed-lines" >* a pom file (to <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">fill
out),</span> <span class="diff-added-words"style="background-color: #dfd;">update),</span>
<br></td></tr>
            <tr><td class="diff-unchanged" >* the src/main/java and src/main/resources
folders,  <br>* the structure of your package name. <br> <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">The
src/main/resources folder contains a metadata.xml file to fill out. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">The
generated project uses iPOJO annotation and is ready to be deployed. <br></td></tr>
            <tr><td class="diff-unchanged" > <br>{info:title=Maven Archetype}
<br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
        </table>
</div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <style type="text/css">
 @import url(http://felix.apache.org/ipojo/site/superfish.css); 
</style>

<style type="text/css">
 @import url(http://felix.apache.org/ipojo/site/style.css); 
</style>

<p>
<script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shCore.js"></script>
<script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushCSharp.js"></script>
<script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushPhp.js"></script>
<script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushJScript.js"></script>
<script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushVb.js"></script>
<script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushSql.js"></script>
<script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushXml.js"></script>
<script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushShell.js"></script>
<script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushDelphi.js"></script>
<script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushPython.js"></script>
<script class="javascript" src="http://cwiki.apache.org/confluence/download/resources/confluence.ext.code:code/shBrushJava.js"></script>

<script type="text/javascript" src="http://felix.apache.org/ipojo/site/jquery-1.js"></script>
<script type="text/javascript" src="http://felix.apache.org/ipojo/site/hoverIntent.js"></script>
<script type="text/javascript" src="http://felix.apache.org/ipojo/site/superfish.js"></script>

<script type="text/javascript" src="http://felix.apache.org/ipojo/site/supersubs.js"></script>


<script type="text/javascript"> 
 
    $(document).ready(function(){ 
        $("ul.sf-menu").supersubs({ 
            minWidth:    14,   // minimum width of sub-menus in em units 
            maxWidth:    30,   // maximum width of sub-menus in em units 
            extraWidth:  1     // extra width can ensure lines don't sometimes turn over 
                               // due to slight rounding differences and font-family 
        }).superfish();  // call supersubs first, then superfish, so that subs are 
                         // not display:none when measuring. Call before initialising 
                         // containing tabs for same reason. 
    }); 
 
</script>
<div class="main">
<div class="page-header"/>
<img src="http://felix.apache.org/ipojo/site/header.png" class="header">
<a href="http://ipojo.org"><img src="http://felix.apache.org/ipojo/site/ipojo.png"
width="225" class="header-logo"></a>
<ul class="sf-menu sf-js-enabled sf-shadow" id="ipojo-menu">
<li class="current">
<!-- Menu Overview -->
<a href="#" class="sf-with-ul">Overview<span class="sf-sub-indicator"> »</span><span
class="sf-sub-indicator"> »</span></a>
<ul>
	<li>
	<a href="/confluence/display/FELIX/Apache+Felix+iPOJO" title="Apache Felix iPOJO">Home</a>
						
	</li>
	<li>
	<a href="/confluence/display/FELIX/apache-felix-ipojo-why-choose-ipojo" title="apache-felix-ipojo-why-choose-ipojo">Why
choose iPOJO</a>
	</li>
	<li>
	<a href="/confluence/display/FELIX/apache-felix-ipojo-successstories" title="apache-felix-ipojo-successstories">Success
stories</a>
	</li>
	<li>
	<a href="/confluence/display/FELIX/Apache+Felix+iPOJO+Feature+Overview" title="Apache
Felix iPOJO Feature Overview">Features</a>
	</li>
</ul>
</li>	

<li class="">			
<!-- Menu download -->
<li>
<a href="/confluence/display/FELIX/Download" title="Download">Download </a>
</li>

<li class="">					
<!-- Menu Documentation -->
<a href="#" class="sf-with-ul">Documentation<span class="sf-sub-indicator"> »</span><span
class="sf-sub-indicator"> »</span></a>
<ul>
    <!-- sub-menu : getting started -->
    <li class="">
    <a href="#" class="sf-with-ul">Getting Started<span class="sf-sub-indicator">
»</span><span class="sf-sub-indicator"> »</span></a>
    <ul>
     <li><a href="/confluence/display/FELIX/iPOJO+in+10+minutes" title="iPOJO in
10 minutes">iPOJO in 10 minutes</a></li>
     <li><a href="/confluence/display/FELIX/How+to+use+iPOJO+Annotations" title="How
to use iPOJO Annotations">Using Annotations</a></li>
     <li><a href="/confluence/display/FELIX/iPOJO+Hello+Word+%28Maven-Based%29+tutorial"
title="iPOJO Hello Word (Maven-Based) tutorial">Maven tutorial</a></li>
     <li><a href="/confluence/display/FELIX/iPOJO+Advanced+Tutorial" title="iPOJO
Advanced Tutorial">Advanced tutorial</a></li>
     <li><a href="/confluence/display/FELIX/apache-felix-ipojo-dosgi" title="apache-felix-ipojo-dosgi">Using
Distributed OSGi</a></li>
     <li><a href="/confluence/display/FELIX/iPOJO+Composition+Tutorial" title="iPOJO
Composition Tutorial">Application Composition</a></li>
    </ul>
    </li> <!-- end of getting started -->
    <!-- sub menu : Describing Components -->
     <li class="">
        <a href="http://felix.apache.org/site/describing-components.html" class="sf-with-ul">Describing
components<span class="sf-sub-indicator"> »</span><span class="sf-sub-indicator">
»</span></a>
        <ul>
        <li><a href="/confluence/display/FELIX/Service+Requirement+Handler" title="Service
Requirement Handler">Requiring a service</a></li>
        <li><a href="/confluence/display/FELIX/Providing+OSGi+services" title="Providing
OSGi services">Providing a service</a></li>
        <li><a href="/confluence/display/FELIX/Lifecycle+Callback+Handler" title="Lifecycle
Callback Handler">Lifecycle management</a></li>
        <li><a href="/confluence/display/FELIX/Configuration+Handler" title="Configuration
Handler">Configuration</a></li>
        <li><a href="/confluence/display/FELIX/Architecture+Handler" title="Architecture
Handler">Introspection</a></li>
        <li><a href="/confluence/display/FELIX/Controller+Lifecycle+Handler" title="Controller
Lifecycle Handler">Impacting the lifecycle</a></li>
        <li><a href="/confluence/display/FELIX/Event+Admin+Handlers" title="Event
Admin Handlers">Asynchronous communication</a></li>
        <li><a href="/confluence/display/FELIX/iPOJO+JMX+Handler" title="iPOJO JMX
Handler">JMX management</a></li>
        <li><a href="/confluence/display/FELIX/Extender+Pattern+Handler" title="Extender
Pattern Handler">Extender pattern</a></li>
        <li><a href="/confluence/display/FELIX/White+Board+Pattern+Handler" title="White
Board Pattern Handler">Whiteboard pattern</a></li>
        <li><a href="/confluence/display/FELIX/Temporal+Service+Dependency" title="Temporal
Service Dependency">Temporal dependencies</a></li>
        </ul>
     </li> <!-- End of describing components -->
    <!-- sub-menu : User Guide -->
    <li class="">
    <a href="" class="sf-with-ul">User Guide<span class="sf-sub-indicator"> »</span><span
class="sf-sub-indicator"> »</span></a>
        <ul>
        <li><a href="/confluence/display/FELIX/Combining+iPOJO+and+Configuration+Admin"
title="Combining iPOJO and Configuration Admin">iPOJO and config admin</a></li>
        <li><a href="/confluence/display/FELIX/How-to+use+iPOJO+factories" title="How-to
use iPOJO factories">Factories and Instances</a></li>
        <li><a href="/confluence/display/FELIX/Using+XML+Schemas" title="Using XML
Schemas">XML Schemas</a></li>
        <li><a href="/confluence/display/FELIX/apache-felix-ipojo-api" title="apache-felix-ipojo-api">API</a></li>
        <li><a href="/confluence/display/FELIX/apache-felix-ipojo-testing-components"
title="apache-felix-ipojo-testing-components">Testing components</a></li>
        <li><a href="/confluence/display/FELIX/apache-felix-ipojo-eclipse-integration"
title="apache-felix-ipojo-eclipse-integration">Eclipse Integration</a></li>
        <li><a href="/confluence/display/FELIX/iPOJO+FAQ" title="iPOJO FAQ">FAQ</a></li>
        <li><a href="/confluence/display/FELIX/iPOJO-Reference-Card" title="iPOJO-Reference-Card">Reference
Card</a></li>
        </ul>
    </li> <!-- end of user guide -->
    <!-- sub-menu : Dev Guide -->
    <li> 
    <a href="#" class="sf-with-ul">Advanced Topics<span class="sf-sub-indicator">
»</span><span class="sf-sub-indicator"> »</span></a>
       <ul>
        <li><a href="http://felix.apache.org/ipojo/api/1.6.0" class="external-link"
rel="nofollow">Javadoc</a></li>
        <li><a href="/confluence/display/FELIX/How+to+write+your+own+handler" title="How
to write your own handler">Handler development</a></li>
        <li><a href="/confluence/display/FELIX/How+to+use+iPOJO+Manipulation+Metadata"
title="How to use iPOJO Manipulation Metadata">Manipulation Metadata </a></li>
        <li><a href="/confluence/display/FELIX/Dive+into+the+iPOJO+Manipulation+depths"
title="Dive into the iPOJO Manipulation depths">Dive into the iPOJO Manipulation depths</a></li>
       </ul>
    </li> <!-- End of Dev guide -->
</ul> 
</li> <!-- End of doc -->
<!-- Menu 4 : Tools -->
<li class="">
<a href="#" class="sf-with-ul">Tools<span class="sf-sub-indicator"> »</span><span
class="sf-sub-indicator"> »</span></a>
<ul>
   <li><a href="/confluence/display/FELIX/iPOJO+Ant+Task" title="iPOJO Ant Task">Ant
Task</a></li>
   <li><a href="/confluence/display/FELIX/iPOJO+Eclipse+Plug-in" title="iPOJO Eclipse
Plug-in">Eclipse Plugin</a></li>
   <li><a href="/confluence/display/FELIX/iPOJO+Maven+Plug-in" title="iPOJO Maven
Plug-in">Maven Plugin</a></li>
   <li><a href="/confluence/display/FELIX/iPOJO-Arch-Command" title="iPOJO-Arch-Command"><tt>arch</tt>
shell command</a></li>
   <li><a href="/confluence/display/FELIX/apache-felix-ipojo-online-manipulator"
title="apache-felix-ipojo-online-manipulator">Online Manipulator</a></li>
   <li><a href="/confluence/display/FELIX/iPOJO+Webconsole+Plugin" title="iPOJO Webconsole
Plugin">Webconsole plugin</a></li>
   <li><a href="/confluence/display/FELIX/apache-felix-ipojo-junit4osgi" title="apache-felix-ipojo-junit4osgi">Junit4OSGi</a></li>
</ul>   
</li><!-- End of tools -->	
<!-- Menu 5 : Support -->
<li>
<a href="/confluence/display/FELIX/ipojo-support" title="ipojo-support">Support </a>
</li>
<!-- End of the menu 5 -->			
<!-- Menu 6 : Misc -->
<li class="">
<a href="#" class="sf-with-ul">Misc<span class="sf-sub-indicator"> »</span><span
class="sf-sub-indicator"> »</span></a>
<ul>
   <li><a href="/confluence/display/FELIX/apache-felix-ipojo-supportedVMs" title="apache-felix-ipojo-supportedVMs">Supported
JVMs</a></li>
   <li><a href="/confluence/display/FELIX/apache-felix-ipojo-supportedOSGi" title="apache-felix-ipojo-supportedOSGi">Supported
OSGi Implementations</a></li>
   <li><a href="http://ipojo-dark-side.blogspot.com" class="external-link" rel="nofollow">iPOJO's
Dark Side Blog</a></li>
   <li><a href="/confluence/pages/viewpage.action?pageId=54954" title="Article &amp;
Presentations">Article &amp; Presentations</a></li>
   <li><a href="http://www.apache.org/">ASF</a></li>
   <li><a href="http://www.apache.org/foundation/sponsorship.html">Sponsorship</a></li>
   <li><a href="http://www.apache.org/foundation/thanks.html">Sponsors</a></li>
</ul>
</li><!-- End of misc -->
</ul> <!-- End of the menu -->
</div> <!-- Page header -->
</p>

<div class="content">

<h1><a name="iPOJOMavenPlug-in-HowtousetheiPOJOMavenPlugin"></a>How to use
the iPOJO Maven Plug-in</h1>

<div class="toc"><div>
<ul>
    <li><a href='#iPOJOMavenPlug-in-Basicconfiguration'>Basic configuration</a></li>
    <li><a href='#iPOJOMavenPlug-in-Execution'>Execution</a></li>
    <li><a href='#iPOJOMavenPlug-in-ConfigurationOptions'>Configuration Options</a></li>
    <li><a href='#iPOJOMavenPlug-in-GeneratetheskeletonofyouriPOJObundle'>Generate
the skeleton of your iPOJO bundle</a></li>
    <li><a href='#iPOJOMavenPlug-in-DescribingiPOJOconfigurationinthepomfile'>Describing
iPOJO configuration in the pom file</a></li>
</ul></div></div>

<h2><a name="iPOJOMavenPlug-in-Basicconfiguration"></a>Basic configuration</h2>

<p>To use the iPOJO Maven plug-in, edit the following pom.xml (replace all $XXX elements):</p>
<div class="pom"><p>&lt;project&gt;<br/>
&nbsp;&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;</p>

<p>&nbsp;&lt;packaging&gt;bundle&lt;/packaging&gt; &lt;!-- Use
the BND Maven plug-in --&gt;<br/>
<font color="red">&nbsp;</font> <font color="red">&lt;groupId&gt;$YOUR_GROUP_ID&lt;/groupId&gt;</font><br/>
<font color="red">&nbsp;</font> <font color="red">&lt;artifactId&gt;$YOUR_ARTIFACT_ID&lt;/artifactId&gt;</font><br/>
<font color="red">&nbsp;</font> <font color="red">&lt;version&gt;$YOUR_ARTIFACT_VERSION&lt;/version&gt;</font><br/>
<font color="red">&nbsp;</font> <font color="red">&lt;name&gt;$YOUR_PROJECT_NAME&lt;/name&gt;</font></p>

<p><font color="red">&nbsp;</font> <font color="red">&lt;dependencies&gt;</font><br/>
<font color="red">&nbsp;&nbsp;&nbsp;</font> <font color="red">$YOUR_MAVEN_DEPENDENCIES</font><br/>
<font color="red">&nbsp;</font> <font color="red">&lt;/dependencies&gt;</font></p>

<p>&nbsp;&lt;build&gt;<br/>
&nbsp;&nbsp;&nbsp;&lt;plugins&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;!-- BND Maven Plugin Configuration
--&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;plugin&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;groupId&gt;org.apache.felix&lt;/groupId&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;artifactId&gt;maven-bundle-plugin&lt;/artifactId&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;extensions&gt;true&lt;/extensions&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;configuration&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;instructions&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;Bundle-SymbolicName&gt;${pom.artifactId}&lt;/Bundle-SymbolicName&gt;<br/>
<font color="red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="red">&lt;Private-Package&gt;$YOUR_PRIVATE_PACKAGE&lt;/Private-Package&gt;</font><br/>
<font color="red">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font
color="red">&lt;Export-Package&gt;$YOUR_EXPORTED_PACKAGE&lt;/Export-Package&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/instructions&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/configuration&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/plugin&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;!-- iPOJO Maven Plugin Configuration
: nothing to do --&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;plugin&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;groupId&gt;org.apache.felix&lt;/groupId&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;artifactId&gt;maven-ipojo-plugin&lt;/artifactId&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;version&gt;1.6.0&lt;/version&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;executions&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;execution&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;goals&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;goal&gt;ipojo-bundle&lt;/goal&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/goals&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/execution&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/executions&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/plugin&gt;<br/>
&nbsp;&nbsp;&nbsp;&lt;/plugins&gt;<br/>
&nbsp;&lt;/build&gt;<br/>
&lt;/project&gt;</p></div>
<p>The iPOJO Maven Plug-in is generally used with the BND Maven Plug-in (more details
here). However the two configurations are completely separated. So, you can use all BND Maven
plug-in features. The iPOJO configuration section can be used as previously written without
any changes. However it requires that your metadata file is either inside <tt>src/main/ipojo</tt>
or inside the <tt>src/main/resources</tt> folder and named "metadata.xml".</p>

<h2><a name="iPOJOMavenPlug-in-Execution"></a>Execution</h2>

<p>To manipulate your project, use the "<em>mvn clean install</em>" command.
The output should be like:</p>
<div class="pom"><p>[INFO] Scanning for projects...<br/>
[INFO] &#45;--------------------------------------------------------------------------&#45;<br/>
[INFO] Building Hello Client<br/>
[INFO]&nbsp;&nbsp;&nbsp;task-segment: [clean, install]<br/>
[INFO] &#45;--------------------------------------------------------------------------&#45;<br/>
[INFO] [clean:clean]<br/>
[INFO] Deleting directory D:\clement\workspaces\iPOJO-Dev\hello.client\target<br/>
[INFO] Deleting directory D:\clement\workspaces\iPOJO-Dev\hello.client\target\classes<br/>
[INFO] Deleting directory D:\clement\workspaces\iPOJO-Dev\hello.client\target\test-classes<br/>
[INFO] Deleting directory D:\clement\workspaces\iPOJO-Dev\hello.client\target\site<br/>
[INFO] [resources:resources]<br/>
[INFO] Using default encoding to copy filtered resources.<br/>
[INFO] Copying 1 resource<br/>
[INFO] [compiler:compile]<br/>
[INFO] Compiling 1 source file to D:\clement\workspaces\iPOJO-Dev\hello.client\target\classes<br/>
[INFO] [resources:testResources]<br/>
[INFO] Using default encoding to copy filtered resources.<br/>
[INFO] Resource directory does not exist: D:\clement\workspaces\iPOJO-Dev\hello.client\src\test\resources<br/>
[INFO] [compiler:testCompile]<br/>
[INFO] No sources to compile<br/>
[INFO] [surefire:test]<br/>
[INFO] No tests to run.<br/>
[INFO] [bundle:bundle]<br/>
[INFO] [org.apache.felix.ipojo.:ipojo-bundle {execution: default}]<br/>
[INFO] Start bundle manipulation<br/>
[INFO] Metadata File : D:\clement\workspaces\iPOJO-Dev\hello.client\target\classes\metadata.xml<br/>
[INFO] Input Bundle File : D:\clement\workspaces\iPOJO-Dev\hello.client\target\hello.client-0.0.1.jar<br/>
[INFO] Bundle manipulation - SUCCESS<br/>
[INFO] [install:install]<br/>
[INFO] Installing D:\clement\workspaces\iPOJO-Dev\hello.client\target\hello.client-0.0.1.jar
to D:\Dev\maven-repo\ipojo\example\hello.client\0.0.1\hello.client-0.0.1.jar<br/>
[INFO] &#45;----------------------------------------------------------------------&#45;<br/>
[INFO] BUILD SUCCESSFUL<br/>
[INFO] &#45;----------------------------------------------------------------------&#45;<br/>
[INFO] Total time: 9 seconds<br/>
[INFO] Finished at: Mon Aug 13 14:04:55 CEST 2007<br/>
[INFO] Final Memory: 6M/13M<br/>
[INFO] &#45;----------------------------------------------------------------------&#45;</p></div>
<h2><a name="iPOJOMavenPlug-in-ConfigurationOptions"></a>Configuration Options</h2>

<p>You can configure the localization of the iPOJO metadata file as following:</p>
<div class="pom"><p>&lt;plugin&gt;<br/>
&nbsp;&nbsp;&nbsp; &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;<br/>
&nbsp;&nbsp;&nbsp; &lt;artifactId&gt;maven-ipojo-plugin&lt;/artifactId&gt;<br/>
&nbsp;&nbsp;&nbsp; &lt;version&gt;1.6.0&lt;/version&gt;<br/>
&nbsp;&nbsp;&nbsp; &lt;executions&gt;<br/>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;execution&gt;<br/>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;goals&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;goal&gt;ipojo-bundle&lt;/goal&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/goals&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;configuration&gt;<br/>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font
color="red">&lt;metadata&gt;ipojo/meta.xml&lt;/metadata&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/configuration&gt;<br/>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&lt;/execution&gt;<br/>
&nbsp;&nbsp;&nbsp;&lt;/executions&gt;<br/>
&lt;/plugin&gt;</p></div>
<p>In the metadata element, you can specify your metadata file or directory. The given
file path is relative to the root directory ("./ipojo/meta.xml"). If the specified location
is a directory, all contained XML files will be used. By default, the plugin searches metadata
files into the <tt>src/main/ipojo</tt> folder. If not found then it searches for
<tt>target/classes/metadata.xml</tt> and <tt>./metadata.xml</tt>.</p>

<p><b>Note:</b> The directory support was introduced in the <tt>1.7.0</tt>
version. Previously only one metadata file was found.<br/>
<b>Compatibility:</b> Before the <tt>1.7.0</tt>, the set location
was searched in all resource folders. This is no more supported because it's an anti-pattern.</p>

<p>The second option allows skipping annotations processing, by using the <tt>ignoreAnnotations</tt>
element:</p>
<div class="pom"><p>&lt;plugin&gt;<br/>
&nbsp;&nbsp;&nbsp; &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;<br/>
&nbsp;&nbsp;&nbsp; &lt;artifactId&gt;maven-ipojo-plugin&lt;/artifactId&gt;<br/>
&nbsp;&nbsp;&nbsp; &lt;version&gt;1.6.0&lt;/version&gt;<br/>
&nbsp;&nbsp;&nbsp; &lt;executions&gt;<br/>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;execution&gt;<br/>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;goals&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;goal&gt;ipojo-bundle&lt;/goal&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/goals&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;configuration&gt;<br/>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;<font
color="red">&lt;ignoreAnnotations&gt;true&lt;/ignoreAnnotations&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/configuration&gt;<br/>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&lt;/execution&gt;<br/>
&nbsp;&nbsp;&nbsp;&lt;/executions&gt;<br/>
&lt;/plugin&gt;</p></div>

<p>You can also ignore embedded XML-Schemas to use external ones. To do so, add the
<tt>ignoreEmbeddedSchemas</tt>. If set to <tt>true</tt>, the manipulator
doesn't use embedded XML-Schemas:</p>
<div class="pom"><p>&lt;plugin&gt;<br/>
&nbsp;&nbsp;&nbsp; &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;<br/>
&nbsp;&nbsp;&nbsp; &lt;artifactId&gt;maven-ipojo-plugin&lt;/artifactId&gt;<br/>
&nbsp;&nbsp;&nbsp; &lt;version&gt;1.6.0&lt;/version&gt;<br/>
&nbsp;&nbsp;&nbsp; &lt;executions&gt;<br/>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;execution&gt;<br/>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;goals&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&lt;goal&gt;ipojo-bundle&lt;/goal&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/goals&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;configuration&gt;<br/>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;<font
color="red">&lt;ignoreEmbeddedSchemas&gt;true&lt;/ignoreEmbeddedSchemas&gt;</font><br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/configuration&gt;<br/>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&lt;/execution&gt;<br/>
&nbsp;&nbsp;&nbsp;&lt;/executions&gt;<br/>
&lt;/plugin&gt;</p></div>


<h2><a name="iPOJOMavenPlug-in-GeneratetheskeletonofyouriPOJObundle"></a>Generate
the skeleton of your iPOJO bundle</h2>
<p>The maven-ipojo-plugin provides a way to generate the skeleton of your project. To
generate this structure, just launch the following command:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
mvn org.apache.maven.plugins:maven-archetype-plugin:generate \
-DarchetypeArtifactId=maven-ipojo-plugin \
-DarchetypeGroupId=org.apache.felix \
-DartifactId=ARTIFACT_NAME_OF_YOUR_PROJECT \
-DgroupId=GROUP_ID_OF_YOUR_PROJECT \
-DarchetypeVersion=VERSION_OF_YOUR_PROJECT \
-DpackageName=PACKAGE_NAME
</pre>
</div></div>
<p>This command generates :</p>
<ul>
	<li>a pom file (to update),</li>
	<li>the src/main/java and src/main/resources folders,</li>
	<li>the structure of your package name.</li>
</ul>


<p>The generated project uses iPOJO annotation and is ready to be deployed.</p>

<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td
valign='top'><img src="/confluence/images/icons/emoticons/information.gif" width="16"
height="16" align="absmiddle" alt="" border="0"></td><td><b>Maven Archetype</b><br
/>The maven-ipojo-plugin archetype generates a pom file using the latest released version
of the maven-ipojo-plugin.</td></tr></table></div>

<h2><a name="iPOJOMavenPlug-in-DescribingiPOJOconfigurationinthepomfile"></a>Describing
iPOJO configuration in the pom file</h2>
<p>It is also possible to describe iPOJO components and instances inside the pom file
(avoiding using a externalized file). The configuration can be described in the <tt>metadata</tt>
attribute inside a CDATA block.</p>
<div class="pom"><p>&lt;plugin&gt;<br/>
&nbsp;&nbsp;	&lt;groupId&gt;org.apache.felix&lt;/groupId&gt;<br/>
&nbsp;&nbsp;	&lt;artifactId&gt;maven-ipojo-plugin&lt;/artifactId&gt;<br/>
&nbsp;&nbsp;	&lt;version&gt;1.6.0&lt;/version&gt;<br/>
&nbsp;&nbsp;	&lt;executions&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;	&lt;execution&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;		&lt;goals&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;			&lt;goal&gt;ipojo-bundle&lt;/goal&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;		&lt;/goals&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;		&lt;configuration&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;			&lt;ignoreAnnotations&gt;true&lt;/ignoreAnnotations&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;			&lt;metadata&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;				&lt;![CDATA[<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;				&lt;ipojo<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;				 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;				 xsi:schemaLocation="org.apache.felix.ipojo
<a href="http://felix.apache.org/ipojo/schemas/CURRENT/core.xsd" class="external-link"
rel="nofollow">http://felix.apache.org/ipojo/schemas/CURRENT/core.xsd</a>"<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;				 xmlns="org.apache.felix.ipojo"&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;				 &lt;component<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;					classname="org.apache.felix.ipojo.test.scenarios.component.LifecycleControllerTest"<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;					name="LFC-Test"&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;					&lt;provides
/&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;					&lt;controller
field="m_state" /&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;					&lt;properties&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;						&lt;property
name="conf" field="m_conf" method="setConf" /&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;					&lt;/properties&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;				 &lt;/component&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;				 &lt;component<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;					classname="org.apache.felix.ipojo.test.scenarios.component.LifecycleControllerTest"<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;					name="LFC-Test-Immediate"
immediate="true" architecture="true"&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;					&lt;provides
/&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;					&lt;controller
field="m_state" /&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;					&lt;properties&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;						&lt;property
name="conf" field="m_conf" method="setConf" /&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;					&lt;/properties&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;				 &lt;/component&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;				&lt;/ipojo&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;			   ]]&gt;<br/>
&nbsp;&nbsp;&nbsp;			&lt;/metadata&gt;<br/>
&nbsp;&nbsp;&nbsp;		&lt;/configuration&gt;<br/>
&nbsp;&nbsp;&nbsp;	&lt;/execution&gt;<br/>
&nbsp;&nbsp;	&lt;/executions&gt;<br/>
&lt;/plugin&gt;</p></div>
<p><br class="atl-forced-newline" />
<br class="atl-forced-newline" /></p>

 </div>
        <img src="http://felix.apache.org/ipojo/site/footer.png" class="footer">
</div>

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try{
var pageTracker = _gat._getTracker("UA-1518442-4");
pageTracker._trackPageview();
} catch(err) {}
</script>

    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/FELIX/iPOJO+Maven+Plug-in">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=63748&revisedVersion=35&originalVersion=34">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/FELIX/iPOJO+Maven+Plug-in?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message