Package org.apache.rat.plugin
Class BaseRatMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.rat.plugin.BaseRatMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
AbstractRatMojo
public abstract class BaseRatMojo
extends org.apache.maven.plugin.AbstractMojo
Generated class to provide Maven support for standard RAT command line options
-
Field Summary
FieldsModifier and TypeFieldDescriptionA map of CLI-based arguments to values.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAdd a value to the key in the argument list.protected voidAdd values to the key in the argument list.args()Gets the list of arguments prepared for the CLI code to parse.static StringcreateName(String longOpt)Creates a Maven name from a long option.Get the list of values for a key.protected voidRemove a key from the argument list.voidsetAddLicense(boolean addLicense)Deprecated.Deprecated for removal since 0.17: Use <editLicense> instead.protected voidSet a key and value into the argument list.voidFile names for system configuration.voidsetConfigs(String[] config)File names for system configuration.voidsetConfigurationNoDefaults(boolean configurationNoDefaults)Ignore default configuration.voidsetCopyright(String copyright)Deprecated.Deprecated for removal since 0.17: Use <editCopyright> instead.voidsetCounterMax(String counterMax)The acceptable maximum number for the specified counter.voidsetCounterMaxs(String[] counterMax)The acceptable maximum number for the specified counter.voidsetCounterMin(String counterMin)The minimum number for the specified counter.voidsetCounterMins(String[] counterMin)The minimum number for the specified counter.voidsetDryRun(boolean dryRun)If set do not update the files but generate the reports.voidsetEditCopyright(String editCopyright)The copyright message to use in the license headers.voidsetEditLicense(boolean editLicense)Add the Apache-2.0 license header to any file with an unknown license that is not in the exclusion list.voidsetEditOverwrite(boolean editOverwrite)Forces any changes in files to be written directly to the source files so that new files are not created.voidsetExclude(String exclude)Deprecated.Deprecated for removal since 0.17: Use <inputExclude> instead.voidsetExcludeFile(String excludeFile)Deprecated.Deprecated for removal since 0.17: Use <inputExcludeFile> instead.voidsetExcludes(String[] exclude)Deprecated.Deprecated for removal since 0.17: Use <inputExclude> instead.voidsetForce(boolean force)Deprecated.Deprecated for removal since 0.17: Use <editOverwrite> instead.voidsetHelpLicenses(boolean helpLicenses)Print information about registered licenses.voidsetInclude(String include)Deprecated.Deprecated for removal since 0.17: Use <inputInclude> instead.voidsetIncludes(String[] include)Deprecated.Deprecated for removal since 0.17: Use <inputInclude> instead.voidsetIncludesFile(String includesFile)Deprecated.Deprecated for removal since 0.17: Use <inputIncludeFile> instead.voidsetInputExclude(String inputExclude)Excludes files matching <Expression>.voidsetInputExcludeFile(String inputExcludeFile)Reads <Expression> entries from a file.voidsetInputExcludeParsedScm(String inputExcludeParsedScm)Parse SCM based exclusion files to exclude specified files and directories.voidsetInputExcludeParsedScms(String[] inputExcludeParsedScm)Parse SCM based exclusion files to exclude specified files and directories.voidsetInputExcludes(String[] inputExclude)Excludes files matching <Expression>.voidsetInputExcludeSize(String inputExcludeSize)Excludes files with sizes less than the number of bytes specified.voidsetInputExcludeStd(String inputExcludeStd)Excludes files defined in standard collections based on commonly occurring groups.voidsetInputExcludeStds(String[] inputExcludeStd)Excludes files defined in standard collections based on commonly occurring groups.voidsetInputInclude(String inputInclude)Includes files matching <Expression>.voidsetInputIncludeFile(String inputIncludeFile)Reads <Expression> entries from a file.voidsetInputIncludes(String[] inputInclude)Includes files matching <Expression>.voidsetInputIncludeStd(String inputIncludeStd)Includes files defined in standard collections based on commonly occurring groups.voidsetInputIncludeStds(String[] inputIncludeStd)Includes files defined in standard collections based on commonly occurring groups.voidsetInputSource(String inputSource)A file containing file names to process.voidsetInputSources(String[] inputSource)A file containing file names to process.voidsetLicenseFamiliesApproved(String licenseFamiliesApproved)A comma separated list of approved license family IDs.voidsetLicenseFamiliesApprovedFile(String licenseFamiliesApprovedFile)Name of file containing comma separated lists of approved family IDs.voidsetLicenseFamiliesDenied(String licenseFamiliesDenied)A comma separated list of denied License family IDs.voidsetLicenseFamiliesDeniedFile(String licenseFamiliesDeniedFile)Name of file containing comma separated lists of denied license IDs.voidsetLicenses(String licenses)Deprecated.Deprecated for removal since 0.17: Use <config> instead.voidsetLicenses(String[] licenses)Deprecated.Deprecated for removal since 0.17: Use <config> instead.voidsetLicensesApproved(String licensesApproved)A comma separated list of approved License IDs.voidsetLicensesApprovedFile(String licensesApprovedFile)Name of file containing comma separated lists of approved License IDs.voidsetLicensesDenied(String licensesDenied)A comma separated list of denied License IDs.voidsetLicensesDeniedFile(String licensesDeniedFile)Name of file containing comma separated lists of the denied license IDs.voidsetListFamilies(String listFamilies)Deprecated.Deprecated for removal since 0.17: Use <outputFamilies> instead.voidsetListLicenses(String listLicenses)Deprecated.Deprecated for removal since 0.17: Use <outputLicenses> instead.voidsetNoDefaultLicenses(boolean noDefaultLicenses)Deprecated.Deprecated for removal since 0.17: Use <configurationNoDefaults> instead.voidDeprecated.Deprecated for removal since 0.17: Use <outputFile> instead.voidsetOutputArchive(String outputArchive)Specifies the level of detail in ARCHIVE file reporting.voidsetOutputFamilies(String outputFamilies)List the defined license families.voidsetOutputFile(String outputFile)Define the output file where to write a report to.voidsetOutputLicenses(String outputLicenses)List the defined licenses.voidsetOutputStandard(String outputStandard)Specifies the level of detail in STANDARD file reporting.voidsetOutputStyle(String outputStyle)XSLT stylesheet to use when creating the report.voidsetScanHiddenDirectories(boolean scanHiddenDirectories)Deprecated.Deprecated for removal since 0.17: Use <inputIncludeStd> with 'HIDDEN_DIR' argument instead.voidsetStylesheet(String stylesheet)Deprecated.Deprecated for removal since 0.17: Use <outputStyle> instead.voidsetXml(boolean xml)Deprecated.Deprecated for removal since 0.17: Use <outputStyle> with the 'xml' argument instead.static StringtoKebabForm(String camelCase)Creates a kebab case name from a camel case name.Returns the list of unsupported args.Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.maven.plugin.Mojo
execute
-
Field Details
-
args
A map of CLI-based arguments to values.
-
-
Constructor Details
-
BaseRatMojo
protected BaseRatMojo()
-
-
Method Details
-
createName
Creates a Maven name from a long option. Will map excluded long options to null.- Parameters:
longOpt- the kebab name.- Returns:
- The CamelCased name for Maven use.
-
toKebabForm
Creates a kebab case name from a camel case name.- Parameters:
camelCase- the camel case name to convert.- Returns:
- the kebab format.
-
unsupportedArgs
Returns the list of unsupported args.- Returns:
- the list of kebab style names that are unsupported by the Maven UI.
-
args
Gets the list of arguments prepared for the CLI code to parse.- Returns:
- the List of arguments for the CLI command line.
-
setArg
Set a key and value into the argument list. Replaces any existing value.- Parameters:
key- the key for the map.value- the value to set.
-
getArg
Get the list of values for a key.- Parameters:
key- the key for the map.- Returns:
- the list of values for the key or
nullif not set.
-
addArg
Add values to the key in the argument list. empty values are ignored. If no non-empty values are present no change is made. If the key does not exist, adds it.- Parameters:
key- the key for the map.value- the array of values to set.
-
addArg
Add a value to the key in the argument list. If the key does not exist, adds it.- Parameters:
key- the key for the map.value- the value to set.
-
removeArg
Remove a key from the argument list.- Parameters:
key- the key to remove from the map.
-
setCopyright
Deprecated.Deprecated for removal since 0.17: Use <editCopyright> instead.The copyright message to use in the license headers. Argument should be a Arg. (See Argument Types for clarification)- Parameters:
copyright- Copyright message to use in the license headers.
-
setEditCopyright
The copyright message to use in the license headers. Usually in the form of "Copyright 2008 Foo". Only valid with <editLicense> Argument should be a Arg. (See Argument Types for clarification)- Parameters:
editCopyright- Copyright message to use in the license headers.
-
setForce
Deprecated.Deprecated for removal since 0.17: Use <editOverwrite> instead.Forces any changes in files to be written directly to the source files so that new files are not created.- Parameters:
force- The state
-
setEditOverwrite
@Parameter(property="rat.EditOverwrite") public void setEditOverwrite(boolean editOverwrite)Forces any changes in files to be written directly to the source files so that new files are not created. Only valid with <editLicense>.- Parameters:
editOverwrite- The state
-
setAddLicense
Deprecated.Deprecated for removal since 0.17: Use <editLicense> instead.Add the Apache-2.0 license header to any file with an unknown license that is not in the exclusion list.- Parameters:
addLicense- The state
-
setEditLicense
@Parameter(property="rat.EditLicense") public void setEditLicense(boolean editLicense)Add the Apache-2.0 license header to any file with an unknown license that is not in the exclusion list. By default new files will be created with the license header, to force the modification of existing files use the <editOverwrite> option.- Parameters:
editLicense- The state
-
setConfigs
File names for system configuration. Arguments should be File. (See Argument Types for clarification)- Parameters:
config- Names for system configuration.
-
setConfig
File names for system configuration. Arguments should be File. (See Argument Types for clarification)- Parameters:
config- Names for system configuration.
-
setLicenses
Deprecated.Deprecated for removal since 0.17: Use <config> instead.File names for system configuration. Arguments should be File. (See Argument Types for clarification)- Parameters:
licenses- Names for system configuration.
-
setLicenses
Deprecated.Deprecated for removal since 0.17: Use <config> instead.File names for system configuration. Arguments should be File. (See Argument Types for clarification)- Parameters:
licenses- Names for system configuration.
-
setConfigurationNoDefaults
@Parameter(property="rat.ConfigurationNoDefaults") public void setConfigurationNoDefaults(boolean configurationNoDefaults)Ignore default configuration.- Parameters:
configurationNoDefaults- The state
-
setNoDefaultLicenses
@Deprecated @Parameter(property="rat.NoDefaultLicenses") public void setNoDefaultLicenses(boolean noDefaultLicenses)Deprecated.Deprecated for removal since 0.17: Use <configurationNoDefaults> instead.Ignore default configuration.- Parameters:
noDefaultLicenses- The state
-
setLicensesApproved
@Parameter(property="rat.LicensesApproved") public void setLicensesApproved(String licensesApproved)A comma separated list of approved License IDs. These licenses will be added to the list of approved licenses. Argument should be a LicenseID. (See Argument Types for clarification)- Parameters:
licensesApproved- Comma separated list of approved License IDs.
-
setLicensesApprovedFile
@Parameter(property="rat.LicensesApprovedFile") public void setLicensesApprovedFile(String licensesApprovedFile)Name of file containing comma separated lists of approved License IDs. Argument should be a File. (See Argument Types for clarification)- Parameters:
licensesApprovedFile- Of file containing comma separated lists of approved License IDs.
-
setLicenseFamiliesApproved
@Parameter(property="rat.LicenseFamiliesApproved") public void setLicenseFamiliesApproved(String licenseFamiliesApproved)A comma separated list of approved license family IDs. These license families will be added to the list of approved license families. Argument should be a FamilyID. (See Argument Types for clarification)- Parameters:
licenseFamiliesApproved- Comma separated list of approved license family IDs.
-
setLicenseFamiliesApprovedFile
@Parameter(property="rat.LicenseFamiliesApprovedFile") public void setLicenseFamiliesApprovedFile(String licenseFamiliesApprovedFile)Name of file containing comma separated lists of approved family IDs. Argument should be a File. (See Argument Types for clarification)- Parameters:
licenseFamiliesApprovedFile- Of file containing comma separated lists of approved family IDs.
-
setLicensesDenied
A comma separated list of denied License IDs. These licenses will be removed from the list of approved licenses. Once licenses are removed they can not be added back. Argument should be a LicenseID. (See Argument Types for clarification)- Parameters:
licensesDenied- Comma separated list of denied License IDs.
-
setLicensesDeniedFile
@Parameter(property="rat.LicensesDeniedFile") public void setLicensesDeniedFile(String licensesDeniedFile)Name of file containing comma separated lists of the denied license IDs. These licenses will be removed from the list of approved licenses. Once licenses are removed they can not be added back. Argument should be a File. (See Argument Types for clarification)- Parameters:
licensesDeniedFile- Of file containing comma separated lists of the denied license IDs.
-
setLicenseFamiliesDenied
@Parameter(property="rat.LicenseFamiliesDenied") public void setLicenseFamiliesDenied(String licenseFamiliesDenied)A comma separated list of denied License family IDs. These license families will be removed from the list of approved licenses. Once license families are removed they can not be added back. Argument should be a FamilyID. (See Argument Types for clarification)- Parameters:
licenseFamiliesDenied- Comma separated list of denied License family IDs.
-
setLicenseFamiliesDeniedFile
@Parameter(property="rat.LicenseFamiliesDeniedFile") public void setLicenseFamiliesDeniedFile(String licenseFamiliesDeniedFile)Name of file containing comma separated lists of denied license IDs. These license families will be removed from the list of approved licenses. Once license families are removed they can not be added back. Argument should be a File. (See Argument Types for clarification)- Parameters:
licenseFamiliesDeniedFile- Of file containing comma separated lists of denied license IDs.
-
setCounterMaxs
The acceptable maximum number for the specified counter. A value of '-1' specifies an unlimited number. Arguments should be CounterPattern. (See Argument Types for clarification)- Parameters:
counterMax- Acceptable maximum number for the specified counter.
-
setCounterMax
The acceptable maximum number for the specified counter. A value of '-1' specifies an unlimited number. Arguments should be CounterPattern. (See Argument Types for clarification)- Parameters:
counterMax- Acceptable maximum number for the specified counter.
-
setCounterMins
The minimum number for the specified counter. Arguments should be CounterPattern. (See Argument Types for clarification)- Parameters:
counterMin- Minimum number for the specified counter.
-
setCounterMin
The minimum number for the specified counter. Arguments should be CounterPattern. (See Argument Types for clarification)- Parameters:
counterMin- Minimum number for the specified counter.
-
setInputSources
A file containing file names to process. File names must use linux directory separator ('/') or none at all. File names that do not start with '/' are relative to the directory where the argument is located. Arguments should be File. (See Argument Types for clarification)- Parameters:
inputSource- File containing file names to process.
-
setInputSource
A file containing file names to process. File names must use linux directory separator ('/') or none at all. File names that do not start with '/' are relative to the directory where the argument is located. Arguments should be File. (See Argument Types for clarification)- Parameters:
inputSource- File containing file names to process.
-
setExcludes
Deprecated.Deprecated for removal since 0.17: Use <inputExclude> instead.Excludes files matching <Expression>. Arguments should be Expression. (See Argument Types for clarification)- Parameters:
exclude- Files matching <Expression>.
-
setExclude
Deprecated.Deprecated for removal since 0.17: Use <inputExclude> instead.Excludes files matching <Expression>. Arguments should be Expression. (See Argument Types for clarification)- Parameters:
exclude- Files matching <Expression>.
-
setInputExcludes
Excludes files matching <Expression>. Arguments should be Expression. (See Argument Types for clarification)- Parameters:
inputExclude- Files matching <Expression>.
-
setInputExclude
Excludes files matching <Expression>. Arguments should be Expression. (See Argument Types for clarification)- Parameters:
inputExclude- Files matching <Expression>.
-
setExcludeFile
Deprecated.Deprecated for removal since 0.17: Use <inputExcludeFile> instead.Reads <Expression> entries from a file. Entries will be excluded from processing. Argument should be a File. (See Argument Types for clarification)- Parameters:
excludeFile- <Expression> entries from a file.
-
setInputExcludeFile
@Parameter(property="rat.InputExcludeFile") public void setInputExcludeFile(String inputExcludeFile)Reads <Expression> entries from a file. Entries will be excluded from processing. Argument should be a File. (See Argument Types for clarification)- Parameters:
inputExcludeFile- <Expression> entries from a file.
-
setInputExcludeStds
Excludes files defined in standard collections based on commonly occurring groups. Excludes any path matcher actions but DOES NOT exclude any file processor actions. Arguments should be StandardCollection. (See Argument Types for clarification)- Parameters:
inputExcludeStd- Files defined in standard collections based on commonly occurring groups.
-
setInputExcludeStd
Excludes files defined in standard collections based on commonly occurring groups. Excludes any path matcher actions but DOES NOT exclude any file processor actions. Arguments should be StandardCollection. (See Argument Types for clarification)- Parameters:
inputExcludeStd- Files defined in standard collections based on commonly occurring groups.
-
setInputExcludeSize
@Parameter(property="rat.InputExcludeSize") public void setInputExcludeSize(String inputExcludeSize)Excludes files with sizes less than the number of bytes specified. Argument should be a Integer. (See Argument Types for clarification)- Parameters:
inputExcludeSize- Files with sizes less than the number of bytes specified.
-
setInputIncludes
Includes files matching <Expression>. Will override excluded files. Arguments should be Expression. (See Argument Types for clarification)- Parameters:
inputInclude- Files matching <Expression>.
-
setInputInclude
Includes files matching <Expression>. Will override excluded files. Arguments should be Expression. (See Argument Types for clarification)- Parameters:
inputInclude- Files matching <Expression>.
-
setIncludes
Deprecated.Deprecated for removal since 0.17: Use <inputInclude> instead.Includes files matching <Expression>. Will override excluded files. Arguments should be Expression. (See Argument Types for clarification)- Parameters:
include- Files matching <Expression>.
-
setInclude
Deprecated.Deprecated for removal since 0.17: Use <inputInclude> instead.Includes files matching <Expression>. Will override excluded files. Arguments should be Expression. (See Argument Types for clarification)- Parameters:
include- Files matching <Expression>.
-
setInputIncludeFile
@Parameter(property="rat.InputIncludeFile") public void setInputIncludeFile(String inputIncludeFile)Reads <Expression> entries from a file. Entries will override excluded files. Argument should be a File. (See Argument Types for clarification)- Parameters:
inputIncludeFile- <Expression> entries from a file.
-
setIncludesFile
@Deprecated @Parameter(property="rat.IncludesFile") public void setIncludesFile(String includesFile)Deprecated.Deprecated for removal since 0.17: Use <inputIncludeFile> instead.Reads <Expression> entries from a file. Entries will be excluded from processing. Argument should be a File. (See Argument Types for clarification)- Parameters:
includesFile- <Expression> entries from a file.
-
setInputIncludeStds
Includes files defined in standard collections based on commonly occurring groups. Includes any path matcher actions but DOES NOT include any file processor actions. Arguments should be StandardCollection. (See Argument Types for clarification)- Parameters:
inputIncludeStd- Files defined in standard collections based on commonly occurring groups.
-
setInputIncludeStd
Includes files defined in standard collections based on commonly occurring groups. Includes any path matcher actions but DOES NOT include any file processor actions. Arguments should be StandardCollection. (See Argument Types for clarification)- Parameters:
inputIncludeStd- Files defined in standard collections based on commonly occurring groups.
-
setScanHiddenDirectories
@Deprecated @Parameter(property="rat.ScanHiddenDirectories") public void setScanHiddenDirectories(boolean scanHiddenDirectories)Deprecated.Deprecated for removal since 0.17: Use <inputIncludeStd> with 'HIDDEN_DIR' argument instead.Scans hidden directories.- Parameters:
scanHiddenDirectories- The state
-
setInputExcludeParsedScms
Parse SCM based exclusion files to exclude specified files and directories. This action can apply to any standard collection that implements a file processor. Arguments should be StandardCollection. (See Argument Types for clarification)- Parameters:
inputExcludeParsedScm- SCM based exclusion files to exclude specified files and directories.
-
setInputExcludeParsedScm
Parse SCM based exclusion files to exclude specified files and directories. This action can apply to any standard collection that implements a file processor. Arguments should be StandardCollection. (See Argument Types for clarification)- Parameters:
inputExcludeParsedScm- SCM based exclusion files to exclude specified files and directories.
-
setOutputStyle
XSLT stylesheet to use when creating the report. Either an external xsl file may be specified or one of the internal named sheets. Argument should be a StyleSheet. (See Argument Types for clarification)- Parameters:
outputStyle- Stylesheet to use when creating the report.
-
setStylesheet
Deprecated.Deprecated for removal since 0.17: Use <outputStyle> instead.XSLT stylesheet to use when creating the report. Argument should be a StyleSheet. (See Argument Types for clarification)- Parameters:
stylesheet- Stylesheet to use when creating the report.
-
setXml
Deprecated.Deprecated for removal since 0.17: Use <outputStyle> with the 'xml' argument instead.forces XML output rather than the textual report.- Parameters:
xml- The state
-
setOutputLicenses
@Parameter(property="rat.OutputLicenses", defaultValue="NONE") public void setOutputLicenses(String outputLicenses)List the defined licenses. Argument should be a LicenseFilter. (See Argument Types for clarification)- Parameters:
outputLicenses- The defined licenses.
-
setListLicenses
@Deprecated @Parameter(property="rat.ListLicenses") public void setListLicenses(String listLicenses)Deprecated.Deprecated for removal since 0.17: Use <outputLicenses> instead.List the defined licenses. Argument should be a LicenseFilter. (See Argument Types for clarification)- Parameters:
listLicenses- The defined licenses.
-
setOutputFamilies
@Parameter(property="rat.OutputFamilies", defaultValue="NONE") public void setOutputFamilies(String outputFamilies)List the defined license families. Argument should be a LicenseFilter. (See Argument Types for clarification)- Parameters:
outputFamilies- The defined license families.
-
setListFamilies
@Deprecated @Parameter(property="rat.ListFamilies") public void setListFamilies(String listFamilies)Deprecated.Deprecated for removal since 0.17: Use <outputFamilies> instead.List the defined license families. Argument should be a LicenseFilter. (See Argument Types for clarification)- Parameters:
listFamilies- The defined license families.
-
setDryRun
@Parameter(property="rat.DryRun") public void setDryRun(boolean dryRun)If set do not update the files but generate the reports.- Parameters:
dryRun- The state
-
setOut
Deprecated.Deprecated for removal since 0.17: Use <outputFile> instead.Define the output file where to write a report to. Argument should be a File. (See Argument Types for clarification)- Parameters:
out- The output file where to write a report to.
-
setOutputFile
@Parameter(property="rat.OutputFile", defaultValue="${project.build.directory}/rat.txt") public void setOutputFile(String outputFile)Define the output file where to write a report to. Argument should be a File. (See Argument Types for clarification)- Parameters:
outputFile- The output file where to write a report to.
-
setOutputArchive
@Parameter(property="rat.OutputArchive", defaultValue="NOTIFICATION") public void setOutputArchive(String outputArchive)Specifies the level of detail in ARCHIVE file reporting. Argument should be a ProcessingType. (See Argument Types for clarification)- Parameters:
outputArchive- The level of detail in ARCHIVE file reporting.
-
setOutputStandard
@Parameter(property="rat.OutputStandard", defaultValue="ABSENCE") public void setOutputStandard(String outputStandard)Specifies the level of detail in STANDARD file reporting. Argument should be a ProcessingType. (See Argument Types for clarification)- Parameters:
outputStandard- The level of detail in STANDARD file reporting.
-
setHelpLicenses
@Parameter(property="rat.HelpLicenses") public void setHelpLicenses(boolean helpLicenses)Print information about registered licenses.- Parameters:
helpLicenses- The state
-