blob: 8a020350c79b9d786e22b49ecba2f4af0fe0c0bb [file] [log] [blame]
h2. Goal {{features:generate}}
The {{features:generate}} goal generates a features XML file for every bundle listed in the project's dependencies. In order to satisfy the required imports in these bundles, the plugin will add bundles:
- bundles provided by Apache Karaf
- a explicit list of bundles
- bundles discovered in the POM's transitive dependencies
Afterwards, the generated file will be attached to the build as an additional build artifact (by default as {{group:artifact:version:xml:features}}).
h3. Example
The example below generates one feature that installs bundle {{mvn:org.apache:bundle1:1.0}} in a features XML file called {{target/features.xml}}. It will find bundle in Apache Karaf ${project.version}, the transitive dependencies for this POM and the bundles listed in {{src/main/resources/bundles.properties}}.
{pygmentize:xml}
<project>
<dependencies>
<dependency>
<groupId>org.apache</groupId>
<artifactId>bundle1</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.karaf.tooling</groupId>
<artifactId>features-maven-plugin</artifactId>
<version>${project.version}</version>
<executions>
<execution>
<id>generate</id>
<phase>generate-resources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<bundles>src/main/resources/bundles.properties</bundles>
<kernelVersion>${project.version}</kernelVersion>
<outputFile>target/features.xml</outputFile>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
{pygmentize}
h3. Parameters
|| Name || Type || Description ||
| {{outputFile}} | {{File}} | Name of the features XML file that is being generated \\ Default value: {{${project.build.directory}/classes/feature.xml}} |
| {{attachmentArtifactType}} | {{String}} | The artifact type for attaching the generated file to the project \\ Default value: {{xml}) |
| {{attachmentArtifactClassifier}} | {{String}} | The artifact classifier for attaching the generated file to the project \\ Default value: {{features}} |
| {{kernelVersion}} | {{String}} | The version of Karaf that is used to determine system bundles and default provided features |
| {{bundles}} | {{File}} | A properties file that contains a list of bundles that will be used to generate the features.xml file |