Class JandexJarGoal

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

    @Mojo(name="jandex-jar",
          threadSafe=true)
    public class JandexJarGoal
    extends org.apache.maven.plugin.AbstractMojo
    Generate a Jandex index inside a given JAR.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.List<java.lang.String> excludes
      Names or glob patterns of files in the JAR that should not be indexed.
      private java.util.List<java.lang.String> includes
      Names or glob patterns of files in the JAR that should be indexed.
      private java.lang.String indexName
      Path to the index inside the JAR.
      private java.lang.Integer indexVersion
      Persistent index format version to write.
      private java.io.File jar
      The JAR that should be indexed and inside which the index should be stored.
      private boolean skip
      Skip execution if set.
      private boolean useDefaultExcludes  
      private boolean verbose
      Print verbose output (debug output without needing to enable -X for the whole build).
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Constructor Summary

      Constructors 
      Constructor Description
      JandexJarGoal()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private static void copy​(java.io.InputStream in, java.io.OutputStream out)  
      private java.nio.file.Path createTempFile​(java.lang.String suffix)  
      void execute()  
      private Index indexJar()  
      private boolean isVerbose()  
      • 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 Detail

      • jar

        @Parameter(required=true)
        private java.io.File jar
        The JAR that should be indexed and inside which the index should be stored.
      • indexName

        @Parameter(defaultValue="META-INF/jandex.idx")
        private java.lang.String indexName
        Path to the index inside the JAR. Defaults to META-INF/jandex.idx.
      • indexVersion

        @Parameter
        private java.lang.Integer indexVersion
        Persistent index format version to write. Defaults to max supported version.
      • includes

        @Parameter
        private java.util.List<java.lang.String> includes
        Names or glob patterns of files in the JAR that should be indexed.
      • excludes

        @Parameter
        private java.util.List<java.lang.String> excludes
        Names or glob patterns of files in the JAR that should not be indexed. Excludes have priority over includes.
      • useDefaultExcludes

        @Parameter(defaultValue="true")
        private boolean useDefaultExcludes
      • verbose

        @Parameter(defaultValue="false")
        private boolean verbose
        Print verbose output (debug output without needing to enable -X for the whole build).
      • skip

        @Parameter(property="jandex.skip",
                   defaultValue="false")
        private boolean skip
        Skip execution if set.
    • Constructor Detail

      • JandexJarGoal

        public JandexJarGoal()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • indexJar

        private Index indexJar()
                        throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • createTempFile

        private java.nio.file.Path createTempFile​(java.lang.String suffix)
                                           throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • copy

        private static void copy​(java.io.InputStream in,
                                 java.io.OutputStream out)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • isVerbose

        private boolean isVerbose()