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 void
Add a value to the key in the argument list.protected void
Add values to the key in the argument list.args()
Gets the list of arguments prepared for the CLI code to parse.static String
createName
(String longOpt) Creates a Maven name from a long option.Get the list of values for a key.protected void
Remove a key from the argument list.void
setAddLicense
(boolean addLicense) Deprecated.Deprecated for removal since 0.17: Use <editLicense> instead.protected void
Set a key and value into the argument list.void
File names for system configuration.void
setConfigs
(String[] config) File names for system configuration.void
setConfigurationNoDefaults
(boolean configurationNoDefaults) Ignore default configuration.void
setCopyright
(String copyright) Deprecated.Deprecated for removal since 0.17: Use <editCopyright> instead.void
setCounterMax
(String counterMax) The acceptable maximum number for the specified counter.void
setCounterMaxs
(String[] counterMax) The acceptable maximum number for the specified counter.void
setCounterMin
(String counterMin) The minimum number for the specified counter.void
setCounterMins
(String[] counterMin) The minimum number for the specified counter.void
setDryRun
(boolean dryRun) If set do not update the files but generate the reports.void
setEditCopyright
(String editCopyright) The copyright message to use in the license headers.void
setEditLicense
(boolean editLicense) Add the default license header to any file with an unknown license that is not in the exclusion list.void
setEditOverwrite
(boolean editOverwrite) Forces any changes in files to be written directly to the source files (i.e. new files are not created).void
setExclude
(String exclude) Deprecated.Deprecated for removal since 0.17: Use <inputExclude> instead.void
setExcludeFile
(String excludeFile) Deprecated.Deprecated for removal since 0.17: Use <inputExcludeFile> instead.void
setExcludes
(String[] exclude) Deprecated.Deprecated for removal since 0.17: Use <inputExclude> instead.void
setForce
(boolean force) Deprecated.Deprecated for removal since 0.17: Use <editOverwrite> instead.void
setHelpLicenses
(boolean helpLicenses) Print information about registered licenses.void
setInclude
(String include) Deprecated.Deprecated for removal since 0.17: Use <inputInclude> instead.void
setIncludes
(String[] include) Deprecated.Deprecated for removal since 0.17: Use <inputInclude> instead.void
setIncludesFile
(String includesFile) Deprecated.Deprecated for removal since 0.17: Use <inputIncludeFile> instead.void
setInputExclude
(String inputExclude) Excludes files matching <Expression>.void
setInputExcludeFile
(String inputExcludeFile) Reads <Expression> entries from a file.void
setInputExcludeParsedScm
(String inputExcludeParsedScm) Parse SCM based exclusion files to exclude specified files and directories.void
setInputExcludeParsedScms
(String[] inputExcludeParsedScm) Parse SCM based exclusion files to exclude specified files and directories.void
setInputExcludes
(String[] inputExclude) Excludes files matching <Expression>.void
setInputExcludeSize
(String inputExcludeSize) Excludes files with sizes less than the given argument.void
setInputExcludeStd
(String inputExcludeStd) Excludes files defined in standard collections based on commonly occurring groups.void
setInputExcludeStds
(String[] inputExcludeStd) Excludes files defined in standard collections based on commonly occurring groups.void
setInputInclude
(String inputInclude) Includes files matching <Expression>.void
setInputIncludeFile
(String inputIncludeFile) Reads <Expression> entries from a file.void
setInputIncludes
(String[] inputInclude) Includes files matching <Expression>.void
setInputIncludeStd
(String inputIncludeStd) Includes files defined in standard collections based on commonly occurring groups.void
setInputIncludeStds
(String[] inputIncludeStd) Includes files defined in standard collections based on commonly occurring groups.void
setInputSource
(String inputSource) A file containing file names to process.void
setInputSources
(String[] inputSource) A file containing file names to process.void
setLicenseFamiliesApproved
(String licenseFamiliesApproved) The approved License Family IDs.void
setLicenseFamiliesApproved
(String[] licenseFamiliesApproved) The approved License Family IDs.void
setLicenseFamiliesApprovedFile
(String licenseFamiliesApprovedFile) Name of file containing the approved family IDs.void
setLicenseFamiliesDenied
(String licenseFamiliesDenied) The denied License family IDs.void
setLicenseFamiliesDenied
(String[] licenseFamiliesDenied) The denied License family IDs.void
setLicenseFamiliesDeniedFile
(String licenseFamiliesDeniedFile) Name of file containing the denied license IDs.void
setLicenses
(String licenses) Deprecated.Deprecated for removal since 0.17: Use <config> instead.void
setLicenses
(String[] licenses) Deprecated.Deprecated for removal since 0.17: Use <config> instead.void
setLicensesApproved
(String licensesApproved) The approved License IDs.void
setLicensesApproved
(String[] licensesApproved) The approved License IDs.void
setLicensesApprovedFile
(String licensesApprovedFile) Name of file containing the approved License IDs.void
setLicensesDenied
(String licensesDenied) The denied License IDs.void
setLicensesDenied
(String[] licensesDenied) The denied License IDs.void
setLicensesDeniedFile
(String licensesDeniedFile) Name of file containing the denied license IDs.void
setListFamilies
(String listFamilies) Deprecated.Deprecated for removal since 0.17: Use <outputFamilies> instead.void
setListLicenses
(String listLicenses) Deprecated.Deprecated for removal since 0.17: Use <outputLicenses> instead.void
setNoDefaultLicenses
(boolean noDefaultLicenses) Deprecated.Deprecated for removal since 0.17: Use <configurationNoDefaults> instead.void
Deprecated.Deprecated for removal since 0.17: Use <outputFile> instead.void
setOutputArchive
(String outputArchive) Specifies the level of detail in ARCHIVE file reporting.void
setOutputFamilies
(String outputFamilies) List the defined license families.void
setOutputFile
(String outputFile) Define the output file where to write a report to.void
setOutputLicenses
(String outputLicenses) List the defined licenses.void
setOutputStandard
(String outputStandard) Specifies the level of detail in STANDARD file reporting.void
setOutputStyle
(String outputStyle) XSLT stylesheet to use when creating the report.void
setScanHiddenDirectories
(boolean scanHiddenDirectories) Deprecated.Deprecated for removal since 0.17: Use <inputIncludeStd> with 'HIDDEN_DIR' argument instead.void
setStylesheet
(String stylesheet) Deprecated.Deprecated for removal since 0.17: Use <outputStyle> instead.void
setXml
(boolean xml) Deprecated.Deprecated for removal since 0.17: Use <outputStyle> with the 'xml' argument instead.static String
toKebabForm
(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, setPluginContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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
null
if not set.
-
addArg
Add values 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.
-
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.- 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>- 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 (i.e. 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 (i.e. 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 default 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 default 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
The approved License IDs. These licenses will be added to the list of approved licenses. Arguments should be LicenseID. (See Argument Types for clarification)- Parameters:
licensesApproved
- approved License IDs.
-
setLicensesApproved
The approved License IDs. These licenses will be added to the list of approved licenses. Arguments should be LicenseID. (See Argument Types for clarification)- Parameters:
licensesApproved
- approved License IDs.
-
setLicensesApprovedFile
@Parameter(property="rat.LicensesApprovedFile") public void setLicensesApprovedFile(String licensesApprovedFile) Name of file containing the approved License IDs. Argument should be a File. (See Argument Types for clarification)- Parameters:
licensesApprovedFile
- of file containing the approved License IDs.
-
setLicenseFamiliesApproved
The approved License Family IDs. These licenses families will be added to the list of approved licenses families. Arguments should be FamilyID. (See Argument Types for clarification)- Parameters:
licenseFamiliesApproved
- approved License Family IDs.
-
setLicenseFamiliesApproved
The approved License Family IDs. These licenses families will be added to the list of approved licenses families. Arguments should be FamilyID. (See Argument Types for clarification)- Parameters:
licenseFamiliesApproved
- approved License Family IDs.
-
setLicenseFamiliesApprovedFile
@Parameter(property="rat.LicenseFamiliesApprovedFile") public void setLicenseFamiliesApprovedFile(String licenseFamiliesApprovedFile) Name of file containing the approved family IDs. Argument should be a File. (See Argument Types for clarification)- Parameters:
licenseFamiliesApprovedFile
- of file containing the approved family IDs.
-
setLicensesDenied
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. Arguments should be LicenseID. (See Argument Types for clarification)- Parameters:
licensesDenied
- denied License IDs.
-
setLicensesDenied
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. Arguments should be LicenseID. (See Argument Types for clarification)- Parameters:
licensesDenied
- denied License IDs.
-
setLicensesDeniedFile
@Parameter(property="rat.LicensesDeniedFile") public void setLicensesDeniedFile(String licensesDeniedFile) Name of file containing the denied license IDs. Argument should be a File. (See Argument Types for clarification)- Parameters:
licensesDeniedFile
- of file containing the denied license IDs.
-
setLicenseFamiliesDenied
The denied License family IDs. These license families will be removed from the list of approved licenses. Arguments should be FamilyID. (See Argument Types for clarification)- Parameters:
licenseFamiliesDenied
- denied License family IDs.
-
setLicenseFamiliesDenied
The denied License family IDs. These license families will be removed from the list of approved licenses. Arguments should be FamilyID. (See Argument Types for clarification)- Parameters:
licenseFamiliesDenied
- denied License family IDs.
-
setLicenseFamiliesDeniedFile
@Parameter(property="rat.LicenseFamiliesDeniedFile") public void setLicenseFamiliesDeniedFile(String licenseFamiliesDeniedFile) Name of file containing the denied license IDs. Argument should be a File. (See Argument Types for clarification)- Parameters:
licenseFamiliesDeniedFile
- of file containing the 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. 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. 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 given argument. Argument should be a Integer. (See Argument Types for clarification)- Parameters:
inputExcludeSize
- files with sizes less than the given argument.
-
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. Will override excluded files. 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. Will override excluded files. 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. 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. 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
-