You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/08/17 09:21:09 UTC

[GitHub] [maven-enforcer] michael-o commented on a diff in pull request #180: [MENFORCER-422] Added externalRules rule

michael-o commented on code in PR #180:
URL: https://github.com/apache/maven-enforcer/pull/180#discussion_r947662859


##########
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

Review Comment:
   ISO format



##########
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:
   Note that this property is an implementation detail and it should not be used in public



-- 
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-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org