Class AbstractClirrMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.codehaus.mojo.clirr.AbstractClirrMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
AbstractClirrCheckMojo, ClirrArbitraryCheckMojo, ClirrReport
public abstract class AbstractClirrMojo
extends org.apache.maven.plugin.AbstractMojo
Base parameters for Clirr check and report.
- Author:
- Brett Porter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FileThe classes of this project to compare the last release against.protected ArtifactSpecification[]List of artifacts to compare the current code against.protected StringVersion to compare the current code against.protected String[]A list of classes to exclude.protected org.apache.maven.artifact.factory.ArtifactFactoryprotected Difference[]A list of differences reported by Clirr that should be ignored when producing the final report.protected FileA path to the XML file containing the ignored differences definitions.protected String[]A list of classes to include.protected org.apache.maven.artifact.repository.ArtifactRepositoryprotected booleanWhether to log the results to the console or not.protected StringShow only messages of this severity or higher.protected org.apache.maven.project.MavenProjectprotected org.apache.maven.artifact.resolver.ArtifactResolverprotected booleanFlag to easily skip execution.protected FileA text output file to render to.protected FileAn XML file to render to.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprotected static net.sf.clirr.core.SeverityconvertSeverity(String minSeverity) protected static ClassLoadercreateClassLoader(Collection artifacts, Set previousArtifacts) Create a ClassLoader, which includes the artifacts inartifacts, but excludes the artifacts inpreviousArtifacts.static net.sf.clirr.core.spi.JavaType[]createClassSet(File classes, ClassLoader thirdPartyClasses, net.sf.clirr.core.ClassFilter classFilter) protected abstract voidvoidexecute()protected ClirrDiffListenerexecuteClirr(net.sf.clirr.core.Severity minSeverity) protected List<Difference> protected ListgetTransitiveDependencies(Set previousArtifacts) protected SetresolveArtifacts(ArtifactSpecification[] artifacts) Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
skip
protected boolean skipFlag to easily skip execution. -
project
protected org.apache.maven.project.MavenProject project -
resolver
protected org.apache.maven.artifact.resolver.ArtifactResolver resolver -
factory
protected org.apache.maven.artifact.factory.ArtifactFactory factory -
localRepository
protected org.apache.maven.artifact.repository.ArtifactRepository localRepository -
classesDirectory
The classes of this project to compare the last release against. -
comparisonVersion
Version to compare the current code against. -
comparisonArtifacts
List of artifacts to compare the current code against. This overridescomparisonVersion, if present. EachcomparisonArtifactis made of agroupId, anartifactIdand aversionnumber. Optionally it may have aclassifier(default null) and atype(default "jar"). -
minSeverity
Show only messages of this severity or higher. Valid values areinfo,warninganderror. -
textOutputFile
A text output file to render to. If omitted, no output is rendered to a text file. -
xmlOutputFile
An XML file to render to. If omitted, no output is rendered to an XML file. -
includes
A list of classes to include. Anything not included is excluded. If omitted, all are assumed to be included. Values are specified in path pattern notation, e.g.org/codehaus/mojo/**. -
excludes
A list of classes to exclude. These classes are excluded from the list of classes that are included. Values are specified in path pattern notation, e.g.org/codehaus/mojo/**. -
ignored
A list of differences reported by Clirr that should be ignored when producing the final report. Values specified here will be joined with the ones specified using the "ignoredDifferencesFile" parameter.- Since:
- 2.5
-
ignoredDifferencesFile
A path to the XML file containing the ignored differences definitions. Values specified int the file will be joined with the ones specified using the "ignored" parameter.
File Format<differences> ... <difference> <className>com.thoughtworks.qdox.parser.impl.Parser</className> <field>*</field> </difference> ... </differences>- Since:
- 2.5
-
logResults
protected boolean logResultsWhether to log the results to the console or not.
-
-
Constructor Details
-
AbstractClirrMojo
public AbstractClirrMojo()
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
doExecute
protected abstract void doExecute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
executeClirr
public ClirrDiffListener executeClirr() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
executeClirr
protected ClirrDiffListener executeClirr(net.sf.clirr.core.Severity minSeverity) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException - Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-
getAllIgnored
-
getTransitiveDependencies
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 - Throws:
org.apache.maven.project.ProjectBuildingExceptionorg.apache.maven.project.artifact.InvalidDependencyVersionExceptionorg.apache.maven.artifact.resolver.ArtifactResolutionExceptionorg.apache.maven.artifact.resolver.ArtifactNotFoundException
-
resolveArtifacts
protected Set resolveArtifacts(ArtifactSpecification[] artifacts) throws org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoFailureExceptionorg.apache.maven.plugin.MojoExecutionException
-
createClassSet
public static net.sf.clirr.core.spi.JavaType[] createClassSet(File classes, ClassLoader thirdPartyClasses, net.sf.clirr.core.ClassFilter classFilter) throws MalformedURLException - Throws:
MalformedURLException
-
createClassLoader
protected static ClassLoader createClassLoader(Collection artifacts, Set previousArtifacts) throws MalformedURLException Create a ClassLoader, which includes the artifacts inartifacts, but excludes the artifacts inpreviousArtifacts. The intention is, that we let BCEL inspect the artifacts in the latter set, using aClassLoader, which contains the dependencies. However, theClassLoadermust not contain the jar files, which are being inspected.- Parameters:
artifacts- The artifacts, from which to build aClassLoader.previousArtifacts- The artifacts being inspected, or null, if te returnedClassLoadershould contain all the elements ofartifacts.- Returns:
- A
ClassLoaderwhich may be used to inspect the classes in previousArtifacts. - Throws:
MalformedURLException- Failed to convert a file to an URL.
-
convertSeverity
-
canGenerate
protected boolean canGenerate() throws org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoFailureExceptionorg.apache.maven.plugin.MojoExecutionException
-