It is possible with the proposed patch in 
https://issues.apache.org/jira/browse/KARAF-2961 (the pull-request includes an 
example test project)

Maven supports additional attachments to a project by using classifiers - and 
since a karaf feature already uses a classifier there's no issue there either 
with it conflicting with the main artifact.

--
Cheers, Stuart

On 23 Jul 2014, at 13:28, Achim Nierbeck <[email protected]> wrote:

> Nope, not possible, and not really a solution to long for. 
> As your bundle is a maven artifact while the feature file itself is also an 
> artifact. 
> In that case it also makes much more sense to have two separate maven 
> modules. 
> 
> Regards, Achim 
> 
> 
> 2014-07-23 14:23 GMT+02:00 rsteppac <[email protected]>:
> I am trying to use the karaf-maven-plugin (v 3.0.1) to dynamically build the
> feature.xml required to deploy my bundle in Karaf. The only setup I got to
> work is to have a separate maven project that declares the bundle project as
> a dependency. Doing so will create a feature.xml that contains my bundle and
> all its dependencies.
> 
> I was hoping to be able to do away with the additional project by generating
> the feature.xml in the bundle project itself and then adding it as a
> resource to the installation/deployment phase like so:
> 
> <build>
>     <plugins>
>         <plugin>
>             <groupId>org.apache.karaf.tooling</groupId>
>             <artifactId>karaf-maven-plugin</artifactId>
>             <executions>
>                 <execution>
>                     <id>generate-features-descriptor</id>
>                     <phase>generate-resources</phase>
>                     <goals>
>                         <goal>features-generate-descriptor</goal>
>                     </goals>
>                 </execution>
>             </executions>
>         </plugin>
>         <plugin>
>             <groupId>org.codehaus.mojo</groupId>
>             <artifactId>build-helper-maven-plugin</artifactId>
>             <executions>
>                 <execution>
>                     <id>attach-artifacts</id>
>                     <phase>package</phase>
>                     <goals>
>                         <goal>attach-artifact</goal>
>                     </goals>
>                     <configuration>
>                         <artifacts>
>                             <artifact>
>                                 <file>target/feature/feature.xml</file>
>                                 <type>xml</type>
>                                 <classifier>features</classifier>
>                             </artifact>
>                         </artifacts>
>                     </configuration>
>                 </execution>
>             </executions>
>         </plugin>
>     </plugins>
> </build>
> 
> I bound the "features-generate-descriptor" goal to different phases, but the
> resulting feature.xml always only contains the dependencies of my bundle,
> but not the bundle itself.
> How would I have to configure the plugin to create both artifacts,
> feature.xml and bundle jar, in the same project build?
> 
> 
> Thanks!
> Ralf
> 
> 
> 
> --
> View this message in context: 
> http://karaf.922171.n3.nabble.com/How-to-generate-bundle-jar-and-feature-xml-in-same-Maven-build-tp4034402.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
> 
> 
> 
> -- 
> 
> Apache Member
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & 
> Project Lead
> blog <http://notizblog.nierbeck.de/>
> 
> Software Architect / Project Manager / Scrum Master
> 

Reply via email to