Package de.thetaphi.forbiddenapis.maven
Class CheckMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
de.thetaphi.forbiddenapis.maven.AbstractCheckMojo
de.thetaphi.forbiddenapis.maven.CheckMojo
- All Implemented Interfaces:
Constants,org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="check",
threadSafe=true,
requiresProject=true,
requiresDependencyResolution=COMPILE,
defaultPhase=VERIFY)
public final class CheckMojo
extends AbstractCheckMojo
Mojo to check if no project generated class files (compile scope) contain calls to forbidden APIs
from the project classpath and a list of API signatures (either inline or as pointer to files or bundled signatures).
At least one signature must be given, using any of the corresponding optional parameters.
This Mojo exists since version 1.2, replacing the old forbiddenapis:forbiddenapis goal.
In most cases its enough to rename the goal on update, the older v1.0 properties are still available.
Since version 2.0 this Mojo defaults to run in the 'verify' lifecycle phase, before it was done in
'process-classes' phase, which caused problems for some users (especially debugging tests).
- Since:
- 1.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate FileDirectory with the class files to check.Injected compile classpath.Fields inherited from interface de.thetaphi.forbiddenapis.Constants
BS_JDK_NONPORTABLE, CLASS_CONSTRUCTOR_METHOD_NAME, CONSTRUCTOR_METHOD_NAME, DEPRECATED_DESCRIPTOR, DEPRECATED_TYPE, DEPRECATED_WARN_FAIL_ON_UNRESOLVABLE_SIGNATURES, ENDS_WITH_VERSION_PATTERN, JDK_SIG_PATTERN, LAMBDA_META_FACTORY_INTERNALNAME, LAMBDA_METHOD_NAME_PREFIX, SIGNATURE_POLYMORPHIC_DESCRIPTOR, SIGNATURE_POLYMORPHIC_PKG_INTERNALNAMEFields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Fileprovided by the concrete Mojos for compile and test classes processingprovided by the concrete Mojos for compile and test classes processingMethods inherited from class de.thetaphi.forbiddenapis.maven.AbstractCheckMojo
execute, getTargetVersionMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
classpathElements
@Parameter(defaultValue="${project.compileClasspathElements}", readonly=true, required=true) private List<String> classpathElementsInjected compile classpath. -
classesDirectory
@Parameter(required=false, defaultValue="${project.build.outputDirectory}") private File classesDirectoryDirectory with the class files to check.
-
-
Constructor Details
-
CheckMojo
public CheckMojo()
-
-
Method Details
-
getClassPathElements
Description copied from class:AbstractCheckMojoprovided by the concrete Mojos for compile and test classes processing- Specified by:
getClassPathElementsin classAbstractCheckMojo
-
getClassesDirectory
Description copied from class:AbstractCheckMojoprovided by the concrete Mojos for compile and test classes processing- Specified by:
getClassesDirectoryin classAbstractCheckMojo
-