Class AbstractLicenseMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
    Direct Known Subclasses:
    LicenseCheckMojo, LicenseFormatMojo, LicenseRemoveMojo

    public abstract class AbstractLicenseMojo
    extends org.apache.maven.plugin.AbstractMojo
    Date: 18-Feb-2008
    Author: Mathieu Carbou (mathieu.carbou@gmail.com)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean aggregate
      Wheter to treat multi-modules projects as only one project (true) or treat multi-module projects separately (false, by default)
      protected File basedir
      The base directory, in which to search for files.
      protected float concurrencyFactor
      Maven license plugin uses concurrency to check license headers.
      protected String encoding
      Set the charcter encoding for files
      protected String[] excludes
      Specifies files, which are excluded in the check.
      protected String header
      The text document containing the license header to check or use for reformatting
      protected String[] headerDefinitions
      Allows the use of external header definitions files.
      protected String[] includes
      Specifies files, which are included in the check.
      protected String[] keywords
      Specify the list of keywords to use to detect a header.
      protected Map<String,​String> mapping
      Set mapping between document mapping and a supported type to use
      protected org.apache.maven.project.MavenProject project  
      protected Map<String,​String> properties
      The properties to use when reading the header, to replace tokens
      protected boolean quiet
      Set this to "true" to cause no output
      protected boolean skip
      Whether to skip the plugin execution
      protected boolean strictCheck
      Set to true if you need a strict check against the headers.
      protected boolean useDefaultExcludes
      Whether to use the default excludes when scanning for files.
      protected boolean useDefaultMapping
      Whether to use the default mapping between fiel extensions and comments to use, or only the one your provide
      protected String[] validHeaders
      Specifies additional header files to use when checking for the presence of a valid header in your sources.
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Field Detail

      • basedir

        protected File basedir
        The base directory, in which to search for files.
      • header

        protected String header
        The text document containing the license header to check or use for reformatting
      • validHeaders

        protected String[] validHeaders
        Specifies additional header files to use when checking for the presence of a valid header in your sources.
        When using format goal, this property will be used to detect all valid headers that don't need formatting.
        When using remove goal, this property will be used to detect all valid headers that also must be removed.
      • headerDefinitions

        protected String[] headerDefinitions
        Allows the use of external header definitions files. These files are properties like.
      • properties

        protected Map<String,​String> properties
        The properties to use when reading the header, to replace tokens
      • includes

        protected String[] includes
        Specifies files, which are included in the check. By default, all files are included.
      • excludes

        protected String[] excludes
        Specifies files, which are excluded in the check. By default, no files are excluded.
      • keywords

        protected String[] keywords
        Specify the list of keywords to use to detect a header. A header must include all keywords to be valid. By default, the word 'copyright' is used. Detection is done case insensitive.
      • useDefaultExcludes

        protected boolean useDefaultExcludes
        Whether to use the default excludes when scanning for files.
      • aggregate

        protected boolean aggregate
        Wheter to treat multi-modules projects as only one project (true) or treat multi-module projects separately (false, by default)
      • mapping

        protected Map<String,​String> mapping
        Set mapping between document mapping and a supported type to use
      • useDefaultMapping

        protected boolean useDefaultMapping
        Whether to use the default mapping between fiel extensions and comments to use, or only the one your provide
      • concurrencyFactor

        protected float concurrencyFactor
        Maven license plugin uses concurrency to check license headers. This factor is used to control the number of threads used to check. The rule is:
        <nThreads> = <number of cores> * concurrencyFactor
        The default is 1.5.
      • skip

        protected boolean skip
        Whether to skip the plugin execution
      • quiet

        protected boolean quiet
        Set this to "true" to cause no output
      • strictCheck

        protected boolean strictCheck
        Set to true if you need a strict check against the headers. By default, the existence of a header is verified by taking the top portion of a file and checking if it contains the headers text, not considering special characters (spaces, tabs, ...)
        We highly recommend to set this option to true. It is by default set to false for backward compatibility
      • encoding

        protected String encoding
        Set the charcter encoding for files
      • project

        protected org.apache.maven.project.MavenProject project
    • Constructor Detail

      • AbstractLicenseMojo

        public AbstractLicenseMojo()
    • Method Detail

      • execute

        protected final void execute​(Callback callback)
                              throws org.apache.maven.plugin.MojoExecutionException,
                                     org.apache.maven.plugin.MojoFailureException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        org.apache.maven.plugin.MojoFailureException
      • mergeProperties

        protected final Map<String,​String> mergeProperties()
      • listSelectedFiles

        protected final String[] listSelectedFiles()
                                            throws org.apache.maven.plugin.MojoFailureException
        Throws:
        org.apache.maven.plugin.MojoFailureException
      • info

        protected final void info​(String format,
                                  Object... params)
      • debug

        protected final void debug​(String format,
                                   Object... params)
      • warn

        protected final void warn​(String format,
                                  Object... params)