Package org.apache.rat.mp
Class RatCheckMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.apache.rat.mp.AbstractRatMojo
-
- org.apache.rat.mp.RatCheckMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
@Mojo(name="check", defaultPhase=VALIDATE) public class RatCheckMojo extends AbstractRatMojo
Run Rat to perform a violation check.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
addLicenseHeaders
Whether to add license headers; possible values areforced
,true
, andfalse
(default).private boolean
consoleOutput
Whether to output the names of files that have unapproved licenses to the console.private java.lang.String
copyrightMessage
Copyright message to add to license headers.private boolean
ignoreErrors
Will ignore rat errors and display a log message if any.private int
numUnapprovedLicenses
Maximum number of files with unapproved licenses.private java.io.File
reportFile
Where to store the report.private java.lang.String
reportStyle
Output style of the report.-
Fields inherited from class org.apache.rat.mp.AbstractRatMojo
skip
-
-
Constructor Summary
Constructors Constructor Description RatCheckMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
check(ClaimStatistic statistics)
void
execute()
Invoked by Maven to execute the Mojo.protected ReportConfiguration
getConfiguration()
private ClaimStatistic
getRawReport()
private java.io.InputStream
getStyleSheet()
Returns the XSL stylesheet to be used for formatting the report.-
Methods inherited from class org.apache.rat.mp.AbstractRatMojo
createReport, createReport, getProject, getResources
-
-
-
-
Field Detail
-
reportFile
@Parameter(property="rat.outputFile", defaultValue="${project.build.directory}/rat.txt") private java.io.File reportFile
Where to store the report.
-
reportStyle
@Parameter(property="rat.outputStyle", defaultValue="plain") private java.lang.String reportStyle
Output style of the report. Use "plain" (the default) for a plain text report or "xml" for the raw XML report. Alternatively you can give the path of an XSL transformation that will be applied on the raw XML to produce the report written to the output file.
-
numUnapprovedLicenses
@Parameter(property="rat.numUnapprovedLicenses", defaultValue="0") private int numUnapprovedLicenses
Maximum number of files with unapproved licenses.
-
addLicenseHeaders
@Parameter(property="rat.addLicenseHeaders", defaultValue="false") private java.lang.String addLicenseHeaders
Whether to add license headers; possible values areforced
,true
, andfalse
(default).
-
copyrightMessage
@Parameter(property="rat.copyrightMessage") private java.lang.String copyrightMessage
Copyright message to add to license headers. This option is ignored, unlessaddLicenseHeaders
is set totrue
, orforced
.
-
ignoreErrors
@Parameter(property="rat.ignoreErrors", defaultValue="false") private boolean ignoreErrors
Will ignore rat errors and display a log message if any. Its use is NOT RECOMMENDED, but quite convenient on occasion.- Since:
- 0.9
-
consoleOutput
@Parameter(property="rat.consoleOutput", defaultValue="false") private boolean consoleOutput
Whether to output the names of files that have unapproved licenses to the console.- Since:
- 0.12
-
-
Method Detail
-
getRawReport
private ClaimStatistic getRawReport() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
- Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
-
getStyleSheet
private java.io.InputStream getStyleSheet() throws org.apache.maven.plugin.MojoExecutionException
Returns the XSL stylesheet to be used for formatting the report.- Returns:
- report stylesheet, or
null
for raw XML - Throws:
org.apache.maven.plugin.MojoExecutionException
- if the stylesheet can not be found- See Also:
reportStyle
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
Invoked by Maven to execute the Mojo.- Throws:
org.apache.maven.plugin.MojoFailureException
- An error in the plugin configuration was detected.org.apache.maven.plugin.MojoExecutionException
- Another error occurred while executing the plugin.
-
check
protected void check(ClaimStatistic statistics) throws org.apache.maven.plugin.MojoFailureException
- Throws:
org.apache.maven.plugin.MojoFailureException
-
getConfiguration
protected ReportConfiguration getConfiguration() throws org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException
- Overrides:
getConfiguration
in classAbstractRatMojo
- Throws:
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
-
-