Class ModernizerMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.gaul.modernizer_maven_plugin.ModernizerMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

@Mojo(name="modernizer", defaultPhase=PROCESS_TEST_CLASSES, threadSafe=true) public final class ModernizerMojo extends org.apache.maven.plugin.AbstractMojo
  • Field Details

    • failOnViolations

      @Parameter(defaultValue="true", property="modernizer.failOnViolations") protected boolean failOnViolations
      Fail phase if Modernizer detects any violations.
    • includeTestClasses

      @Parameter(defaultValue="true", property="modernizer.includeTestClasses") protected boolean includeTestClasses
      Run Modernizer on test classes.
    • violationsFile

      @Parameter(property="modernizer.violationsFile") protected String violationsFile
      User-specified violation file. Also disables standard violation checks. Can point to files from classpath using an absolute path, e.g.: classpath:/modernizer.xml for the default violations file.
    • violationsFiles

      @Parameter(property="modernizer.violationsFiles") protected List<String> violationsFiles
      User-specified violation files. The violations loaded from violationsFiles override the ones specified in violationsFile (or the default violations file if no violationsFile is given). Violations from the latter files override violations from the former files. Can point to files from classpath using an absolute path, e.g.: classpath:/modernizer.xml for the default violations file.
    • exclusions

      @Parameter protected Set<String> exclusions
      Violations to disable. Each exclusion should be in the javap format: java/lang/String.getBytes:(Ljava/lang/String;)[B.
    • exclusionPatterns

      @Parameter protected Set<String> exclusionPatterns
      Violation patterns to disable. Each exclusion should be a regular expression that matches the javap format: java/lang/.*
    • ignorePackages

      @Parameter protected Set<String> ignorePackages
      Package prefixes to ignore, specified using <ignorePackage> child elements. Specifying foo.bar subsequently ignores foo.bar.*, foo.bar.baz.* and so on.
    • ignoreClassNamePatterns

      @Parameter protected Set<String> ignoreClassNamePatterns
      Fully qualified class names (incl. package) to ignore by regular expression, specified using <ignoreClassNamePattern> child elements. Specifying .*.bar.* ignores foo.bar.*, foo.bar.baz.* but also bar.* and so on; or .*Immutable ignores all class with names ending in Immutable in all packages.
    • skip

      @Parameter(defaultValue="false", property="modernizer.skip") protected boolean skip
      Skips the plugin execution.
      Since:
      1.4.0
  • Constructor Details

    • ModernizerMojo

      public ModernizerMojo()
  • Method Details

    • execute

      public void execute() throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException