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 Details

    • classpathElements

      @Parameter(defaultValue="${project.compileClasspathElements}", readonly=true, required=true) private List<String> classpathElements
      Injected compile classpath.
    • classesDirectory

      @Parameter(required=false, defaultValue="${project.build.outputDirectory}") private File classesDirectory
      Directory with the class files to check.
  • Constructor Details

    • CheckMojo

      public CheckMojo()
  • Method Details