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, threadSafe=true) public class RatCheckMojo extends AbstractRatMojoRun Rat to perform a violation check.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringaddLicenseHeadersWhether to add license headers; possible values areforced,true, andfalse(default).private booleanconsoleOutputWhether to output the names of files that have unapproved licenses to the console.private java.lang.StringcopyrightMessageCopyright message to add to license headers.private booleanignoreErrorsWill ignore rat errors and display a log message if any.private intnumUnapprovedLicensesMaximum number of files with unapproved licenses.private java.io.FilereportFileWhere to store the report.private java.lang.StringreportStyleOutput style of the report.-
Fields inherited from class org.apache.rat.mp.AbstractRatMojo
project, skip
-
-
Constructor Summary
Constructors Constructor Description RatCheckMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheck(ClaimStatistic statistics)voidexecute()Invoked by Maven to execute the Mojo.protected ReportConfigurationgetConfiguration()private ClaimStatisticgetRawReport()private java.io.InputStreamgetStyleSheet()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 reportFileWhere to store the report.
-
reportStyle
@Parameter(property="rat.outputStyle", defaultValue="plain") private java.lang.String reportStyleOutput 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 numUnapprovedLicensesMaximum number of files with unapproved licenses.
-
addLicenseHeaders
@Parameter(property="rat.addLicenseHeaders", defaultValue="false") private java.lang.String addLicenseHeadersWhether 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, unlessaddLicenseHeadersis set totrue, orforced.
-
ignoreErrors
@Parameter(property="rat.ignoreErrors", defaultValue="false") private boolean ignoreErrorsWill 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="true") private boolean consoleOutputWhether to output the names of files that have unapproved licenses to the console. Defaults totrueto ease builds in containers where you are unable to access rat.txt easily.- 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.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
getStyleSheet
private java.io.InputStream getStyleSheet() throws org.apache.maven.plugin.MojoExecutionExceptionReturns the XSL stylesheet to be used for formatting the report.- Returns:
- report stylesheet, or
nullfor 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.MojoFailureExceptionInvoked 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:
getConfigurationin classAbstractRatMojo- Throws:
org.apache.maven.plugin.MojoFailureExceptionorg.apache.maven.plugin.MojoExecutionException
-
-