Package org.apache.sling.feature.maven.mojos

# Class IncludeArtifactMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.sling.feature.maven.mojos.AbstractFeatureMojo
org.apache.sling.feature.maven.mojos.AbstractIncludingFeatureMojo
org.apache.sling.feature.maven.mojos.IncludeArtifactMojo

All Implemented Interfaces:
  `org.apache.maven.plugin.ContextEnabled`, `org.apache.maven.plugin.Mojo`

@Mojo(name="include-artifact", defaultPhase=PREPARE_PACKAGE, requiresDependencyResolution=COMPILE, threadSafe=true) public class IncludeArtifactMojo extends AbstractIncludingFeatureMojo
This goal creates a Feature Model file that includes the Module Artifact as bundle (or extension) so that the Artifact can be added through a FM into a FM project. The FM file can be found in the 'build directory'/slingfeature-tmp folder. After a FM file is created successfully this file will be installed in the local Maven Repository as 'slingosgifeature' file under the Module's Maven Id location (group, artifact, version). This file can then later be used inside the 'aggregate-features' goal with: `<includeArtifact> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.test.feature</artifactId> <version>1.0.0</version> <classifier>my-test-classifier</classifier> <type>slingosgifeature</type> </includeArtifact>` It also can add dependencies to the FM file if its scope is provided (normally that would be 'compile'). In addition a bundle start order can be set for these included dependency bundles. Finally any FM files inside the Source FM folder are embedded into the FM file. This allows to add extension files like 'repoinit' etc to be added to provide them with the module.

## Nested Class Summary

## Nested classes/interfaces inherited from class org.apache.sling.feature.maven.mojos.AbstractIncludingFeatureMojo

`AbstractIncludingFeatureMojo.FeatureScanner`

## Nested classes/interfaces inherited from class org.apache.sling.feature.maven.mojos.AbstractFeatureMojo

`AbstractFeatureMojo.BaseArtifactProvider, AbstractFeatureMojo.BaseFeatureProvider`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`CFG_CLASSIFIER`
`static final String`
`CFG_INCLUDE_DEPENDENCIES_WITH_SCOPE`
`static final String`
`CFG_START_ORDER`
`protected org.apache.maven.shared.transfer.artifact.install.ArtifactInstaller`
`installer`

### Fields inherited from class org.apache.sling.feature.maven.mojos.AbstractFeatureMojo

`defaultMetadata, features, jarStartOrder, mavenSession, project, projectHelper`

### Fields inherited from interface org.apache.maven.plugin.Mojo

`ROLE`

## Constructor Summary

Constructors
Constructor
Description
`IncludeArtifactMojo()`

## Method Summary

Modifier and Type
Method
Description
`void`
`execute()`

### Methods inherited from class org.apache.sling.feature.maven.mojos.AbstractIncludingFeatureMojo

`getSelectedFeatures, selectAllFeatureFiles, selectAllFeatureFilesAndAggregates`

### Methods inherited from class org.apache.sling.feature.maven.mojos.AbstractFeatureMojo

`checkPreconditions, getTmpDir`

### Methods inherited from class org.apache.maven.plugin.AbstractMojo

`getLog, getPluginContext, setLog, setPluginContext`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### CFG_CLASSIFIER

public static final String CFG_CLASSIFIER

See Also:
  - Constant Field Values

### CFG_START_ORDER

public static final String CFG_START_ORDER

See Also:
  - Constant Field Values

### CFG_INCLUDE_DEPENDENCIES_WITH_SCOPE

public static final String CFG_INCLUDE_DEPENDENCIES_WITH_SCOPE

See Also:
  - Constant Field Values

### installer

@Component protected org.apache.maven.shared.transfer.artifact.install.ArtifactInstaller installer

## Constructor Details

### IncludeArtifactMojo

public IncludeArtifactMojo()

## Method Details

### execute

public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException

Throws:
  `org.apache.maven.plugin.MojoExecutionException`
  `org.apache.maven.plugin.MojoFailureException`