public abstract class AbstractRatMojo
extends org.apache.maven.plugin.AbstractMojo
| Modifier and Type | Field and Description |
|---|---|
private boolean |
addDefaultLicenseMatchers
Whether to add the default list of license matchers.
|
private java.io.File |
basedir
The base directory, in which to search for files.
|
private java.lang.String[] |
excludes
Specifies files, which are excluded in the report.
|
private java.lang.String |
excludesFile
Specifies a file, from which to read excludes.
|
private java.lang.String |
excludesFileCharset
Specifies the include files character set.
|
private boolean |
excludeSubProjects
Whether to exclude subprojects.
|
private java.lang.String[] |
includes
Specifies files, which are included in the report.
|
private java.lang.String |
includesFile
Specifies a file, from which to read includes.
|
private java.lang.String |
includesFileCharset
Specifies the include files character set.
|
private ILicenseFamily[] |
licenseFamilies
Specifies the license families to accept.
|
private LicenseFamilySpecification[] |
licenseFamilyNames
Deprecated.
Use
licenseFamilies instead. |
private HeaderMatcherSpecification[] |
licenseMatchers
Deprecated.
Use
licenses instead. |
private IHeaderMatcher[] |
licenses
Specifies the licenses to accept.
|
private boolean |
parseSCMIgnoresAsExcludes
Whether to parse source code management system (SCM) ignore files and use their contents as excludes.
|
private org.apache.maven.project.MavenProject |
project
Holds the maven-internal project to allow resolution of artifact properties during mojo runs.
|
protected boolean |
skip
Will skip the plugin execution, e.g.
|
private boolean |
useDefaultExcludes
Whether to use the default excludes when scanning for files.
|
private boolean |
useEclipseDefaultExcludes
Whether to use the Eclipse specific default excludes when scanning for
files.
|
private boolean |
useIdeaDefaultExcludes
Whether to use the IDEA specific default excludes when scanning for
files.
|
private boolean |
useMavenDefaultExcludes
Whether to use the Maven specific default excludes when scanning for
files.
|
| Constructor and Description |
|---|
AbstractRatMojo() |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
createReport(java.io.InputStream styleSheet)
Creates the report as a string.
|
protected ClaimStatistic |
createReport(java.io.Writer out,
java.io.InputStream style)
Writes the report to the given stream.
|
protected ReportConfiguration |
getConfiguration() |
private java.util.List<java.lang.String> |
getPatternsFromFile(java.io.File pFile,
java.lang.String pCharset) |
protected org.apache.maven.project.MavenProject |
getProject() |
protected IReportable |
getResources()
Creates an iterator over the files to check.
|
private void |
logAboutIncludedFiles(java.lang.String[] files) |
private void |
logLicenseMatchers(java.util.List<IHeaderMatcher> matchers) |
private java.util.List<ILicenseFamily> |
mergeApprovedLicenseNames() |
private java.util.List<java.lang.String> |
mergeDefaultExclusions() |
private java.util.List<IHeaderMatcher> |
mergeLicenseMatchers()
Returns the set of
header matchers to use. |
private void |
setExcludes(org.codehaus.plexus.util.DirectoryScanner ds) |
private void |
setIncludes(org.codehaus.plexus.util.DirectoryScanner ds) |
private void |
whenDebuggingLogExcludedFiles(org.codehaus.plexus.util.DirectoryScanner ds) |
getLog, getPluginContext, setLog, setPluginContext@Parameter(property="rat.basedir",
defaultValue="${basedir}",
required=true)
private java.io.File basedir
@Deprecated @Parameter private HeaderMatcherSpecification[] licenseMatchers
licenses instead.licenses
instead.@Parameter private IHeaderMatcher[] licenses
addDefaultLicenseMatchers to
false.@Deprecated private LicenseFamilySpecification[] licenseFamilyNames
licenseFamilies instead.@Parameter private ILicenseFamily[] licenseFamilies
@Parameter(property="rat.addDefaultLicenseMatchers",
defaultValue="true")
private boolean addDefaultLicenseMatchers
@Parameter private java.lang.String[] includes
@Parameter(property="rat.includesFile") private java.lang.String includesFile
@Parameter(property="rat.includesFileCharset",
defaultValue="${project.build.sourceEncoding}")
private java.lang.String includesFileCharset
@Parameter private java.lang.String[] excludes
@Parameter(property="rat.excludesFile") private java.lang.String excludesFile
@Parameter(property="rat.excludesFileCharset",
defaultValue="${project.build.sourceEncoding}")
private java.lang.String excludesFileCharset
@Parameter(property="rat.useDefaultExcludes",
defaultValue="true")
private boolean useDefaultExcludes
SourceCodeManagementSystems@Parameter(property="rat.useMavenDefaultExcludes",
defaultValue="true")
private boolean useMavenDefaultExcludes
target directory, the
cobertura.ser file, and so on.@Parameter(property="rat.parseSCMIgnoresAsExcludes",
defaultValue="true")
private boolean parseSCMIgnoresAsExcludes
SourceCodeManagementSystems@Parameter(property="rat.useEclipseDefaultExcludes",
defaultValue="true")
private boolean useEclipseDefaultExcludes
.classpath and
.project files, the .settings directory, and so
on.@Parameter(property="rat.useIdeaDefaultExcludes",
defaultValue="true")
private boolean useIdeaDefaultExcludes
*.iml, *.ipr and
*.iws files and the .idea directory.@Parameter(property="rat.excludeSubprojects",
defaultValue="true")
private boolean excludeSubProjects
@Parameter(property="rat.skip",
defaultValue="false")
protected boolean skip
@Parameter(defaultValue="${project}",
required=true,
readonly=true)
private org.apache.maven.project.MavenProject project
protected org.apache.maven.project.MavenProject getProject()
private java.util.List<IHeaderMatcher> mergeLicenseMatchers() throws org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException
header matchers to use.org.apache.maven.plugin.MojoFailureException - An error in the plugin configuration was detected.org.apache.maven.plugin.MojoExecutionException - An error occurred while calculating the result.private void logLicenseMatchers(java.util.List<IHeaderMatcher> matchers)
protected IReportable getResources() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException - in case of errors. I/O errors result in UndeclaredThrowableExceptions.private void logAboutIncludedFiles(java.lang.String[] files)
private void whenDebuggingLogExcludedFiles(org.codehaus.plexus.util.DirectoryScanner ds)
private void setIncludes(org.codehaus.plexus.util.DirectoryScanner ds)
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprivate java.util.List<java.lang.String> getPatternsFromFile(java.io.File pFile,
java.lang.String pCharset)
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprivate void setExcludes(org.codehaus.plexus.util.DirectoryScanner ds)
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprivate java.util.List<java.lang.String> mergeDefaultExclusions()
throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionExceptionprotected java.lang.String createReport(java.io.InputStream styleSheet)
throws org.apache.maven.plugin.MojoExecutionException,
org.apache.maven.plugin.MojoFailureException
styleSheet - The style sheet to use when formatting the reportorg.apache.maven.plugin.MojoFailureException - An error in the plugin configuration was detected.org.apache.maven.plugin.MojoExecutionException - An error occurred while creating the report.protected ClaimStatistic createReport(java.io.Writer out, java.io.InputStream style) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
out - The target writer, to which the report is being written.style - The stylesheet to use, or null for raw XMLorg.apache.maven.plugin.MojoFailureException - An error in the plugin configuration was detected.org.apache.maven.plugin.MojoExecutionException - Another error occurred while creating the report.protected ReportConfiguration getConfiguration() throws org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureExceptionorg.apache.maven.plugin.MojoExecutionExceptionprivate java.util.List<ILicenseFamily> mergeApprovedLicenseNames() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException