Class IndexMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.eclipse.sisu.mojos.IndexMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

@Mojo(name="index", requiresDependencyResolution=TEST, threadSafe=true) public class IndexMojo extends org.apache.maven.plugin.AbstractMojo
Generates a qualified class index for the current project and its dependencies.
  • Field Details

    • INDEX_FOLDER

      static final String INDEX_FOLDER
      See Also:
    • outputDirectory

      @Parameter(property="outputDirectory", defaultValue="${project.build.outputDirectory}") protected File outputDirectory
      The output directory.
    • includeDependencies

      @Parameter(property="includeDependencies", defaultValue="true") protected boolean includeDependencies
      If we should include project dependencies when indexing.
    • excludeGroupIds

      @Parameter(property="excludeGroupIds", defaultValue="") protected String excludeGroupIds
      Comma separated list of GroupIds to exclude when indexing.
    • includeGroupIds

      @Parameter(property="includeGroupIds", defaultValue="") protected String includeGroupIds
      Comma separated list of GroupIds to include when indexing.
    • excludeArtifactIds

      @Parameter(property="excludeArtifactIds", defaultValue="") protected String excludeArtifactIds
      Comma separated list of ArtifactIds to exclude when indexing.
    • includeArtifactIds

      @Parameter(property="includeArtifactIds", defaultValue="") protected String includeArtifactIds
      Comma separated list of ArtifactIds to include when indexing.
    • excludeClassifiers

      @Parameter(property="excludeClassifiers", defaultValue="") protected String excludeClassifiers
      Comma Separated list of Classifiers to exclude when indexing.
    • includeClassifiers

      @Parameter(property="includeClassifiers", defaultValue="") protected String includeClassifiers
      Comma Separated list of Classifiers to include when indexing.
    • excludeTypes

      @Parameter(property="excludeTypes", defaultValue="") protected String excludeTypes
      Comma Separated list of Types to exclude when indexing.
    • includeTypes

      @Parameter(property="includeTypes", defaultValue="") protected String includeTypes
      Comma Separated list of Types to include when indexing.
    • excludeScope

      @Parameter(property="excludeScope", defaultValue="") protected String excludeScope
      Scope to exclude. Empty string indicates no scopes (default).
    • includeScope

      @Parameter(property="includeScope", defaultValue="") protected String includeScope
      Scope to include. Empty string indicates all scopes (default).
    • excludeTransitive

      @Parameter(property="excludeTransitive", defaultValue="false") protected boolean excludeTransitive
      If we should exclude transitive dependencies when indexing.
    • project

      @Parameter(property="project", required=true, readonly=true) private org.apache.maven.project.MavenProject project
      The Maven project to index.
    • buildContext

      @Component protected org.sonatype.plexus.build.incremental.BuildContext buildContext
      For m2e incremental build support
  • Constructor Details

    • IndexMojo

      public IndexMojo()
    • IndexMojo

      public IndexMojo(org.sonatype.plexus.build.incremental.BuildContext buildContext)
  • Method Details

    • setProject

      public void setProject(org.apache.maven.project.MavenProject project)
    • setOutputDirectory

      public void setOutputDirectory(File outputDirectory)
    • execute

      public void execute()
    • getProjectClassLoader

      private ClassLoader getProjectClassLoader()
    • getIndexPath

      private URL[] getIndexPath()
    • dumpEntries

      private void dumpEntries(String name, List<URL> urls)
    • appendDirectoryToClassPath

      private void appendDirectoryToClassPath(List<URL> urls, File directory)
    • appendFileToClassPath

      private void appendFileToClassPath(List<URL> urls, File file)
      Parameters:
      urls - the list to which to append the URL
      file - must either be a directory or a JAR file
    • cleanList

      private static String cleanList(String list)