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 Details

    • skip

      protected boolean skip
      Flag 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

      protected File classesDirectory
      The classes of this project to compare the last release against.
    • comparisonVersion

      protected String comparisonVersion
      Version to compare the current code against.
    • comparisonArtifacts

      protected ArtifactSpecification[] comparisonArtifacts
      List of artifacts to compare the current code against. This overrides 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").
    • minSeverity

      protected String minSeverity
      Show only messages of this severity or higher. Valid values are info, warning and error.
    • textOutputFile

      protected File textOutputFile
      A text output file to render to. If omitted, no output is rendered to a text file.
    • xmlOutputFile

      protected File xmlOutputFile
      An XML file to render to. If omitted, no output is rendered to an XML file.
    • includes

      protected String[] 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

      protected String[] 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

      protected Difference[] 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

      protected File 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 logResults
      Whether 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.MojoExecutionException
      org.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.MojoExecutionException
      org.apache.maven.plugin.MojoFailureException
    • executeClirr

      public ClirrDiffListener executeClirr() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
      org.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.MojoExecutionException
      org.apache.maven.plugin.MojoFailureException
    • getAllIgnored

      protected List<Difference> 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.ProjectBuildingException
      org.apache.maven.project.artifact.InvalidDependencyVersionException
      org.apache.maven.artifact.resolver.ArtifactResolutionException
      org.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.MojoFailureException
      org.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 in 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.
      Parameters:
      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.
      Returns:
      A ClassLoader which may be used to inspect the classes in previousArtifacts.
      Throws:
      MalformedURLException - Failed to convert a file to an URL.
    • convertSeverity

      protected static net.sf.clirr.core.Severity convertSeverity(String minSeverity)
    • canGenerate

      protected boolean canGenerate() throws org.apache.maven.plugin.MojoFailureException, org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoFailureException
      org.apache.maven.plugin.MojoExecutionException