| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd";> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| <html> |
| <head> |
| <link rel="shortcut icon" href="http://aries.apache.org/images/favicon.ico"></link> |
| <link type="text/css" rel="stylesheet" href="http://aries.apache.org/resources/site.css"></link> |
| </script><script src="http://aries.apache.org/resources/menus.js" language="javascript" type="text/javascript"></script> |
| <meta name="keywords" content="..."/> |
| <meta name="description" content="..." /> |
| <title> |
| Apache Aries - blueprint-maven-plugin |
| </title> |
| </head> |
| <body onload="SetMenu()"> |
| |
| <table width="100%" cellpadding="0" cellspacing="0"> |
| <tr width="100%"> |
| <td id="cell-0-0" colspan="2"> </td> |
| <td id="cell-0-1"> </td> |
| <td id="cell-0-2" colspan="2"> </td> |
| </tr> |
| <tr width="100%"> |
| <td id="cell-1-0"> </td> |
| <td id="cell-1-1"> </td> |
| <td id="cell-1-2"> |
| <div style="padding: 5px;"> |
| <div id="banner"> |
| <!-- Banner --> |
| <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
| <tr> |
| <td align="left" class="topbardiv" nowrap=""> |
| <a href="http://aries.apache.org/" title="Apache Aries"> <img border="0" src="http://aries.apache.org/images/Arieslogo_Horizontal.gif"> </a> |
| </td> |
| <td align="right" nowrap=""> |
| <a href="http://www.apache.org/" title="The Apache Software Foundation"> <img border="0" src="http://aries.apache.org/images/apache_feather.png"> </a> |
| </td> |
| </tr> |
| </table> |
| <!-- Banner --> |
| </div> |
| </div> |
| <div id="top-menu"> |
| <table border="0" cellpadding="1" cellspacing="0" width="100%"> |
| <tr> |
| <td> |
| <div align="left"> |
| <!-- Breadcrumbs --> |
| <!-- Breadcrumbs --> |
| </div> |
| </td> |
| <td> |
| <div align="right"> |
| <!-- Quicklinks --> |
| <DIV style="padding: 5px 5px 0px 25px;"> |
| <FORM action="http://www.google.com/search" method="get" style="font-size: 10px;"> |
| <A href="http://www.apache.org/licenses/LICENSE-2.0.html" class="external-link" rel="nofollow">License</A> |
| <INPUT name="ie" type="hidden" value="UTF-8"></INPUT> |
| <INPUT name="oe" type="hidden" value="UTF-8"></INPUT> |
| <INPUT maxlength="255" name="q" size="15" type="text" value></INPUT> |
| <INPUT name="btnG" type="submit" value="Search"></INPUT> |
| <INPUT name="domains" type="hidden" value="aries.apache.org"></INPUT> |
| <INPUT name="sitesearch" type="hidden" value="aries.apache.org"></INPUT> |
| </FORM> |
| </DIV> |
| <!-- Quicklinks --> |
| </div> |
| </td> |
| </tr> |
| </table> |
| </div> |
| </td> |
| <td id="cell-1-3"> </td> |
| <td id="cell-1-4"> </td> |
| </tr> |
| <tr width="100%"> |
| <td id="cell-2-0" colspan="2"> </td> |
| <td id="cell-2-1"> |
| <table> |
| <tr height="100%" valign="top"> |
| <td height="100%"> |
| <div id="wrapper-menu-page-right"> |
| <div id="wrapper-menu-page-top"> |
| <div id="wrapper-menu-page-bottom"> |
| <div id="menu-page"> |
| <!-- NavigationBar --> |
| <style type="text/css"> |
| /* The following code is added by mdx_elementid.py |
| It was originally lifted from http://subversion.apache.org/style/site.css */ |
| /* |
| * Hide class="elementid-permalink", except when an enclosing heading |
| * has the :hover property. |
| */ |
| .headerlink, .elementid-permalink { |
| visibility: hidden; |
| } |
| h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style> |
| <div onclick="SwitchMenu('documentation')" id="documentationTitle" class="menutitle">Documentation</div> |
| |
| <div id="documentation" class="menuitemgroup"> |
| <div class="menuitem"> |
| <a href="/documentation/integrators-guide.html">Integrators Guide</a> |
| </div> |
| <div class="menuitem"> |
| <a href="/documentation/articles.html">Articles</a> |
| </div> |
| <div class="menuitem"> |
| <a href="https://svn.apache.org/repos/asf/aries/slides/">Slides</a> |
| </div> |
| <div class="menuitem"> |
| <a href="/documentation/tutorials.html">Tutorials</a> |
| </div> |
| <div class="menuitem"> |
| <a href="/documentation/tools.html">Tools</a> |
| </div> |
| </div> |
| |
| <div onclick="SwitchMenu('modules')" id="modulesTitle" class="menutitle">Modules</div> |
| |
| <div id="modules" class="menuitemgroup"> |
| <div class="menuitem"> |
| <a href="/modules/samples.html">Samples</a> |
| </div> |
| <div class="menuitem"> |
| <a href="/modules/async-svcs.html">Asynchronous Services</a> |
| </div> |
| <div class="menuitem"> |
| <a href="/modules/blueprint.html">Blueprint</a> |
| </div> |
| <div class="menuitem"> |
| <a href="/modules/blueprint-maven-plugin.html">Blueprint-maven-plugin</a> |
| </div> |
| <div class="menuitem"> |
| <a href="/modules/blueprintannotation.html">Blueprint Annotations</a> |
| </div> |
| <div class="menuitem"> |
| <a href="/modules/blueprintnoosgi.html">Blueprint No-OSGi</a> |
| </div> |
| <div class="menuitem"> |
| <a href="/modules/blueprintweb.html">Blueprint Web</a> |
| </div> |
| <div class="menuitem"> |
| <a href="/modules/containers.html">Containers</a> |
| </div> |
| <div class="menuitem"> |
| <a href="/modules/esaanttask.html">ESA Ant Task </a> |
| </div> |
| <div class="menuitem"> |
| <a href="/modules/ebamavenpluginproject.html">EBA Maven Plugin </a> |
| </div> |
| <div class="menuitem"> |
| <a href="/modules/esamavenpluginproject.html">ESA Maven Plugin </a> |
| </div> |
| <div class="menuitem"> |
| <a href="/modules/jmx.html">JMX</a> |
| </div> |
| <div class="menuitem"> |
| <a href="/modules/jndiproject.html">JNDI</a> |
| </div> |
| <div class="menuitem"> |
| <a href="/modules/jpaproject.html">JPA</a> |
| </div> |
| <div class="menuitem"> |
| <a href="/modules/transactioncontrol.html">Transaction Control Service</a> |
| </div> |
| <div class="menuitem"> |
| <a href="/modules/transactionsproject.html">Transactions</a> |
| </div> |
| <div class="menuitem"> |
| <a href="/modules/rsa.html">Remote Service Admin (RSA)</a> |
| </div> |
| <div class="menuitem"> |
| <a href="/modules/spi-fly.html">SPI Fly</a> |
| </div> |
| <div class="menuitem"> |
| <a href="/modules/subsystems.html">Subsystems</a> |
| </div> |
| <div class="menuitem"> |
| <a href="/modules/applications.html">Applications (obsolete)</a> |
| </div> |
| </div> |
| |
| <div onclick="SwitchMenu('downloads')" id="downloadsTitle" class="menutitle">Downloads</div> |
| |
| <div id="downloads" class="menuitemgroup"> |
| <div class="menuitem"> |
| <a href="/downloads/currentreleases.html">Current Releases</a> |
| </div> |
| <div class="menuitem"> |
| <a href="/downloads/testresults.html">Compliance Tests</a> |
| </div> |
| <div class="menuitem"> |
| <a href="/downloads/archived-releases.html">Archived Releases</a> |
| </div> |
| </div> |
| |
| <div onclick="SwitchMenu('community')" id="communityTitle" class="menutitle">Community</div> |
| |
| <div id="community" class="menuitemgroup"> |
| <div class="menuitem"> |
| <a href="/community/resources.html">Community Resources</a> |
| </div> |
| <div class="menuitem"> |
| <a href="/community/gettinginvolved.html">Getting Involved</a> |
| </div> |
| <div class="menuitem"> |
| <a href="/community/people.html">Who we are</a> |
| </div> |
| <div class="menuitem"> |
| <a href="/community/boardreports.html">Board Reports</a> |
| </div> |
| <div class="menuitem"> |
| <a href="/community/logos.html">Logos for Users</a> |
| </div> |
| </div> |
| |
| <div onclick="SwitchMenu('development')" id="developmentTitle" class="menutitle">Development</div> |
| |
| <div id="development" class="menuitemgroup"> |
| <div class="menuitem"> |
| <a href="/development/buildingaries.html">Building Aries </a> |
| </div> |
| <div class="menuitem"> |
| <a href="/development/guidelines.html">Cording Guidelines</a> |
| </div> |
| <div class="menuitem"> |
| <a href="/development/architecture.html">Architecture</a> |
| </div> |
| <div class="menuitem"> |
| <a href="/development/releasingaries.html">Releasing Aries </a> |
| </div> |
| <div class="menuitem"> |
| <a href="/development/compliancetesting.html">OSGi Compliance Tests </a> |
| </div> |
| <div class="menuitem"> |
| <a href="/development/maintainingthewebpages.html">Web Site Maintenance </a> |
| </div> |
| </div> |
| |
| <div onclick="SwitchMenu('sponsorship')" id="sponsorshipTitle" class="menutitle">Sponsorship</div> |
| |
| <div id="sponsorship" class="menuitemgroup"> |
| <div class="menuitem"> |
| <a href="http://www.apache.org/foundation/thanks.html">Thanks</a> |
| </div> |
| <div class="menuitem"> |
| <a href="http://www.apache.org/foundation/sponsorship.html">Sponsoring Apache</a> |
| </div> |
| </div> |
| |
| <div class="promotion"> |
| <a href="http://www.apache.org/events/current-event.html"> |
| <img src="http://www.apache.org/events/current-event-125x125.png" width="125" height="125"/> |
| </a> |
| </div> |
| <!-- NavigationBar --> |
| </div> |
| </div> |
| </div> |
| </div> |
| </td> |
| <td height="100%" width="100%"> |
| <!-- Content --> |
| <div class="wiki-content"><style type="text/css"> |
| /* The following code is added by mdx_elementid.py |
| It was originally lifted from http://subversion.apache.org/style/site.css */ |
| /* |
| * Hide class="elementid-permalink", except when an enclosing heading |
| * has the :hover property. |
| */ |
| .headerlink, .elementid-permalink { |
| visibility: hidden; |
| } |
| h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style> |
| <p>Writing blueprint xml is quite verbose and large blueprint xmls are difficult to keep in sync with code changes and especially refactorings. |
| So you would like to do most declarations using annoations and ideally these annotations should be standardized.</p> |
| <h2 id="blueprint-maven-plugin">blueprint-maven-plugin<a class="headerlink" href="#blueprint-maven-plugin" title="Permanent link">¶</a></h2> |
| <p>The blueprint-maven-plugin allows to configure blueprint using annotations. It scans one or more paths for annotated classes and creates a blueprint.xml in target/generated-sources/blueprint/OSGI-INF/blueprint. So at runtime the bundle behaves like a normal blueprint bundle. |
| The generated blueprint can also be used together with a manually created blueprint file. So for example cxf services can be created in xml while most of the beans are automatically generated.</p> |
| <p>Usage:</p> |
| <div class="codehilite"><pre><span class="nt"><plugin></span> |
| <span class="nt"><groupId></span>org.apache.aries.blueprint<span class="nt"></groupId></span> |
| <span class="nt"><artifactId></span>blueprint-maven-plugin<span class="nt"></artifactId></span> |
| <span class="nt"><version></span>1.9.0<span class="nt"></version></span> |
| <span class="nt"><configuration></span> |
| <span class="nt"><scanPaths></span> |
| <span class="nt"><scanPath></span>org.my.package<span class="nt"></scanPath></span> |
| <span class="nt"></scanPaths></span> |
| <span class="nt"></configuration></span> |
| <span class="nt"><executions></span> |
| <span class="nt"><executions></span> |
| <span class="nt"><execution></span> |
| <span class="nt"><goals></span> |
| <span class="nt"><goal></span>add-resource-dir<span class="nt"></goal></span> |
| <span class="nt"><goal></span>blueprint-generate<span class="nt"></goal></span> |
| <span class="nt"></goals></span> |
| <span class="nt"></execution></span> |
| <span class="nt"></executions></span> |
| <span class="nt"></executions></span> |
| <span class="nt"></plugin></span> |
| </pre></div> |
| |
| |
| <h2 id="goals">Goals<a class="headerlink" href="#goals" title="Permanent link">¶</a></h2> |
| <h3 id="add-resource-dir">add-resource-dir<a class="headerlink" href="#add-resource-dir" title="Permanent link">¶</a></h3> |
| <p>Creates target/generated-sources/blueprint folder and register it as a maven resource directory in generate-resources phase, so IDEs like IntelliJ IDEA could find it automatically.</p> |
| <h3 id="blueprint-generate">blueprint-generate<a class="headerlink" href="#blueprint-generate" title="Permanent link">¶</a></h3> |
| <p>Creates blueprint xml from annotations in process-classes phase and put file in target/generated-sources/blueprint/OSGI-INF/blueprint/autowire.xml. Destination directory (OSGI-INF/blueprint) and file name (autowire.xml) could be change via configuration properties: generatedDir and generatedFileName.</p> |
| <h2 id="annotations">Annotations<a class="headerlink" href="#annotations" title="Permanent link">¶</a></h2> |
| <h3 id="javaxinject-jsr-330">javax.inject (JSR 330)<a class="headerlink" href="#javaxinject-jsr-330" title="Permanent link">¶</a></h3> |
| <ul> |
| <li>@Inject Inject a bean by type and optionally further qualifiers</li> |
| <li>@Singleton Mark a class as being a bean</li> |
| <li>@Named("Myname") Names a @Singleton and qualifies an @Inject to limit it to matches with the same bean id</li> |
| <li>@Qualifier Annotation on your own annotation</li> |
| </ul> |
| <h3 id="javaxenterprise">javax.enterprise<a class="headerlink" href="#javaxenterprise" title="Permanent link">¶</a></h3> |
| <ul> |
| <li>@Produces Create bean using factory method</li> |
| </ul> |
| <h3 id="javaxtransaction">javax.transaction<a class="headerlink" href="#javaxtransaction" title="Permanent link">¶</a></h3> |
| <ul> |
| <li>@Transactional mark the class as transactional.</li> |
| </ul> |
| <h3 id="javaxtransactioncdi">javax.transaction.cdi<a class="headerlink" href="#javaxtransactioncdi" title="Permanent link">¶</a></h3> |
| <ul> |
| <li>@Transactional mark the class as transactional.</li> |
| </ul> |
| <h3 id="javaxannotation-jsr-250">javax.annotation (JSR 250)<a class="headerlink" href="#javaxannotation-jsr-250" title="Permanent link">¶</a></h3> |
| <ul> |
| <li>@PostConstruct Marks a method to be called after DI is finished (init-method)</li> |
| <li>@PreDestroy Marks a method to be called before the bean is destroyed (destroy-method)</li> |
| </ul> |
| <h3 id="javaxpersistence">javax.persistence<a class="headerlink" href="#javaxpersistence" title="Permanent link">¶</a></h3> |
| <ul> |
| <li>@PersistenceContext(unitName="tasklist") inject a managed EntityManager for the given persistence unit into a field</li> |
| <li>@PersistenceUnit(unitName="tasklist") inject an unmanaged EntityManagerFactory for the given persistence unit into a field</li> |
| </ul> |
| <h3 id="configuration-annotations-orgapacheariesblueprintannotationconfig">Configuration annotations (org.apache.aries.blueprint.annotation.config)<a class="headerlink" href="#configuration-annotations-orgapacheariesblueprintannotationconfig" title="Permanent link">¶</a></h3> |
| <ul> |
| <li>@ConfigProperty Inject value as property from property-placeholder or constant</li> |
| <li>@Config Creates cm:property-placehoder</li> |
| <li>@DefaultProperty Configure default values for properties in property-placeholder</li> |
| </ul> |
| <h3 id="collection-annotations-orgapacheariesblueprintannotationcollection">Collection annotations (org.apache.aries.blueprint.annotation.collection)<a class="headerlink" href="#collection-annotations-orgapacheariesblueprintannotationcollection" title="Permanent link">¶</a></h3> |
| <ul> |
| <li>@CollectionInject Inject list, set or array of existing beans of provided interface</li> |
| </ul> |
| <h3 id="bean-annotations-orgapacheariesblueprintannotationbean">Bean annotations (org.apache.aries.blueprint.annotation.bean)<a class="headerlink" href="#bean-annotations-orgapacheariesblueprintannotationbean" title="Permanent link">¶</a></h3> |
| <ul> |
| <li>@Bean Mark a class as a bean or method as factory of bean</li> |
| </ul> |
| <h3 id="reference-listener-annotations-orgapacheariesblueprintannotationreferencelistener">Reference listener annotations (org.apache.aries.blueprint.annotation.referencelistener)<a class="headerlink" href="#reference-listener-annotations-orgapacheariesblueprintannotationreferencelistener" title="Permanent link">¶</a></h3> |
| <ul> |
| <li>@ReferenceListener Marks bean as reference listener</li> |
| <li>@Bind Method of referenence listener to be called when service registers</li> |
| <li>@Unbind Method of referenence listener to be called when service unregisters</li> |
| </ul> |
| <h3 id="service-annotations-orgapacheariesblueprintannotationservice">Service annotations (org.apache.aries.blueprint.annotation.service)<a class="headerlink" href="#service-annotations-orgapacheariesblueprintannotationservice" title="Permanent link">¶</a></h3> |
| <ul> |
| <li>@Service Publishes a bean as an OSGi service with the given interfaces</li> |
| <li>@ServiceProperty Defines a service property </li> |
| <li>@Reference Creates a reference to an OSGi service</li> |
| <li>@ReferenceList Creates a list of references of an OSGi services</li> |
| </ul> |
| <h3 id="pax-cdi-supported-in-version-1x-probably-dropped-in-next-major-versions">pax-cdi (supported in version 1.x, probably dropped in next major versions)<a class="headerlink" href="#pax-cdi-supported-in-version-1x-probably-dropped-in-next-major-versions" title="Permanent link">¶</a></h3> |
| <ul> |
| <li>@OsgiServiceProvider(classes={TaskService.class}) Publishes a bean as an OSGi service with the given interfaces</li> |
| <li>@OsgiService creates a reference to an OSGi service. On optional filter is also possible</li> |
| <li>@Properties Defines service properties for OSGiServiceProvider</li> |
| <li>@Property Defines a service property </li> |
| </ul> |
| <h3 id="spring-supported-in-version-1x-probably-dropped-in-next-major-versions">Spring (supported in version 1.x, probably dropped in next major versions)<a class="headerlink" href="#spring-supported-in-version-1x-probably-dropped-in-next-major-versions" title="Permanent link">¶</a></h3> |
| <ul> |
| <li>@Autowired Inject a bean by type and optionally further qualifiers</li> |
| <li>@Component Creates bean witd default or given name</li> |
| <li>@DependsOn Make bean depending on another bean</li> |
| <li>@Lazy Make bean lazy</li> |
| <li>@Qualifier Name injected bean</li> |
| <li>@Transactional mark the class as transactional</li> |
| <li>@Value Inject value or constant</li> |
| </ul> |
| <h2 id="dependencies-for-annotations">Dependencies for annotations<a class="headerlink" href="#dependencies-for-annotations" title="Permanent link">¶</a></h2> |
| <div class="codehilite"><pre><span class="nt"><dependency></span> |
| <span class="nt"><groupId></span>javax.inject<span class="nt"></groupId></span> |
| <span class="nt"><artifactId></span>javax.inject<span class="nt"></artifactId></span> |
| <span class="nt"><version></span>1<span class="nt"></version></span> |
| <span class="nt"><optional></span>true<span class="nt"></optional></span> |
| <span class="nt"></dependency></span> |
| <span class="nt"><dependency></span> |
| <span class="nt"><groupId></span>javax.enterprise<span class="nt"></groupId></span> |
| <span class="nt"><artifactId></span>cdi-api<span class="nt"></artifactId></span> |
| <span class="nt"><version></span>1.2<span class="nt"></version></span> |
| <span class="nt"><optional></span>true<span class="nt"></optional></span> |
| <span class="nt"></dependency></span> |
| <span class="nt"><dependency></span> |
| <span class="nt"><groupId></span>javax.persistence<span class="nt"></groupId></span> |
| <span class="nt"><artifactId></span>persistence-api<span class="nt"></artifactId></span> |
| <span class="nt"><version></span>1.0.2<span class="nt"></version></span> |
| <span class="nt"><optional></span>true<span class="nt"></optional></span> |
| <span class="nt"></dependency></span> |
| <span class="nt"><dependency></span> |
| <span class="nt"><groupId></span>javax.transaction<span class="nt"></groupId></span> |
| <span class="nt"><artifactId></span>javax.transaction-api<span class="nt"></artifactId></span> |
| <span class="nt"><version></span>1.2<span class="nt"></version></span> |
| <span class="nt"><optional></span>true<span class="nt"></optional></span> |
| <span class="nt"></dependency></span> |
| <span class="nt"><dependency></span> |
| <span class="nt"><groupId></span>org.apache.aries.blueprint<span class="nt"></groupId></span> |
| <span class="nt"><artifactId></span>blueprint-maven-plugin-annotation<span class="nt"></artifactId></span> |
| <span class="nt"><version></span>1.3.0<span class="nt"></version></span> |
| <span class="nt"><optional></span>true<span class="nt"></optional></span> |
| <span class="nt"></dependency></span> |
| <span class="nt"><dependency></span> |
| <span class="nt"><groupId></span>org.ops4j.pax.cdi<span class="nt"></groupId></span> |
| <span class="nt"><artifactId></span>pax-cdi-api<span class="nt"></artifactId></span> |
| <span class="nt"><version></span>0.8.0<span class="nt"></version></span> |
| <span class="nt"><optional></span>true<span class="nt"></optional></span> |
| <span class="nt"></dependency></span> |
| <span class="nt"><dependency></span> |
| <span class="nt"><groupId></span>org.apache.servicemix.bundles<span class="nt"></groupId></span> |
| <span class="nt"><artifactId></span>org.apache.servicemix.bundles.spring-beans<span class="nt"></artifactId></span> |
| <span class="nt"><version></span>3.2.11.RELEASE_1<span class="nt"></version></span> |
| <span class="nt"><optional></span>true<span class="nt"></optional></span> |
| <span class="nt"></dependency></span> |
| </pre></div> |
| |
| |
| <p>Note that the annotations are needed only during build run, so you can exclude them or mark optional in Import-Package header of your bundle.</p> |
| <h2 id="spi">SPI<a class="headerlink" href="#spi" title="Permanent link">¶</a></h2> |
| <p>Whole plugin is written using 'plugin architecture', so your own annotations could be configured for bleuprint generation. All you need to do, is to implement one of interfaces from blueprint-maven-plugin-spi:</p> |
| <div class="codehilite"><pre><span class="nt"><dependency></span> |
| <span class="nt"><groupId></span>org.apache.aries.blueprint<span class="nt"></groupId></span> |
| <span class="nt"><artifactId></span>blueprint-maven-plugin-spi<span class="nt"></artifactId></span> |
| <span class="nt"><version></span>1.1.0<span class="nt"></version></span> |
| <span class="nt"></dependency></span> |
| </pre></div> |
| |
| |
| <p>Next add file (or files) to META-INF/services directory describing which interface implementation your artifact provides and add such artifact as plugin dependency</p> |
| <div class="codehilite"><pre><span class="nt"><plugin></span> |
| <span class="nt"><groupId></span>org.apache.aries.blueprint<span class="nt"></groupId></span> |
| <span class="nt"><artifactId></span>blueprint-maven-plugin<span class="nt"></artifactId></span> |
| <span class="nt"><version></span>1.9.0<span class="nt"></version></span> |
| ... |
| <span class="nt"><dependencies></span> |
| <span class="nt"><dependency></span> |
| <span class="nt"><groupId></span>org.apache.aries.blueprint.example<span class="nt"></groupId></span> |
| <span class="nt"><artifactId></span>blueprint-maven-plugin-my-extension<span class="nt"></artifactId></span> |
| <span class="nt"><version></span>1.0.0<span class="nt"></version></span> |
| <span class="nt"></dependency></span> |
| <span class="nt"></dependencies></span> |
| ... |
| <span class="nt"></plugin></span> |
| </pre></div> |
| |
| |
| <h2 id="additional-configuration">Additional configuration<a class="headerlink" href="#additional-configuration" title="Permanent link">¶</a></h2> |
| <p>Bean from factories are named by bean class nams or as defined in @Named or @Bean annotations. |
| If you want to name such beans after producing method name then add configuration parameter:</p> |
| <div class="codehilite"><pre><span class="nt"><configuration></span> |
| <span class="nt"><customParameters></span> |
| <span class="nt"><blueprint.beanFromFactory.nameFromFactoryMethodName></span>true<span class="nt"></blueprint.beanFromFactory.nameFromFactoryMethodName></span> |
| <span class="nt"></customParameters></span> |
| <span class="nt"></configuration></span> |
| </pre></div> |
| |
| |
| <h2 id="example">Example<a class="headerlink" href="#example" title="Permanent link">¶</a></h2> |
| <p>For a complete example see <a href="https://github.com/cschneider/Karaf-Tutorial/tree/master/tasklist-blueprint-cdi">tasklist-blueprint-cdi</a> on github or <a href="http://svn.apache.org/repos/asf/aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/test/">tests of blueprint-maven-plugin</a>.</p></div> |
| <!-- Content --> |
| </td> |
| </tr> |
| </table> |
| </td> |
| <td id="cell-2-2" colspan="2"> </td> |
| </tr> |
| <tr width="100%"> |
| <td id="cell-3-0"> </td> |
| <td id="cell-3-1"> </td> |
| <td id="cell-3-2"> |
| <div id="footer"> |
| <!-- Footer --> |
| <div id="site-footer"> |
| <a href="http://aries.apache.org/privacy-policy.html";>Privacy |
| Policy</a> |
| </div> |
| <!-- Footer --> |
| </div> |
| </td> |
| <td id="cell-3-3"> </td> |
| <td id="cell-3-4"> </td> |
| </tr> |
| <tr width="100%"> |
| <td id="cell-4-0" colspan="2"> </td> |
| <td id="cell-4-1"> </td> |
| <td id="cell-4-2" colspan="2"> </td> |
| </tr> |
| </table> |
| </body> |
| </html> |