Why don't you just use the maven-scr-plugin and its annotations?
I've found it very handy to generate the component descriptor.

This is a snippet of a pom of mine (notice there's no bnd file "tampering"):

<project xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd";>
   <modelVersion>4.0.0</modelVersion>
   <properties>
<component.descriptor.name>Locator.xml</component.descriptor.name> </properties>

   <!-- List dependencies here -->
   <dependencies>
       ...
       <dependency>
           <groupId>org.apache.felix</groupId>
           <artifactId>org.apache.felix.scr.annotations</artifactId>
           <version>0.9.0</version>
       </dependency>
       ...
   </dependencies>
   <build>
       <plugins>
           <plugin>
               <groupId>org.apache.felix</groupId>
               <artifactId>maven-bundle-plugin</artifactId>
               <extensions>true</extensions>
               <configuration>
                   <instructions>
                       <Bundle-Name>${project.name}</Bundle-Name>
                       <Export-Package>org.something.api</Export-Package>
<Service-Component>OSGI-INF/${component.descriptor.name}</Service-Component> </instructions>
               </configuration>
           </plugin>
           <plugin>
               <groupId>org.apache.felix</groupId>
               <artifactId>maven-scr-plugin</artifactId>
               <version>1.0.8</version>
               <configuration>
                   <finalName>${component.descriptor.name}</finalName>
               </configuration>
               <executions>
                   <execution>
                       <id>generate-scr-scrdescriptor</id>
                       <goals>
                           <goal>scr</goal>
                       </goals>
                   </execution>
               </executions>
           </plugin>
       </plugins>
   </build>

</project>


Cheers,
Guido

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to