Require Java Vendor

This rule enforces a certain Java JDK vendor. The rule uses the full vendor name to verify.

The following parameters are supported by this rule:

  • message - an optional message to the user if the rule fails.
  • includes - a list of allowed JDK vendors to include, by default all is included.
  • excludes - a list of banned JDK vendors. These are exceptions to the includes.

    Sample Plugin Configuration:

    <project>
      [...]
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <version>3.4.1</version>
            <executions>
              <execution>
                <id>enforce-java</id>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <requireJavaVendor>
                      <excludes>
                        <exclude>Pivotal</exclude>
                        <exclude>Oracle JDK</exclude>
                      </excludes>
                      <includes>
                        <include>AdoptOpenJDK</include>
                      </includes>
                    </requireJavaVendor>
                  </rules>    
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      [...]
    </project>