Class CheckSignatureMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.codehaus.mojo.animal_sniffer.maven.CheckSignatureMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="check",
defaultPhase=PROCESS_TEST_CLASSES,
requiresDependencyResolution=TEST,
threadSafe=true)
public class CheckSignatureMojo
extends org.apache.maven.plugin.AbstractMojo
Checks the classes compiled by this module.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String[]Annotation names to consider to ignore annotated methods, classes or fields.protected org.apache.maven.artifact.factory.ArtifactFactoryprotected booleanShould test classes be checked.private String[]A list of artifact patterns to exclude.protected booleanShould signature check failures throw an error?protected booleanShould dependencies be ignored.protected String[]Class names to ignore signatures for (wildcards accepted).private String[]A list of artifact patterns to include.protected org.apache.maven.artifact.repository.ArtifactRepositoryprotected FileThe directory for compiled classes.protected org.apache.maven.project.MavenProjectprotected org.apache.maven.artifact.resolver.ArtifactResolverprotected SignatureSignature module to use.protected booleanShould signature checking be skipped?protected FileThe directory for compiled test classes.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidList of packages defined in the application.voidexecute()private static org.apache.maven.model.DependencyfindMatchingDependency(Signature signature, List<org.apache.maven.model.Dependency> dependencies) loadClasses(File f) voidsetSignature(String signatureId) Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
outputDirectory
@Parameter(defaultValue="${project.build.outputDirectory}", required=true, readonly=true) protected File outputDirectoryThe directory for compiled classes. -
testOutputDirectory
@Parameter(defaultValue="${project.build.testOutputDirectory}", required=true, readonly=true) protected File testOutputDirectoryThe directory for compiled test classes.- Since:
- 1.19
-
checkTestClasses
@Parameter(property="animal.sniffer.checkTestClasses", defaultValue="false") protected boolean checkTestClassesShould test classes be checked.- Since:
- 1.19
-
signature
Signature module to use. -
ignores
Class names to ignore signatures for (wildcards accepted). -
annotations
Annotation names to consider to ignore annotated methods, classes or fields.By default 'org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement' and 'org.jvnet.animal_sniffer.IgnoreJRERequirement' are used.
-
ignoreDependencies
@Parameter(defaultValue="true") protected boolean ignoreDependenciesShould dependencies be ignored. -
includeDependencies
A list of artifact patterns to include. Patterns can include*as a wildcard match for any whole segment, valid patterns are:groupId:artifactIdgroupId:artifactId:typegroupId:artifactId:type:versiongroupId:artifactId:type:classifiergroupId:artifactId:type:classifier:version
- Since:
- 1.12
-
excludeDependencies
A list of artifact patterns to exclude. Patterns can include*as a wildcard match for any whole segment, valid patterns are:groupId:artifactIdgroupId:artifactId:typegroupId:artifactId:type:versiongroupId:artifactId:type:classifiergroupId:artifactId:type:classifier:version
- Since:
- 1.12
-
skip
@Parameter(defaultValue="false", property="animal.sniffer.skip") protected boolean skipShould signature checking be skipped? -
failOnError
@Parameter(defaultValue="true", property="animal.sniffer.failOnError") protected boolean failOnErrorShould signature check failures throw an error? -
resolver
@Component protected org.apache.maven.artifact.resolver.ArtifactResolver resolver -
project
@Parameter(defaultValue="${project}", readonly=true) protected org.apache.maven.project.MavenProject project -
localRepository
@Parameter(defaultValue="${localRepository}", readonly=true) protected org.apache.maven.artifact.repository.ArtifactRepository localRepository -
artifactFactory
@Component protected org.apache.maven.artifact.factory.ArtifactFactory artifactFactory -
classes
-
-
Constructor Details
-
CheckSignatureMojo
public CheckSignatureMojo()
-
-
Method Details
-
setSignature
- Parameters:
signatureId- A fully-qualified path to a signature jar. This allows users to set a signature for command-line invocations, such as:mvn org.codehaus.mojo:animal-sniffer-maven-plugin:1.15:check -Dsignature=org.codehaus.mojo.signature:java17:1.0
-
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
-
loadClasses
- Throws:
IOException
-
findMatchingDependency
-
buildPackageList
List of packages defined in the application.- Throws:
IOException
-
apply
- Throws:
IOException
-
buildSourcePathList
-