Jim,

Yeah, that's basically correct -- it generates a feature descriptor
for the direct dependencies of the project.  For an example, have a
look at 
http://svn.apache.org/repos/asf/servicemix/smx4/features/trunk/camel/camel-features/
which generates a features descriptor for all the Camel components.

In the latest plugin 1.2-SNAPSHOT version, the discovery of bundles in
the dependencies happens before the generation process starts, also
taking into account transitive dependencies.

It would indeed make sense to improve the generator to build a feature
for the current artifact -- could you raise a JIRA issue for that in
https://issues.apache.org/jira/browse/FELIX (component Karaf, which is
the new name/location for the ServiceMix Kernel project)?

Regards,

Gert Vanthienen
------------------------
Open Source SOA: http://fusesource.com
Blog: http://gertvanthienen.blogspot.com/



2009/4/29 Jim Breen <[email protected]>:
> Gert,
>
> Thanks very much.  Is there an example anywhere for the
> generate-features-xml goal?
>
> Here's what I'm trying:
>
> <plugin>
>    <groupId>org.apache.servicemix.tooling</groupId>
>    <artifactId>features-maven-plugin</artifactId>
>    <executions>
>        <execution>
>            <phase>compile</phase>
>            <goals>
>                <goal>generate-features-xml</goal>
>            </goals>
>            <configuration>
>                <kernelVersion>1.1.0</kernelVersion>
>                <!--
>                    <bundles>target/classes/bundles.properties</bundles>
>                -->
>            </configuration>
>        </execution>
>    </executions>
> </plugin>
>
> Is the format of the <bundles> file just a list of bundles in the form:
> groupId/artifactId/version/type?
>
> I was hoping that this goal would generate a feature for my project's
> artifact.  However, the behavior seems to be the following:
> - Create a feature for every direct dependency of the current project.
> - Add direct dependencies to list of known bundles as they are processed.
> - Find bundles that implement the feature bundle's package requirements from
> the list of known bundles, and add those bundles to the feature definition.
> - Attach the generated XML file as an artifact of the project
>
> Is this accurate?  Is there anyway to create a features configuration for
> the project's artifact?
>
> Also, the automatic bundle discovery seems to only look at the the first
> level of transitive dependencies.  Is that correct?
>
> Thanks,
> Jim
>
>
>
> On Apr 28, 2009, at 3:44 PM, Gert Vanthienen wrote:
>
>> Jim,
>>
>> I'm afraid there's no documentation on the features-maven-plugin
>> currently -- making a note on my todo list now to do it soon if nobody
>> beats me to it.
>>
>> Currently, the plugin has two goals that are more or less useful:
>> - add-features-to-repo allows you to seed a maven repository with all
>> the bundles required for a given set of features - it can help you
>> build your own package/distribution.  For an example, look at the
>> features/assembly pom.xml
>> - generate-features-xml generates a features.xml file for a given
>> maven artifact, by looking into the OSGi imports for the artifacts and
>> figuring out which bundles to add for satisfying all the requirements
>>
>> For the near future, we're planning to add:
>> - a validate goal to validate a features.xml file for consistency (do
>> all the bundles exist, have all the OSGi imports been met...)
>> - goals to install/uninstall features using the JMX Features MBean
>> that's in ServiceMix Kernel.
>>
>> Regards,
>>
>> Gert Vanthienen
>> ------------------------
>> Open Source SOA: http://fusesource.com
>> Blog: http://gertvanthienen.blogspot.com/
>>
>>
>>
>> 2009/4/28 Jim Breen <[email protected]>:
>>>
>>> Is there any documentation for the features-maven-plugin?  I see an
>>> example
>>> of how it's used in the SMX4 pom.xml, but I'd like to know more about
>>> it's
>>> capabilities.
>>>
>>> Thanks for any info,
>>>
>>> Jim
>>>
>
>

Reply via email to