Class RequireJavaVendor

All Implemented Interfaces:

@Named("requireJavaVendor") public final class RequireJavaVendor extends AbstractStandardEnforcerRule
This rule checks that the Java vendor is allowed. Rule will fail is it matches any of the excludes or doesn't match any include in case it was set.
Tim Sijstermans
  • Constructor Details

  • Method Details

    • getCacheId

      public String getCacheId()
      The Java Vendor not changed during one Maven session, so can be cached.
      getCacheId in class AbstractEnforcerRule
      a cache id
    • execute

      public void execute() throws EnforcerRuleException
      Description copied from class: AbstractEnforcerRule
      This is the interface into the rule. This method should throw an exception containing a reason message if the rule fails the check. The plugin will then decide based on the fail flag and rule level if it should stop or just log the message as a warning.
      Specified by:
      execute in class AbstractEnforcerRule
      EnforcerRuleException - the enforcer rule exception
    • setExcludes

      public void setExcludes(List<String> theExcludes)
      Specify the banned vendors. This should be an exact match of the System Property java.vendor, which you can also see with mvn --version.
      Excludes override the include rules.
      theExcludes - the vendor to to exclude from the include list.
    • setIncludes

      public void setIncludes(List<String> theIncludes)
      Specify the allowed vendor names. This should be an exact match of the System Property java.vendor, which you can also see with mvn --version.
      The rule will fail if vendor name matches any exclude, unless it also matches an include rule. Some examples are:
      • AdoptOpenJDK prohibits vendor name AdoptOpenJDK
      • Amazon prohibits vendor name Amazon
      theIncludes - the list of required vendors.
      See Also:
    • toString

      public String toString()
      toString in class Object
    • setLog

      public void setLog(EnforcerLogger log)
      Used by EnforcerMojo to inject logger instance
      Specified by:
      setLog in interface EnforcerRuleBase
      log - an EnforcerLogger instance
    • getLog

      public EnforcerLogger getLog()
      Provide an EnforcerLogger instance for Rule

      NOTICE A logger is not available in constructors.

      an EnforcerLogger instance