public abstract class AbstractClirrMojo
extends org.apache.maven.plugin.AbstractMojo
Modifier and Type | Field and Description |
---|---|
protected File |
classesDirectory
The classes of this project to compare the last release against.
|
protected ArtifactSpecification[] |
comparisonArtifacts
List of artifacts to compare the current code against.
|
protected String |
comparisonVersion
Version to compare the current code against.
|
protected String[] |
excludes
A list of classes to exclude.
|
protected org.apache.maven.artifact.factory.ArtifactFactory |
factory |
protected Difference[] |
ignored
A list of differences reported by Clirr that should be ignored when producing the final report.
|
protected File |
ignoredDifferencesFile
A path to the XML file containing the ignored differences definitions.
|
protected String[] |
includes
A list of classes to include.
|
protected org.apache.maven.artifact.repository.ArtifactRepository |
localRepository |
protected boolean |
logResults
Whether to log the results to the console or not.
|
protected String |
minSeverity
Show only messages of this severity or higher.
|
protected org.apache.maven.project.MavenProject |
project |
protected org.apache.maven.artifact.resolver.ArtifactResolver |
resolver |
protected boolean |
skip
Flag to easily skip execution.
|
protected File |
textOutputFile
A text output file to render to.
|
protected File |
xmlOutputFile
An XML file to render to.
|
Constructor and Description |
---|
AbstractClirrMojo() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
canGenerate() |
protected static net.sf.clirr.core.Severity |
convertSeverity(String minSeverity) |
protected static ClassLoader |
createClassLoader(Collection artifacts,
Set previousArtifacts)
Create a ClassLoader, which includes the artifacts in
artifacts ,
but excludes the artifacts in previousArtifacts . |
static net.sf.clirr.core.spi.JavaType[] |
createClassSet(File classes,
ClassLoader thirdPartyClasses,
net.sf.clirr.core.ClassFilter classFilter) |
protected abstract void |
doExecute() |
void |
execute() |
ClirrDiffListener |
executeClirr() |
protected ClirrDiffListener |
executeClirr(net.sf.clirr.core.Severity minSeverity) |
protected List<Difference> |
getAllIgnored() |
protected List |
getTransitiveDependencies(Set previousArtifacts) |
protected Set |
resolveArtifacts(ArtifactSpecification[] artifacts) |
protected boolean skip
protected org.apache.maven.project.MavenProject project
protected org.apache.maven.artifact.resolver.ArtifactResolver resolver
protected org.apache.maven.artifact.factory.ArtifactFactory factory
protected org.apache.maven.artifact.repository.ArtifactRepository localRepository
protected File classesDirectory
protected String comparisonVersion
protected ArtifactSpecification[] comparisonArtifacts
comparisonVersion
, if present.
Each comparisonArtifact
is made of a groupId
, an artifactId
and
a version
number. Optionally it may have a classifier
(default null) and a type
(default "jar").protected String minSeverity
info
, warning
and error
.protected File textOutputFile
protected File xmlOutputFile
protected String[] includes
org/codehaus/mojo/**
.protected String[] excludes
org/codehaus/mojo/**
.protected Difference[] ignored
protected File ignoredDifferencesFile
<differences> ... <difference> <className>com.thoughtworks.qdox.parser.impl.Parser</className> <field>*</field> </difference> ... </differences>
protected boolean logResults
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
protected abstract void doExecute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
public ClirrDiffListener executeClirr() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
protected ClirrDiffListener executeClirr(net.sf.clirr.core.Severity minSeverity) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
protected List<Difference> getAllIgnored()
protected List getTransitiveDependencies(Set previousArtifacts) throws org.apache.maven.project.ProjectBuildingException, org.apache.maven.project.artifact.InvalidDependencyVersionException, org.apache.maven.artifact.resolver.ArtifactResolutionException, org.apache.maven.artifact.resolver.ArtifactNotFoundException
org.apache.maven.project.ProjectBuildingException
org.apache.maven.project.artifact.InvalidDependencyVersionException
org.apache.maven.artifact.resolver.ArtifactResolutionException
org.apache.maven.artifact.resolver.ArtifactNotFoundException
protected Set resolveArtifacts(ArtifactSpecification[] artifacts) throws org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
public static net.sf.clirr.core.spi.JavaType[] createClassSet(File classes, ClassLoader thirdPartyClasses, net.sf.clirr.core.ClassFilter classFilter) throws MalformedURLException
MalformedURLException
protected static ClassLoader createClassLoader(Collection artifacts, Set previousArtifacts) throws MalformedURLException
artifacts
,
but excludes the artifacts in previousArtifacts
. The intention is,
that we let BCEL inspect the artifacts in the latter set, using a
ClassLoader
, which contains the dependencies. However, the
ClassLoader
must not contain the jar files, which are being inspected.artifacts
- The artifacts, from which to build a ClassLoader
.previousArtifacts
- The artifacts being inspected, or null, if te
returned ClassLoader
should contain all the elements of
artifacts
.ClassLoader
which may be used to inspect the classes in
previousArtifacts.MalformedURLException
- Failed to convert a file to an URL.protected static net.sf.clirr.core.Severity convertSeverity(String minSeverity)
protected boolean canGenerate() throws org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException
org.apache.maven.plugin.MojoExecutionException
Copyright © 2006–2016 MojoHaus. All rights reserved.