michael-o commented on code in PR #180: URL: https://github.com/apache/maven-enforcer/pull/180#discussion_r949985124
########## enforcer-rules/src/site/apt/externalRules.apt.vm: ########## @@ -0,0 +1,104 @@ +~~ Licensed to the Apache Software Foundation (ASF) under one +~~ or more contributor license agreements. See the NOTICE file +~~ distributed with this work for additional information +~~ regarding copyright ownership. The ASF licenses this file +~~ to you under the Apache License, Version 2.0 (the +~~ "License"); you may not use this file except in compliance +~~ with the License. You may obtain a copy of the License at +~~ +~~ http://www.apache.org/licenses/LICENSE-2.0 +~~ +~~ Unless required by applicable law or agreed to in writing, +~~ software distributed under the License is distributed on an +~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +~~ KIND, either express or implied. See the License for the +~~ specific language governing permissions and limitations +~~ under the License. + + ------ + External Rules + ------ + George Gastaldi + ------ + August 2022 + ------ + +External Rules + + This rule will evaluate rules from an external resource. It can be a classpath resource present in a <<<maven-enforcer-plugin>>> dependency or a local file. + + + Sample Plugin Configuration: + ++---+ +<project> + [...] + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-enforcer-plugin</artifactId> + <version>${project.version}</version> + <dependencies> + <!-- Dependency containing the enforcer/rules.xml file --> + <dependency> + <groupId>org.foo</groupId> + <artifactId>foobar-rules</artifactId> + <version>1.0.0</version> + </dependency> + </dependencies> + <executions> + <execution> + <id>enforce</id> + <goals> + <goal>enforce</goal> + </goals> + <configuration> + <rules> + <ExternalRules> + <!-- enforcer/rules.xml is supposed to be a classpath resource present --> + <!-- in org.foo:foobar-rules dependency of maven-enforcer-plugin defined above --> + <location>classpath:enforcer/rules.xml</location> + </ExternalRules> + <ExternalRules> + <!-- 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} --> + <!-- Protip: to set the same resource for all modules in your multimodule setup, --> + <!-- prefix the path with ${maven.multiModuleProjectDirectory}. That makes it --> Review Comment: There is an open JIRA issue -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org