From 9936551a09aaa39376a54457de8c3eb0ec76e774 Mon Sep 17 00:00:00 2001 From: Konrad Windszus Date: Sun, 1 Jan 2023 11:30:05 +0100 Subject: [PATCH] [MENFORCER-425] Clarify usage of maven-enforcer-rules --- enforcer-api/src/site/apt/writing-a-custom-rule.apt.vm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/enforcer-api/src/site/apt/writing-a-custom-rule.apt.vm b/enforcer-api/src/site/apt/writing-a-custom-rule.apt.vm index bfa61ca6..b0472dd4 100644 --- a/enforcer-api/src/site/apt/writing-a-custom-rule.apt.vm +++ b/enforcer-api/src/site/apt/writing-a-custom-rule.apt.vm @@ -75,9 +75,10 @@ Writing a custom rule +---+ - Note that the classloader is shared with the embedding <<>> (a regular {{{https://maven.apache.org/guides/mini/guide-maven-classloading.html#3-plugin-classloaders}plugin classloader}}) + Note that the classloader is shared with the embedding <<>> (a regular {{{https://maven.apache.org/guides/mini/guide-maven-classloading.html#Plugin_Classloaders}plugin classloader}}) and therefore the artifacts <<>> and <<>> are always loaded in the same version as the embedding <<>>. - Custom rule artifacts should therefore only depend on them and core Maven artifacts with <<>> scope (for details refer to {{{https://issues.apache.org/jira/browse/MNG-7097}MNG-7097}}). + Custom rule artifacts should therefore only depend on `enforcer-api` and core Maven artifacts with <<>> scope (for details refer to {{{https://issues.apache.org/jira/browse/MNG-7097}MNG-7097}}). + The classes available from `enforcer-rules` must not be used from custom rules, as those are not considered API and may change in backwards-incompatible ways with every `maven-enforcer` version (even minor ones). [[2]] Create your rule class. The rule must implement the {{{./apidocs/index.html}EnforcerRule}} interface. The rule can get access to components and the log via the {{{./apidocs/index.html}EnforcerRuleHelper}} interface. @@ -285,4 +286,4 @@ public class MyCustomRule ... -+---+ \ No newline at end of file ++---+