Class IncludeArtifactMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
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.
  • Field Details

    • CFG_CLASSIFIER

      public static final String CFG_CLASSIFIER
      See Also:
    • CFG_START_ORDER

      public static final String CFG_START_ORDER
      See Also:
    • CFG_INCLUDE_DEPENDENCIES_WITH_SCOPE

      public static final String 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