| |
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <HTML> |
| |
| <!-- Mirrored Site: felix.apache.org. File: /site/ipojo-maven-plug-in.html. Date: Mon, 13 Oct 2008 06:52:45 GMT --> |
| <HEAD> |
| <TITLE>Apache Felix - iPOJO Maven Plug-in</TITLE> |
| <LINK rel="stylesheet" href="media.data/site.css" type="text/css" media="all"> |
| <META http-equiv="Content-Type" content="text/html;charset=UTF-8"> |
| </HEAD> |
| <BODY> |
| <DIV class="title"><DIV class="logo"><A href="index.html"><IMG border="0" alt="Apache Felix" src="media.data/logo.png"></A></DIV><DIV class="header"><A href="http://www.apache.org/"><IMG border="0" alt="Apache" src="media.data/apache.png"></A></DIV></DIV> |
| <DIV class="menu"> |
| <UL> |
| <LI><A href="news.html" title="news">news</A></LI> |
| <LI><A href="license.html" title="license">license</A></LI> |
| <LI><SPAN class="nobr"><A href="downloads.html" title="Visit page outside Confluence" rel="nofollow">downloads<SUP><IMG class="rendericon" src="../../cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI> |
| <LI><A href="documentation.html" title="documentation">documentation</A></LI> |
| <LI><A href="mailinglists.html" title="mailinglists">mailing lists</A></LI> |
| <LI><A href="contributing.html" title="Contributing">contributing</A></LI> |
| <LI><SPAN class="nobr"><A href="http://www.apache.org/" title="Visit page outside Confluence" rel="nofollow">asf<SUP><IMG class="rendericon" src="../../cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI> |
| <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="../../cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI> |
| <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="../../cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN> |
| <!-- ApacheCon Ad --> |
| <IFRAME src="http://www.apache.org/ads/button.html" style="border-width:0; float: left" frameborder="0" scrolling="no" width="135" height="135"></IFRAME> |
| <P style="height: 100px"> |
| <!-- ApacheCon Ad --></LI> |
| </UL> |
| </DIV> |
| <DIV class="main"> |
| <TABLE class="sectionMacro" border="0" cellpadding="5" cellspacing="0" width="100%"><TBODY><TR> |
| <TD class="confluenceTd" valign="top" width="80%"> |
| <H1><A name="iPOJOMavenPlug-in-HowtousetheiPOJOMavenPlugin"></A>How to use the iPOJO Maven Plug-in</H1> |
| |
| <P>To use the iPOJO Maven plug-in, edit the following pom.xml (replace all $xxx elements):</P> |
| <DIV class="panel"><DIV class="panelContent"> |
| <P><project><BR> |
| <modelVersion>4.0.0</modelVersion><BR> |
| <packaging>bundle</packaging> <!-- Use the BND Maven plug-in --><BR> |
| <FONT color="red"> </FONT> <FONT color="red"><groupId>$YOUR_GROUP_ID</groupId></FONT><BR> |
| <FONT color="red"> </FONT><FONT color="red"><artifactId>$YOUR_ARTIFACT_ID</artifactId></FONT><BR> |
| <FONT color="red"> </FONT> <FONT color="red"><version>$YOUR_ARTIFACT_VERSION</version></FONT><BR> |
| <FONT color="red"> </FONT> <FONT color="red"><name>$YOUR_PROJECT_NAME</name></FONT></P> |
| |
| <P><FONT color="red"> </FONT> <FONT color="red"><dependencies></FONT><BR> |
| <FONT color="red"> </FONT> <FONT color="red">$YOUR_MAVEN_DEPENDENCIES</FONT><BR> |
| <FONT color="red"> </FONT> <FONT color="red"></dependencies></FONT></P> |
| |
| <P> <build><BR> |
| <plugins><BR> |
| <!-- BND Maven Plugin Configuration --><BR> |
| <plugin><BR> |
| <groupId>org.apache.felix</groupId><BR> |
| <artifactId>maven-bundle-plugin</artifactId><BR> |
| <extensions>true</extensions><BR> |
| <configuration><BR> |
| <instructions><BR> |
| <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName><BR> |
| <FONT color="red"> </FONT><FONT color="red"><Private-Package>$YOUR_PRIVATE_PACKAGE</Private-Package></FONT><BR> |
| <FONT color="red"> </FONT><FONT color="red"><Export-Package>$YOUR_EXPORTED_PACKAGE</Export-Package></FONT><BR> |
| </instructions><BR> |
| </configuration><BR> |
| </plugin><BR> |
| <!-- iPOJO Maven Plugin Configuration : nothing to do --><BR> |
| <plugin><BR> |
| <groupId>org.apache.felix</groupId><BR> |
| <artifactId>maven-ipojo-plugin</artifactId><BR> |
| <version>0.8.0</version><BR> |
| <executions><BR> |
| <execution><BR> |
| <goals><BR> |
| <goal>ipojo-bundle</goal><BR> |
| </goals><BR> |
| </execution><BR> |
| </executions><BR> |
| </plugin><BR> |
| </plugins><BR> |
| </build><BR> |
| </project></P> |
| </DIV></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 inside the "src/main/resources" folder and is 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="panel"><DIV class="panelContent"> |
| <P>[INFO] Scanning for projects...<BR> |
| [INFO] ----------------------------------------------------------------------------<BR> |
| [INFO] Building Hello Client<BR> |
| [INFO] task-segment: [clean, install]<BR> |
| [INFO] ----------------------------------------------------------------------------<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] ------------------------------------------------------------------------<BR> |
| [INFO] BUILD SUCCESSFUL<BR> |
| [INFO] ------------------------------------------------------------------------<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] ------------------------------------------------------------------------</P> |
| </DIV></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="panel"><DIV class="panelContent"> |
| <P><plugin><BR> |
| <groupId>org.apache.felix</groupId><BR> |
| <artifactId>maven-ipojo-plugin</artifactId><BR> |
| <version>0.8.0</version><BR> |
| <executions><BR> |
| <execution><BR> |
| <goals><BR> |
| <goal>ipojo-bundle</goal><BR> |
| </goals><BR> |
| <configuration><BR> |
| <FONT color="red"><metadata>ipojo/meta.xml</metadata></FONT><BR> |
| </configuration><BR> |
| </execution><BR> |
| </executions><BR> |
| </plugin></P> |
| </DIV></DIV> |
| <P>In the metadata element, you can specify your metadata files. This file must be either in the same directory than the POM file (project root) or in one of the resource folder of the maven project (for instance, "src/main/resources/ipojo/meta.xml").</P> |
| |
| <P>The second option allows skipping annotations processing, by using the "<EM>ignoreAnnotations</EM>" element:</P> |
| <DIV class="panel"><DIV class="panelContent"> |
| <P><plugin><BR> |
| <groupId>org.apache.felix</groupId><BR> |
| <artifactId>maven-ipojo-plugin</artifactId><BR> |
| <version>0.8.0</version><BR> |
| <executions><BR> |
| <execution><BR> |
| <goals><BR> |
| <goal>ipojo-bundle</goal><BR> |
| </goals><BR> |
| <configuration><BR> |
| <FONT color="red"><ignoreAnnotations>true</ignoreAnnotations></FONT><BR> |
| </configuration><BR> |
| </execution><BR> |
| </executions><BR> |
| </plugin></P> |
| </DIV></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"><DIV class="codeContent"> |
| <PRE class="code-java">mvn org.apache.maven.plugins:maven-archetype-plugin:create |
| -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 fill out),</LI> |
| <LI>the src/main/java and src/main/resources folders,</LI> |
| <LI>the structure of your package name.</LI> |
| </UL> |
| |
| |
| <P>The src/main/resources folder contains a metadata.xml file to fill out.</P> |
| |
| <P><EM>Note:</EM> the maven-ipojo-plugin archetype gerenrate a pom file using the latest released version of the mavne-ipojo-plugin.</P> |
| </TD> |
| <TD class="confluenceTd" valign="top" width="20%"> |
| <H6><A name="iPOJOMavenPlug-in-Overview"></A><B>Overview</B></H6> |
| <UL> |
| <LI><A href="apache-felix-ipojo.html" title="Apache Felix iPOJO">Home Page</A></LI> |
| <LI><A href="apache-felix-ipojo-feature-overview.html" title="Apache Felix iPOJO Feature Overview">iPOJO Feature Overview</A></LI> |
| <LI><A href="download.html" title="Download">Download & Install </A></LI> |
| </UL> |
| |
| |
| <H6><A name="iPOJOMavenPlug-in-GettingStarted"></A><B>Getting Started</B></H6> |
| <UL> |
| <LI><A href="ipojo-in-10-minutes.html" title="iPOJO in 10 minutes">iPOJO in 10 minutes</A></LI> |
| <LI><A href="ipojo-hello-word-maven-based-tutorial.html" title="iPOJO Hello Word (Maven-Based) tutorial">iPOJO Hello Word (Maven-Based) tutorial</A></LI> |
| <LI><A href="ipojo-advanced-tutorial.html" title="iPOJO Advanced Tutorial">iPOJO Advanced Tutorial</A></LI> |
| </UL> |
| |
| |
| <H6><A name="iPOJOMavenPlug-in-UserGuide"></A><B>User Guide</B></H6> |
| <UL> |
| <LI><A href="describing-components.html" title="Describing components">Describing components (handler list) </A></LI> |
| <LI><A href="how-to-use-ipojo-annotations.html" title="How to use iPOJO Annotations">How to use iPOJO Annotations</A></LI> |
| <LI><A href="using-xml-schemas.html" title="Using XML Schemas">Using XML Schemas</A></LI> |
| <LI><A href="ipojo-advanced-topics.html" title="iPOJO Advanced Topics">Advanced Topics</A></LI> |
| <LI><A href="ipojo-faq.html" title="iPOJO FAQ">FAQ</A></LI> |
| </UL> |
| |
| |
| <H6><A name="iPOJOMavenPlug-in-Tools"></A><B>Tools</B></H6> |
| <UL> |
| <LI><A href="ipojo-eclipse-plug-in.html" title="iPOJO Eclipse Plug-in">iPOJO Eclipse Plug-in</A></LI> |
| <LI><A href="ipojo-ant-task.html" title="iPOJO Ant Task">iPOJO Ant Task</A></LI> |
| <LI><A href="#" title="iPOJO Maven Plug-in">iPOJO Maven Plug-in</A></LI> |
| <LI><A href="ipojo-concepts-overview.html" title="iPOJO Concepts Overview">iPOJO concepts overview</A></LI> |
| </UL> |
| |
| |
| <H6><A name="iPOJOMavenPlug-in-DeveloperGuide"></A><B>Developer Guide</B></H6> |
| <UL> |
| <LI>API: <SPAN class="nobr"><A href="http://people.apache.org/~clement/ipojo/api/0.8/" title="Visit page outside Confluence" rel="nofollow">0.8<SUP><IMG class="rendericon" src="../../cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></LI> |
| <LI><A href="how-to-write-your-own-handler.html" title="How to write your own handler">How to write your own handler</A></LI> |
| <LI><A href="how-to-use-ipojo-manipulation-metadata.html" title="How to use iPOJO Manipulation Metadata">How to use iPOJO Manipulation Metadata</A></LI> |
| </UL> |
| |
| |
| <H6><A name="iPOJOMavenPlug-in-Misc%26Contact"></A><B>Misc & Contact</B></H6> |
| <UL> |
| <LI><A href="apache-felix-ipojo-issuestracker.html" title="apache-felix-ipojo-issuestracker">Issues Tracker</A></LI> |
| <LI><A href="apache-felix-ipojo-supportedvms.html" title="apache-felix-ipojo-supportedVMs">Supported JVMs</A></LI> |
| <LI><A href="apache-felix-ipojo-supportedosgi.html" title="apache-felix-ipojo-supportedOSGi">Supported OSGi Implementations</A></LI> |
| <LI><A href="future-ideas.html" title="Future Ideas">Future Ideas</A></LI> |
| <LI><A href="contact.html" title="Contact">Contact</A></LI> |
| <LI><A href="related-works.html" title="Related Works">Related Works</A></LI> |
| <LI><A href="article-presentations.html" title="Article & Presentations">Article & Presentations</A></LI> |
| </UL> |
| |
| |
| <HR> |
| <DIV class="" align="center"> |
| <P><SPAN class="nobr"><A href="http://cwiki.apache.org/confluence/createrssfeed.action?types=blogpost&statuses=created&statuses=modified&spaces=FELIX&labelString=iPOJO&rssType=atom&maxResults=10&timeSpan=5&publicFeed=true&title=iPOJO%20Atom%20Feed" title="Stay tuned!" rel="nofollow"><IMG src="../../cwiki.apache.org/confluence/images/icons/feed-icon-32x32.png" align="absmiddle" border="0"><SUP><IMG class="rendericon" src="../../cwiki.apache.org/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"></SUP></A></SPAN></P></DIV></TD></TR></TBODY></TABLE> |
| </DIV> |
| </BODY> |
| |
| <!-- Mirrored Site: felix.apache.org. File: /site/ipojo-maven-plug-in.html. Date: Mon, 13 Oct 2008 06:52:45 GMT --> |
| </HTML> |