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
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
protected org.apache.maven.shared.transfer.artifact.install.ArtifactInstaller
Fields inherited from class org.apache.sling.feature.maven.mojos.AbstractFeatureMojo
features, jarStartOrder, mavenSession, project, projectHelper
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
-
Constructor Summary
-
Method Summary
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
-
Field Details
-
CFG_CLASSIFIER
- See Also:
-
CFG_START_ORDER
- See Also:
-
CFG_INCLUDE_DEPENDENCIES_WITH_SCOPE
- See Also:
-
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
-