External Rules

This rule will provide rules configuration from an external resource.

It can be a classpath resource present in a maven-enforcer-plugin dependency or a local file.

Sample Plugin Configuration:

                    <!-- Dependency containing the enforcer/rules.xml file -->
                                    <!-- enforcer/rules.xml is supposed to be a classpath resource present -->
                                    <!-- in org.foo:foobar-rules dependency of maven-enforcer-plugin defined above -->
                                    <!-- You can add multiple <ExternalRules> elements if you need to enforce -->
                                    <!-- rules from multiple resources. -->
                                    <!-- src/build/rules.xml is a local file path relative to ${project.basedir} -->

The External Enforcer Rule Descriptor

Here is a sample rules file. The rules element expects the same content as in the Enforcer Mojo rules configuration: