Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package org.codehaus.mojo.clirr;
/*
* Copyright 2006 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import net.sf.clirr.core.Checker;
import net.sf.clirr.core.CheckerException;
import net.sf.clirr.core.ClassFilter;
import net.sf.clirr.core.DiffListener;
import net.sf.clirr.core.PlainDiffListener;
import net.sf.clirr.core.Severity;
import net.sf.clirr.core.XmlDiffListener;
import net.sf.clirr.core.internal.bcel.BcelJavaType;
import net.sf.clirr.core.internal.bcel.BcelTypeArrayBuilder;
import net.sf.clirr.core.spi.JavaType;
import org.apache.bcel.classfile.ClassParser;
import org.apache.bcel.classfile.JavaClass;
import org.apache.bcel.util.ClassLoaderRepository;
import org.apache.bcel.util.Repository;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException;
import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
import org.apache.maven.artifact.resolver.ArtifactResolutionException;
import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
import org.apache.maven.artifact.resolver.ArtifactResolver;
import org.apache.maven.artifact.versioning.ArtifactVersion;
import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
import org.apache.maven.artifact.versioning.OverConstrainedVersionException;
import org.apache.maven.artifact.versioning.VersionRange;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.MavenProjectBuilder;
import org.apache.maven.project.ProjectBuildingException;
import org.apache.maven.project.artifact.InvalidDependencyVersionException;
import org.codehaus.plexus.util.DirectoryScanner;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.ReaderFactory;
import org.codehaus.plexus.util.xml.XmlStreamReader;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
/**
* Base parameters for Clirr check and report.
*
* @author Brett Porter
* @todo i18n exceptions, log messages
* @requiresDependencyResolution compile
*/
public abstract class AbstractClirrMojo
extends AbstractMojo
{
/**
* Flag to easily skip execution.
*
* @parameter expression="${clirr.skip}" default-value="false"
*/
protected boolean skip;
/**
* @parameter expression="${project}"
* @required
* @readonly
*/
protected MavenProject project;
/**
* @component
*/
protected ArtifactResolver resolver;
/**
* @component
*/
protected ArtifactFactory factory;
/**
* @parameter default-value="${localRepository}"
* @required
* @readonly
*/
protected ArtifactRepository localRepository;
/**
* @component
*/
private ArtifactMetadataSource metadataSource;
/**
* @component
*/
private MavenProjectBuilder mavenProjectBuilder;
/**
* The classes of this project to compare the last release against.
*
* @parameter default-value="${project.build.outputDirectory}
*/
protected File classesDirectory;
/**
* Version to compare the current code against.
*
* @parameter expression="${comparisonVersion}" default-value="(,${project.version})"
*/
protected String comparisonVersion;
/**
* 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").
*
* @parameter
*/
protected ArtifactSpecification[] comparisonArtifacts;
/**
* Show only messages of this severity or higher. Valid values are
* info, warning and error.
*
* @parameter expression="${minSeverity}" default-value="warning"
*/
protected String minSeverity;
/**
* A text output file to render to. If omitted, no output is rendered to a text file.
*
* @parameter expression="${textOutputFile}"
*/
protected File textOutputFile;
/**
* An XML file to render to. If omitted, no output is rendered to an XML file.
*
* @parameter expression="${xmlOutputFile}"
*/
protected File xmlOutputFile;
/**
* 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/**.
*
* @parameter
*/
protected String[] includes;
/**
* 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/**.
*
* @parameter
*/
protected String[] excludes;
/**
* 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.
*
* @parameter
* @since 2.5
*/
protected Difference[] ignored;
/**
* 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
*