h2. Goal {{features:create-kar}}

The {{features:create-kar}} goal creates a kar file from a given features XML.
A kar file is a zip archive shipping all bundles and configuration files containing in features of a features XML, and the features XML itself.
You can deploy a kar file just by copying it in the deploy folder, all resources will be loaded from the kar file.

h3. Example
The example below generates a kar file from a given features XML. The generated kar will be in the target folder with the ${artifactId}-${version}.kar name.
{pygmentize:xml}
<project>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.karaf.tooling</groupId>
        <artifactId>features-maven-plugin</artifactId>
        <version>${project.version}</version>
          <executions>
            <execution>
              <id>create-kar</id>
              <goals>
                <goal>create-kar</goal>
              </goals>
              <configuration>
                <featuresFile>${project.basedir}/src/main/resources/features.xml</featuresFile>
              </configuration>
            </execution>
          </executions>
        </plugin>
    </plugins>
  </build>
</project>
{pygmentize}

h3. Parameters
|| Name || Type || Description ||
| {{featuresFile}} | {{File}} | The features XML used to generate the KAR file \\ Default value: {{${project.build.directory}/feature/feature.xml}} |
| {{resourcesDir} | {{File}} | Location of resources directory for additional content to include in the KAR. Note that it includes everything under classes so as to include maven-remote-resources \\ Default value: ${project.build.directory}/classes}} |
| {{finalName}} | {{String}} | Name of the generated kar \\ Default value: {{${project.build.finalName}}} |
| {{outputDirectory}} | {{File}} | Directory containing the generated archive \\ Default value: {{${project.build.directory}}} |
