You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2022/11/26 10:50:45 UTC

[maven-enforcer] branch MENFORCER-438 updated (629f57d -> 40637c6)

This is an automated email from the ASF dual-hosted git repository.

khmarbaise pushed a change to branch MENFORCER-438
in repository https://gitbox.apache.org/repos/asf/maven-enforcer.git


 discard 629f57d  [MENFORCER-438] - Upgrade maven-plugin parent to 38
     new 40637c6  [MENFORCER-438] - Upgrade maven-plugin parent to 38

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (629f57d)
            \
             N -- N -- N   refs/heads/MENFORCER-438 (40637c6)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 enforcer-api/pom.xml                               |   6 +-
 .../maven/enforcer/rule/api/EnforcerLevel.java     |  18 +-
 .../maven/enforcer/rule/api/EnforcerRule.java      |  27 +-
 .../maven/enforcer/rule/api/EnforcerRule2.java     |  22 +-
 .../enforcer/rule/api/EnforcerRuleException.java   |  50 +-
 .../enforcer/rule/api/EnforcerRuleHelper.java      |  49 +-
 .../plugins/enforcer/AbstractBanDependencies.java  | 139 ++--
 .../enforcer/AbstractNonCacheableEnforcerRule.java |  31 +-
 .../enforcer/AbstractPropertyEnforcerRule.java     |  85 +-
 .../plugins/enforcer/AbstractRequireFiles.java     | 128 ++-
 .../enforcer/AbstractStandardEnforcerRule.java     | 107 +--
 .../plugins/enforcer/AbstractVersionEnforcer.java  | 119 ++-
 .../apache/maven/plugins/enforcer/AlwaysFail.java  |  37 +-
 .../apache/maven/plugins/enforcer/AlwaysPass.java  |  38 +-
 .../enforcer/BanDependencyManagementScope.java     | 120 ++-
 .../enforcer/BanDistributionManagement.java        |  89 +-
 .../BanDuplicatePomDependencyVersions.java         | 396 +++++----
 .../maven/plugins/enforcer/BanDynamicVersions.java | 268 +++---
 .../enforcer/BanTransitiveDependencies.java        | 134 ++-
 .../maven/plugins/enforcer/BannedDependencies.java |  83 +-
 .../maven/plugins/enforcer/BannedPlugins.java      | 106 +--
 .../maven/plugins/enforcer/BannedRepositories.java | 141 ++--
 .../enforcer/DefaultEnforcementRuleHelper.java     |  95 +--
 .../plugins/enforcer/DependencyConvergence.java    | 169 ++--
 .../maven/plugins/enforcer/EnforcerDescriptor.java |  27 +-
 .../enforcer/EnforcerExpressionEvaluator.java      |  28 +-
 .../maven/plugins/enforcer/EvaluateBeanshell.java  |  87 +-
 .../maven/plugins/enforcer/ExternalRules.java      | 132 ++-
 .../plugins/enforcer/ReactorModuleConvergence.java | 899 ++++++++++-----------
 .../plugins/enforcer/RequireActiveProfile.java     | 108 ++-
 .../enforcer/RequireEnvironmentVariable.java       |  52 +-
 .../enforcer/RequireExplicitDependencyScope.java   |  90 ++-
 .../plugins/enforcer/RequireFileChecksum.java      | 140 ++--
 .../plugins/enforcer/RequireFilesDontExist.java    |  29 +-
 .../maven/plugins/enforcer/RequireFilesExist.java  |  53 +-
 .../maven/plugins/enforcer/RequireFilesSize.java   | 117 ++-
 .../maven/plugins/enforcer/RequireJavaVendor.java  |  62 +-
 .../maven/plugins/enforcer/RequireJavaVersion.java |  80 +-
 .../plugins/enforcer/RequireMavenVersion.java      |  52 +-
 .../plugins/enforcer/RequireNoRepositories.java    | 171 ++--
 .../apache/maven/plugins/enforcer/RequireOS.java   | 240 +++---
 .../plugins/enforcer/RequirePluginVersions.java    | 826 ++++++++-----------
 .../plugins/enforcer/RequirePrerequisite.java      | 263 +++---
 .../plugins/enforcer/RequireProfileIdsExist.java   | 205 ++---
 .../maven/plugins/enforcer/RequireProperty.java    |  53 +-
 .../maven/plugins/enforcer/RequireReleaseDeps.java | 170 ++--
 .../plugins/enforcer/RequireReleaseVersion.java    |  73 +-
 .../plugins/enforcer/RequireSameVersions.java      | 264 +++---
 .../plugins/enforcer/RequireSnapshotVersion.java   |  73 +-
 .../plugins/enforcer/RequireTextFileChecksum.java  |  86 +-
 .../plugins/enforcer/RequireUpperBoundDeps.java    | 329 ++++----
 .../plugins/enforcer/utils/ArtifactMatcher.java    | 204 +++--
 .../plugins/enforcer/utils/ArtifactUtils.java      | 106 ++-
 .../enforcer/utils/DependencyVersionMap.java       | 107 ++-
 .../utils/DistributionManagementCheck.java         | 177 ++--
 .../plugins/enforcer/utils/EnforcerRuleUtils.java  |  97 +--
 .../utils/NormalizeLineSeparatorReader.java        | 101 ++-
 .../plugins/enforcer/utils/PluginWrapper.java      | 114 ++-
 .../enforcer/BanDependencyManagementScopeTest.java |  70 +-
 .../enforcer/BanDistributionManagementTest.java    | 204 +++--
 .../enforcer/BannedDependenciesTestSetup.java      |  77 +-
 .../maven/plugins/enforcer/EnforcerTestUtils.java  | 145 ++--
 .../apache/maven/plugins/enforcer/MockProject.java | 712 ++++++----------
 .../enforcer/ReactorModuleConvergenceTest.java     | 350 ++++----
 .../plugins/enforcer/RequireActiveProfileTest.java | 159 ++--
 .../plugins/enforcer/RequirePrerequisiteTest.java  | 343 ++++----
 .../enforcer/RequireUpperBoundDepsTest.java        |  55 +-
 .../enforcer/TestAbstractVersionEnforcer.java      | 168 ++--
 .../maven/plugins/enforcer/TestAlwaysFail.java     |  40 +-
 .../maven/plugins/enforcer/TestAlwaysPass.java     |  29 +-
 .../plugins/enforcer/TestBannedDependencies.java   | 232 +++---
 .../plugins/enforcer/TestBannedRepositories.java   | 148 ++--
 .../plugins/enforcer/TestEvaluateBeanshell.java    | 300 ++++---
 .../maven/plugins/enforcer/TestExternalRules.java  |  49 +-
 .../maven/plugins/enforcer/TestMavenVersion.java   |  99 +--
 .../enforcer/TestRequireEnvironmentVariable.java   |  86 +-
 .../plugins/enforcer/TestRequireFileChecksum.java  | 336 ++++----
 .../enforcer/TestRequireFilesDontExist.java        | 322 ++++----
 .../plugins/enforcer/TestRequireFilesExist.java    | 120 +--
 .../plugins/enforcer/TestRequireFilesSize.java     | 378 +++++----
 .../plugins/enforcer/TestRequireJavaVendor.java    | 107 +--
 .../plugins/enforcer/TestRequireJavaVersion.java   |  97 ++-
 .../enforcer/TestRequireNoRepositories.java        | 308 +++----
 .../maven/plugins/enforcer/TestRequireOS.java      | 117 +--
 .../enforcer/TestRequirePluginVersions.java        | 432 +++++-----
 .../plugins/enforcer/TestRequireProperty.java      |  92 +--
 .../plugins/enforcer/TestRequireReleaseDeps.java   | 123 +--
 .../enforcer/TestRequireReleaseVersion.java        |  63 +-
 .../enforcer/TestRequireSnapshotVersion.java       |  84 +-
 .../enforcer/TestRequireTextFileChecksum.java      | 138 ++--
 .../enforcer/utils/EnforcerRuleUtilsHelper.java    |  49 +-
 .../utils/MockEnforcerExpressionEvaluator.java     |  41 +-
 .../enforcer/utils/TestArtifactMatcher.java        | 210 ++---
 .../utils/TestMockEnforcerExpressionEvaluator.java |  50 +-
 .../utils/TestNormalizeLineSeparatorReader.java    |  74 +-
 maven-enforcer-extension/pom.xml                   |  38 +-
 .../extensions/enforcer/EnforceExtension.java      | 150 ++--
 maven-enforcer-plugin/pom.xml                      |  46 +-
 .../maven/plugins/enforcer/DisplayInfoMojo.java    |  58 +-
 .../apache/maven/plugins/enforcer/EnforceMojo.java | 291 +++----
 .../maven/plugins/enforcer/util/EnforcerUtils.java |  23 +-
 .../maven/plugins/enforcer/MockEnforcerRule.java   |  65 +-
 .../enforcer/TestDefaultEnforcementRuleHelper.java |  26 +-
 .../maven/plugins/enforcer/TestEnforceMojo.java    | 276 +++----
 pom.xml                                            |  35 +-
 105 files changed, 7416 insertions(+), 8071 deletions(-)


[maven-enforcer] 01/01: [MENFORCER-438] - Upgrade maven-plugin parent to 38

Posted by kh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

khmarbaise pushed a commit to branch MENFORCER-438
in repository https://gitbox.apache.org/repos/asf/maven-enforcer.git

commit 40637c64ae6e60de8bbef101991e2840903286da
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Sat Nov 26 11:40:27 2022 +0100

    [MENFORCER-438] - Upgrade maven-plugin parent to 38
---
 enforcer-api/pom.xml                               |   6 +-
 .../maven/enforcer/rule/api/EnforcerLevel.java     |  18 +-
 .../maven/enforcer/rule/api/EnforcerRule.java      |  27 +-
 .../maven/enforcer/rule/api/EnforcerRule2.java     |  22 +-
 .../enforcer/rule/api/EnforcerRuleException.java   |  50 +-
 .../enforcer/rule/api/EnforcerRuleHelper.java      |  49 +-
 .../plugins/enforcer/AbstractBanDependencies.java  | 139 ++--
 .../enforcer/AbstractNonCacheableEnforcerRule.java |  31 +-
 .../enforcer/AbstractPropertyEnforcerRule.java     |  85 +-
 .../plugins/enforcer/AbstractRequireFiles.java     | 128 ++-
 .../enforcer/AbstractStandardEnforcerRule.java     | 107 +--
 .../plugins/enforcer/AbstractVersionEnforcer.java  | 119 ++-
 .../apache/maven/plugins/enforcer/AlwaysFail.java  |  37 +-
 .../apache/maven/plugins/enforcer/AlwaysPass.java  |  38 +-
 .../enforcer/BanDependencyManagementScope.java     | 120 ++-
 .../enforcer/BanDistributionManagement.java        |  89 +-
 .../BanDuplicatePomDependencyVersions.java         | 396 +++++----
 .../maven/plugins/enforcer/BanDynamicVersions.java | 268 +++---
 .../enforcer/BanTransitiveDependencies.java        | 134 ++-
 .../maven/plugins/enforcer/BannedDependencies.java |  83 +-
 .../maven/plugins/enforcer/BannedPlugins.java      | 106 +--
 .../maven/plugins/enforcer/BannedRepositories.java | 141 ++--
 .../enforcer/DefaultEnforcementRuleHelper.java     |  95 +--
 .../plugins/enforcer/DependencyConvergence.java    | 169 ++--
 .../maven/plugins/enforcer/EnforcerDescriptor.java |  27 +-
 .../enforcer/EnforcerExpressionEvaluator.java      |  28 +-
 .../maven/plugins/enforcer/EvaluateBeanshell.java  |  87 +-
 .../maven/plugins/enforcer/ExternalRules.java      | 132 ++-
 .../plugins/enforcer/ReactorModuleConvergence.java | 899 ++++++++++-----------
 .../plugins/enforcer/RequireActiveProfile.java     | 108 ++-
 .../enforcer/RequireEnvironmentVariable.java       |  52 +-
 .../enforcer/RequireExplicitDependencyScope.java   |  90 ++-
 .../plugins/enforcer/RequireFileChecksum.java      | 140 ++--
 .../plugins/enforcer/RequireFilesDontExist.java    |  29 +-
 .../maven/plugins/enforcer/RequireFilesExist.java  |  53 +-
 .../maven/plugins/enforcer/RequireFilesSize.java   | 117 ++-
 .../maven/plugins/enforcer/RequireJavaVendor.java  |  62 +-
 .../maven/plugins/enforcer/RequireJavaVersion.java |  80 +-
 .../plugins/enforcer/RequireMavenVersion.java      |  52 +-
 .../plugins/enforcer/RequireNoRepositories.java    | 171 ++--
 .../apache/maven/plugins/enforcer/RequireOS.java   | 240 +++---
 .../plugins/enforcer/RequirePluginVersions.java    | 826 ++++++++-----------
 .../plugins/enforcer/RequirePrerequisite.java      | 263 +++---
 .../plugins/enforcer/RequireProfileIdsExist.java   | 205 ++---
 .../maven/plugins/enforcer/RequireProperty.java    |  53 +-
 .../maven/plugins/enforcer/RequireReleaseDeps.java | 170 ++--
 .../plugins/enforcer/RequireReleaseVersion.java    |  73 +-
 .../plugins/enforcer/RequireSameVersions.java      | 264 +++---
 .../plugins/enforcer/RequireSnapshotVersion.java   |  73 +-
 .../plugins/enforcer/RequireTextFileChecksum.java  |  86 +-
 .../plugins/enforcer/RequireUpperBoundDeps.java    | 329 ++++----
 .../plugins/enforcer/utils/ArtifactMatcher.java    | 204 +++--
 .../plugins/enforcer/utils/ArtifactUtils.java      | 106 ++-
 .../enforcer/utils/DependencyVersionMap.java       | 107 ++-
 .../utils/DistributionManagementCheck.java         | 177 ++--
 .../plugins/enforcer/utils/EnforcerRuleUtils.java  |  97 +--
 .../utils/NormalizeLineSeparatorReader.java        | 101 ++-
 .../plugins/enforcer/utils/PluginWrapper.java      | 114 ++-
 .../enforcer/BanDependencyManagementScopeTest.java |  70 +-
 .../enforcer/BanDistributionManagementTest.java    | 204 +++--
 .../enforcer/BannedDependenciesTestSetup.java      |  77 +-
 .../maven/plugins/enforcer/EnforcerTestUtils.java  | 145 ++--
 .../apache/maven/plugins/enforcer/MockProject.java | 712 ++++++----------
 .../enforcer/ReactorModuleConvergenceTest.java     | 350 ++++----
 .../plugins/enforcer/RequireActiveProfileTest.java | 159 ++--
 .../plugins/enforcer/RequirePrerequisiteTest.java  | 343 ++++----
 .../enforcer/RequireUpperBoundDepsTest.java        |  55 +-
 .../enforcer/TestAbstractVersionEnforcer.java      | 168 ++--
 .../maven/plugins/enforcer/TestAlwaysFail.java     |  40 +-
 .../maven/plugins/enforcer/TestAlwaysPass.java     |  29 +-
 .../plugins/enforcer/TestBannedDependencies.java   | 232 +++---
 .../plugins/enforcer/TestBannedRepositories.java   | 148 ++--
 .../plugins/enforcer/TestEvaluateBeanshell.java    | 300 ++++---
 .../maven/plugins/enforcer/TestExternalRules.java  |  49 +-
 .../maven/plugins/enforcer/TestMavenVersion.java   |  99 +--
 .../enforcer/TestRequireEnvironmentVariable.java   |  86 +-
 .../plugins/enforcer/TestRequireFileChecksum.java  | 336 ++++----
 .../enforcer/TestRequireFilesDontExist.java        | 322 ++++----
 .../plugins/enforcer/TestRequireFilesExist.java    | 120 +--
 .../plugins/enforcer/TestRequireFilesSize.java     | 378 +++++----
 .../plugins/enforcer/TestRequireJavaVendor.java    | 107 +--
 .../plugins/enforcer/TestRequireJavaVersion.java   |  97 ++-
 .../enforcer/TestRequireNoRepositories.java        | 308 +++----
 .../maven/plugins/enforcer/TestRequireOS.java      | 117 +--
 .../enforcer/TestRequirePluginVersions.java        | 432 +++++-----
 .../plugins/enforcer/TestRequireProperty.java      |  92 +--
 .../plugins/enforcer/TestRequireReleaseDeps.java   | 123 +--
 .../enforcer/TestRequireReleaseVersion.java        |  63 +-
 .../enforcer/TestRequireSnapshotVersion.java       |  84 +-
 .../enforcer/TestRequireTextFileChecksum.java      | 138 ++--
 .../enforcer/utils/EnforcerRuleUtilsHelper.java    |  49 +-
 .../utils/MockEnforcerExpressionEvaluator.java     |  41 +-
 .../enforcer/utils/TestArtifactMatcher.java        | 210 ++---
 .../utils/TestMockEnforcerExpressionEvaluator.java |  50 +-
 .../utils/TestNormalizeLineSeparatorReader.java    |  74 +-
 maven-enforcer-extension/pom.xml                   |  38 +-
 .../extensions/enforcer/EnforceExtension.java      | 150 ++--
 maven-enforcer-plugin/pom.xml                      |  46 +-
 .../maven/plugins/enforcer/DisplayInfoMojo.java    |  58 +-
 .../apache/maven/plugins/enforcer/EnforceMojo.java | 291 +++----
 .../maven/plugins/enforcer/util/EnforcerUtils.java |  23 +-
 .../maven/plugins/enforcer/MockEnforcerRule.java   |  65 +-
 .../enforcer/TestDefaultEnforcementRuleHelper.java |  26 +-
 .../maven/plugins/enforcer/TestEnforceMojo.java    | 276 +++----
 pom.xml                                            |  37 +-
 105 files changed, 7417 insertions(+), 8072 deletions(-)

diff --git a/enforcer-api/pom.xml b/enforcer-api/pom.xml
index c0b27e9..e4e9fa5 100644
--- a/enforcer-api/pom.xml
+++ b/enforcer-api/pom.xml
@@ -31,9 +31,7 @@
   <packaging>jar</packaging>
 
   <name>Apache Maven Enforcer API</name>
-  <description>
-    This component provides the generic interfaces needed to implement custom rules for the maven-enforcer-plugin.
-  </description>
+  <description>This component provides the generic interfaces needed to implement custom rules for the maven-enforcer-plugin.</description>
 
   <dependencies>
     <dependency>
@@ -56,10 +54,10 @@
         <executions>
           <execution>
             <id>custom-rule</id>
-            <phase>pre-site</phase>
             <goals>
               <goal>single</goal>
             </goals>
+            <phase>pre-site</phase>
             <configuration>
               <finalName>custom-rule</finalName>
               <outputDirectory>target/site</outputDirectory>
diff --git a/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerLevel.java b/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerLevel.java
index ec99364..9fc9304 100644
--- a/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerLevel.java
+++ b/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerLevel.java
@@ -1,5 +1,3 @@
-package org.apache.maven.enforcer.rule.api;
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -9,7 +7,7 @@ package org.apache.maven.enforcer.rule.api;
  * "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
+ *   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
@@ -18,20 +16,22 @@ package org.apache.maven.enforcer.rule.api;
  * specific language governing permissions and limitations
  * under the License.
  */
+package org.apache.maven.enforcer.rule.api;
 
 /**
  * Levels steering whether a rule should fail a build or just display a warning.
  *
  * @author Mirko Friedenhagen
- * 
  * @since 1.4
  */
-public enum EnforcerLevel 
-{
+public enum EnforcerLevel {
 
-    /** Fail the build. */
+    /**
+     * Fail the build.
+     */
     ERROR,
-    /** Just warn. */
+    /**
+     * Just warn.
+     */
     WARN
-    
 }
diff --git a/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRule.java b/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRule.java
index 4ba99dc..575e2ca 100644
--- a/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRule.java
+++ b/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRule.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.enforcer.rule.api;
 
 /*
@@ -27,8 +45,7 @@ import javax.annotation.Nullable;
  *
  * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
  */
-public interface EnforcerRule
-{
+public interface EnforcerRule {
 
     /**
      * This is the interface into the rule. This method should throw an exception
@@ -42,8 +59,7 @@ public interface EnforcerRule
      *
      * @throws EnforcerRuleException the enforcer rule exception
      */
-    void execute( @Nonnull EnforcerRuleHelper helper )
-        throws EnforcerRuleException;
+    void execute(@Nonnull EnforcerRuleHelper helper) throws EnforcerRuleException;
 
     /**
      * This method tells the enforcer if the rule results may be cached. If the result is true,
@@ -66,7 +82,7 @@ public interface EnforcerRule
      *
      * @return <code>true</code> if the stored results are valid for the same id.
      */
-    boolean isResultValid( @Nonnull EnforcerRule cachedRule );
+    boolean isResultValid(@Nonnull EnforcerRule cachedRule);
 
     /**
      * If the rule is to be cached, this id is used as part of the key. This can allow rules to take parameters
@@ -77,5 +93,4 @@ public interface EnforcerRule
      */
     @Nullable
     String getCacheId();
-
 }
diff --git a/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRule2.java b/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRule2.java
index afd7c5e..1b5272c 100644
--- a/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRule2.java
+++ b/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRule2.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.enforcer.rule.api;
 
 /*
@@ -27,8 +45,7 @@ import javax.annotation.Nonnull;
  * @author Mirko Friedenhagen
  * @since 1.4
  */
-public interface EnforcerRule2 extends EnforcerRule
-{
+public interface EnforcerRule2 extends EnforcerRule {
     /**
      * Returns the level of enforcement.
      *
@@ -36,5 +53,4 @@ public interface EnforcerRule2 extends EnforcerRule
      */
     @Nonnull
     EnforcerLevel getLevel();
-
 }
diff --git a/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRuleException.java b/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRuleException.java
index d90c8e3..964f0c8 100644
--- a/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRuleException.java
+++ b/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRuleException.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.enforcer.rule.api;
 
 /*
@@ -26,9 +44,7 @@ package org.apache.maven.enforcer.rule.api;
  *
  * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
  */
-public class EnforcerRuleException
-    extends Exception
-{
+public class EnforcerRuleException extends Exception {
 
     /** serialVersionUID. */
     private static final long serialVersionUID = 1L;
@@ -44,8 +60,7 @@ public class EnforcerRuleException
      *
      * @return the long message
      */
-    public String getLongMessage()
-    {
+    public String getLongMessage() {
         return longMessage;
     }
 
@@ -54,8 +69,7 @@ public class EnforcerRuleException
      *
      * @return the source
      */
-    public Object getSource()
-    {
+    public Object getSource() {
         return source;
     }
 
@@ -67,9 +81,8 @@ public class EnforcerRuleException
      * @param shortMessage the short message
      * @param longMessage the long message
      */
-    public EnforcerRuleException( Object source, String shortMessage, String longMessage )
-    {
-        super( shortMessage );
+    public EnforcerRuleException(Object source, String shortMessage, String longMessage) {
+        super(shortMessage);
         this.source = source;
         this.longMessage = longMessage;
     }
@@ -82,9 +95,8 @@ public class EnforcerRuleException
      * @param message the message
      * @param cause the cause
      */
-    public EnforcerRuleException( String message, Exception cause )
-    {
-        super( message, cause );
+    public EnforcerRuleException(String message, Exception cause) {
+        super(message, cause);
     }
 
     /**
@@ -95,9 +107,8 @@ public class EnforcerRuleException
      * @param message the message
      * @param cause the cause
      */
-    public EnforcerRuleException( String message, Throwable cause )
-    {
-        super( message, cause );
+    public EnforcerRuleException(String message, Throwable cause) {
+        super(message, cause);
     }
 
     /**
@@ -106,8 +117,7 @@ public class EnforcerRuleException
      *
      * @param message the message
      */
-    public EnforcerRuleException( String message )
-    {
-        super( message );
+    public EnforcerRuleException(String message) {
+        super(message);
     }
-}
\ No newline at end of file
+}
diff --git a/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRuleHelper.java b/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRuleHelper.java
index 727faef..2a3cff0 100644
--- a/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRuleHelper.java
+++ b/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRuleHelper.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.enforcer.rule.api;
 
 /*
@@ -22,15 +40,12 @@ package org.apache.maven.enforcer.rule.api;
 import java.util.List;
 import java.util.Map;
 import java.util.function.Supplier;
-
 import javax.annotation.Nonnull;
-
 import org.apache.maven.plugin.logging.Log;
 import org.codehaus.plexus.PlexusContainer;
 import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator;
 import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
 
-
 /**
  * This is the interface that all helpers will use. This
  * provides access to the log, session and components to the
@@ -38,9 +53,7 @@ import org.codehaus.plexus.component.repository.exception.ComponentLookupExcepti
  *
  * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
  */
-public interface EnforcerRuleHelper
-    extends ExpressionEvaluator
-{
+public interface EnforcerRuleHelper extends ExpressionEvaluator {
 
     /**
      * Gets the log.
@@ -48,7 +61,7 @@ public interface EnforcerRuleHelper
      * @return the log
      */
     @Nonnull
-    Log getLog ();
+    Log getLog();
 
     /**
      * Gets the component.
@@ -60,8 +73,7 @@ public interface EnforcerRuleHelper
      * @throws ComponentLookupException the component lookup exception
      */
     @Nonnull
-    <T> T getComponent ( Class<T> clazz )
-        throws ComponentLookupException;
+    <T> T getComponent(Class<T> clazz) throws ComponentLookupException;
 
     /**
      * Gets the component.
@@ -73,8 +85,7 @@ public interface EnforcerRuleHelper
      * @throws ComponentLookupException the component lookup exception
      */
     @Nonnull
-    Object getComponent ( String componentKey )
-        throws ComponentLookupException;
+    Object getComponent(String componentKey) throws ComponentLookupException;
 
     /**
      * Gets the component.
@@ -86,8 +97,7 @@ public interface EnforcerRuleHelper
      *
      * @throws ComponentLookupException the component lookup exception
      */
-    Object getComponent ( String role, String roleHint )
-        throws ComponentLookupException;
+    Object getComponent(String role, String roleHint) throws ComponentLookupException;
 
     /**
      * Gets the component.
@@ -99,9 +109,8 @@ public interface EnforcerRuleHelper
      *
      * @throws ComponentLookupException the component lookup exception
      */
-    <T> T getComponent ( Class<T> clazz, String roleHint )
-        throws ComponentLookupException;
-    
+    <T> T getComponent(Class<T> clazz, String roleHint) throws ComponentLookupException;
+
     /**
      * Gets the component map.
      *
@@ -111,8 +120,7 @@ public interface EnforcerRuleHelper
      *
      * @throws ComponentLookupException the component lookup exception
      */
-    Map<String, ?> getComponentMap ( String role )
-        throws ComponentLookupException;
+    Map<String, ?> getComponentMap(String role) throws ComponentLookupException;
 
     /**
      * Gets the component list.
@@ -123,8 +131,7 @@ public interface EnforcerRuleHelper
      *
      * @throws ComponentLookupException the component lookup exception
      */
-    List<?> getComponentList ( String role )
-        throws ComponentLookupException;
+    List<?> getComponentList(String role) throws ComponentLookupException;
 
     /**
      * Gets the container.
@@ -140,5 +147,5 @@ public interface EnforcerRuleHelper
      * @param producer a supplier for the value if it's not already present
      * @return a previously-cached or freshly-computed value
      */
-    Object getCache( String key, Supplier<?> producer );
+    Object getCache(String key, Supplier<?> producer);
 }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDependencies.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDependencies.java
index 4148c6f..539990d 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDependencies.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDependencies.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -19,6 +37,8 @@ package org.apache.maven.plugins.enforcer;
  * under the License.
  */
 
+import java.util.HashSet;
+import java.util.Set;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
@@ -34,17 +54,12 @@ import org.apache.maven.shared.dependency.graph.DependencyNode;
 import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException;
 import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
 
-import java.util.HashSet;
-import java.util.Set;
-
 /**
  * Abstract Rule for banning dependencies.
  *
  * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
  */
-public abstract class AbstractBanDependencies
-    extends AbstractNonCacheableEnforcerRule
-{
+public abstract class AbstractBanDependencies extends AbstractNonCacheableEnforcerRule {
 
     /** Specify if transitive dependencies should be searched (default) or only look at direct dependencies. */
     private boolean searchTransitive = true;
@@ -52,109 +67,82 @@ public abstract class AbstractBanDependencies
     private transient DependencyGraphBuilder graphBuilder;
 
     @Override
-    public void execute( EnforcerRuleHelper helper )
-        throws EnforcerRuleException
-    {
+    public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
         MavenProject project;
-        try
-        {
-            project = (MavenProject) helper.evaluate( "${project}" );
-        }
-        catch ( ExpressionEvaluationException eee )
-        {
-            throw new EnforcerRuleException( "Unable to retrieve the MavenProject: ", eee );
+        try {
+            project = (MavenProject) helper.evaluate("${project}");
+        } catch (ExpressionEvaluationException eee) {
+            throw new EnforcerRuleException("Unable to retrieve the MavenProject: ", eee);
         }
 
         MavenSession session;
-        try
-        {
-            session = (MavenSession) helper.evaluate( "${session}" );
-        }
-        catch ( ExpressionEvaluationException eee )
-        {
-            throw new EnforcerRuleException( "Unable to retrieve the reactor MavenProject: ", eee );
+        try {
+            session = (MavenSession) helper.evaluate("${session}");
+        } catch (ExpressionEvaluationException eee) {
+            throw new EnforcerRuleException("Unable to retrieve the reactor MavenProject: ", eee);
         }
 
-        try
-        {
-            graphBuilder = helper.getComponent( DependencyGraphBuilder.class );
-        }
-        catch ( ComponentLookupException e )
-        {
-            throw new EnforcerRuleException( "Unable to lookup DependencyGraphBuilder: ", e );
+        try {
+            graphBuilder = helper.getComponent(DependencyGraphBuilder.class);
+        } catch (ComponentLookupException e) {
+            throw new EnforcerRuleException("Unable to lookup DependencyGraphBuilder: ", e);
         }
-        
-        ProjectBuildingRequest buildingRequest =
-            new DefaultProjectBuildingRequest( session.getProjectBuildingRequest() );
-        buildingRequest.setProject( project );
+
+        ProjectBuildingRequest buildingRequest = new DefaultProjectBuildingRequest(session.getProjectBuildingRequest());
+        buildingRequest.setProject(project);
 
         // get the correct list of dependencies
-        Set<Artifact> dependencies = getDependenciesToCheck( helper, buildingRequest );
+        Set<Artifact> dependencies = getDependenciesToCheck(helper, buildingRequest);
 
         // look for banned dependencies
-        Set<Artifact> foundExcludes = checkDependencies( dependencies, helper.getLog() );
+        Set<Artifact> foundExcludes = checkDependencies(dependencies, helper.getLog());
 
         // if any are found, fail the check but list all of them
-        if ( foundExcludes != null && !foundExcludes.isEmpty() )
-        {
+        if (foundExcludes != null && !foundExcludes.isEmpty()) {
             String message = getMessage();
 
             StringBuilder buf = new StringBuilder();
-            if ( message != null )
-            {
-                buf.append( message + System.lineSeparator() );
+            if (message != null) {
+                buf.append(message + System.lineSeparator());
             }
-            for ( Artifact artifact : foundExcludes )
-            {
-                buf.append( getErrorMessage( artifact ) );
+            for (Artifact artifact : foundExcludes) {
+                buf.append(getErrorMessage(artifact));
             }
             message = buf.toString() + "Use 'mvn dependency:tree' to locate the source of the banned dependencies.";
 
-            throw new EnforcerRuleException( message );
+            throw new EnforcerRuleException(message);
         }
-
     }
 
-    protected CharSequence getErrorMessage( Artifact artifact )
-    {
+    protected CharSequence getErrorMessage(Artifact artifact) {
         return "Found Banned Dependency: " + artifact.getId() + System.lineSeparator();
     }
 
-    private Set<Artifact> getDependenciesToCheck( EnforcerRuleHelper helper,
-            ProjectBuildingRequest buildingRequest )
-    {
+    private Set<Artifact> getDependenciesToCheck(EnforcerRuleHelper helper, ProjectBuildingRequest buildingRequest) {
         String cacheKey = buildingRequest.getProject().getId() + "_" + searchTransitive;
 
         // check in the cache
         Set<Artifact> dependencies =
-                (Set<Artifact>) helper.getCache( cacheKey, () -> getDependenciesToCheck( buildingRequest ) );
+                (Set<Artifact>) helper.getCache(cacheKey, () -> getDependenciesToCheck(buildingRequest));
 
         return dependencies;
     }
 
-    protected Set<Artifact> getDependenciesToCheck( ProjectBuildingRequest buildingRequest )
-    {
+    protected Set<Artifact> getDependenciesToCheck(ProjectBuildingRequest buildingRequest) {
         Set<Artifact> dependencies = null;
-        try
-        {
-            DependencyNode node = graphBuilder.buildDependencyGraph( buildingRequest, null );
-            if ( searchTransitive )
-            {
-                dependencies = ArtifactUtils.getAllDescendants( node );
-            }
-            else if ( node.getChildren() != null )
-            {
+        try {
+            DependencyNode node = graphBuilder.buildDependencyGraph(buildingRequest, null);
+            if (searchTransitive) {
+                dependencies = ArtifactUtils.getAllDescendants(node);
+            } else if (node.getChildren() != null) {
                 dependencies = new HashSet<>();
-                for ( DependencyNode depNode : node.getChildren() )
-                {
-                    dependencies.add( depNode.getArtifact() );
+                for (DependencyNode depNode : node.getChildren()) {
+                    dependencies.add(depNode.getArtifact());
                 }
             }
-        }
-        catch ( DependencyGraphBuilderException e )
-        {
+        } catch (DependencyGraphBuilderException e) {
             // otherwise we need to change the signature of this protected method
-            throw new RuntimeException( e );
+            throw new RuntimeException(e);
         }
         return dependencies;
     }
@@ -167,16 +155,15 @@ public abstract class AbstractBanDependencies
      * @return the sets the
      * @throws EnforcerRuleException the enforcer rule exception
      */
-    protected abstract Set<Artifact> checkDependencies( Set<Artifact> dependencies, Log log )
-        throws EnforcerRuleException;
+    protected abstract Set<Artifact> checkDependencies(Set<Artifact> dependencies, Log log)
+            throws EnforcerRuleException;
 
     /**
      * Checks if is search transitive.
      *
      * @return the searchTransitive
      */
-    public boolean isSearchTransitive()
-    {
+    public boolean isSearchTransitive() {
         return this.searchTransitive;
     }
 
@@ -185,9 +172,7 @@ public abstract class AbstractBanDependencies
      *
      * @param theSearchTransitive the searchTransitive to set
      */
-    public void setSearchTransitive( boolean theSearchTransitive )
-    {
+    public void setSearchTransitive(boolean theSearchTransitive) {
         this.searchTransitive = theSearchTransitive;
     }
-
 }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractNonCacheableEnforcerRule.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractNonCacheableEnforcerRule.java
index 169c641..3695413 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractNonCacheableEnforcerRule.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractNonCacheableEnforcerRule.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -27,24 +45,19 @@ import org.apache.maven.enforcer.rule.api.EnforcerRule;
  *
  * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
  */
-public abstract class AbstractNonCacheableEnforcerRule
-    extends AbstractStandardEnforcerRule
-{
+public abstract class AbstractNonCacheableEnforcerRule extends AbstractStandardEnforcerRule {
     @Override
-    public String getCacheId()
-    {
+    public String getCacheId() {
         return "0";
     }
 
     @Override
-    public boolean isCacheable()
-    {
+    public boolean isCacheable() {
         return false;
     }
 
     @Override
-    public boolean isResultValid( EnforcerRule cachedRule )
-    {
+    public boolean isResultValid(EnforcerRule cachedRule) {
         return false;
     }
 }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractPropertyEnforcerRule.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractPropertyEnforcerRule.java
index 2045b0c..4f5c007 100755
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractPropertyEnforcerRule.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractPropertyEnforcerRule.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -28,13 +46,11 @@ import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
  * @author Paul Gier
  * @author <a href='mailto:marvin[at]marvinformatics[dot]com'>Marvin Froeder</a>
  */
-public abstract class AbstractPropertyEnforcerRule
-    extends AbstractNonCacheableEnforcerRule
-{
+public abstract class AbstractPropertyEnforcerRule extends AbstractNonCacheableEnforcerRule {
 
     /**
      * Match the property value to a given regular expression. Defaults to <code>null</code> (any value is ok).
-     * 
+     *
      * @see {@link #setRegex(String)}
      * @see {@link #getRegex()}
      */
@@ -42,82 +58,71 @@ public abstract class AbstractPropertyEnforcerRule
 
     /**
      * Specify a warning message if the regular expression is not matched.
-     * 
+     *
      * @see {@link #setRegexMessage(String)}
      * @see {@link #getRegexMessage()}
      */
     private String regexMessage = null;
 
-    public AbstractPropertyEnforcerRule()
-    {
+    public AbstractPropertyEnforcerRule() {
         super();
     }
-    
+
     /**
      * Set the property value to a given regular expression. Defaults to <code>null</code> (any value is ok).
-     * 
+     *
      * @param regex The regular expression
      */
-    public final void setRegex( String regex )
-    {
+    public final void setRegex(String regex) {
         this.regex = regex;
     }
 
     /**
      * Get the property value to a given regular expression. Defaults to <code>null</code> (any value is ok).
-     * 
+     *
      * @return the regular expression
      */
-    public final String getRegex()
-    {
+    public final String getRegex() {
         return regex;
     }
-    
+
     /**
      * Set a warning message if the regular expression is not matched.
-     * 
+     *
      * @param regexMessage the regex message
      */
-    public final void setRegexMessage( String regexMessage )
-    {
+    public final void setRegexMessage(String regexMessage) {
         this.regexMessage = regexMessage;
     }
-    
+
     /**
      * Get a warning message if the regular expression is not matched.
-     * 
+     *
      * @return the regex message
      */
-    public final String getRegexMessage()
-    {
+    public final String getRegexMessage() {
         return regexMessage;
     }
 
     @Override
-    public void execute( EnforcerRuleHelper helper )
-        throws EnforcerRuleException
-    {
-        Object propValue = resolveValue( helper );
+    public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
+        Object propValue = resolveValue(helper);
 
         // Check that the property is not null or empty string
-        if ( propValue == null )
-        {
+        if (propValue == null) {
             String message = getMessage();
-            if ( message == null )
-            {
+            if (message == null) {
                 message = getName() + " \"" + getPropertyName() + "\" is required for this build.";
             }
-            throw new EnforcerRuleException( message );
+            throw new EnforcerRuleException(message);
         }
         // If there is a regex, check that the property matches it
-        if ( regex != null && !propValue.toString().matches( regex ) )
-        {
-            if ( regexMessage == null )
-            {
+        if (regex != null && !propValue.toString().matches(regex)) {
+            if (regexMessage == null) {
                 regexMessage = getName() + " \"" + getPropertyName() + "\" evaluates to \"" + propValue + "\".  "
-                    + "This does not match the regular expression \"" + regex + "\"";
+                        + "This does not match the regular expression \"" + regex + "\"";
             }
-            throw new EnforcerRuleException( regexMessage );
+            throw new EnforcerRuleException(regexMessage);
         }
     }
 
@@ -129,7 +134,7 @@ public abstract class AbstractPropertyEnforcerRule
 
     /**
      * The name of the property currently being evaluated, this is used for default message purposes only
-     * 
+     *
      * @return the name of the property
      */
     protected abstract String getPropertyName();
@@ -140,7 +145,5 @@ public abstract class AbstractPropertyEnforcerRule
      * @param helper
      * @throws EnforcerRuleException
      */
-    protected abstract Object resolveValue( EnforcerRuleHelper helper )
-        throws EnforcerRuleException;
-
+    protected abstract Object resolveValue(EnforcerRuleHelper helper) throws EnforcerRuleException;
 }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractRequireFiles.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractRequireFiles.java
index 0d40987..cda4277 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractRequireFiles.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractRequireFiles.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -22,7 +40,6 @@ package org.apache.maven.plugins.enforcer;
 import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
-
 import org.apache.maven.enforcer.rule.api.EnforcerRule;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
@@ -32,9 +49,7 @@ import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
  *
  * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
  */
-public abstract class AbstractRequireFiles
-    extends AbstractStandardEnforcerRule
-{
+public abstract class AbstractRequireFiles extends AbstractStandardEnforcerRule {
 
     /** Array of files to check. */
     private File[] files;
@@ -52,7 +67,7 @@ public abstract class AbstractRequireFiles
      * @param file the file
      * @return <code>true</code> if successful
      */
-    abstract boolean checkFile( File file );
+    abstract boolean checkFile(File file);
 
     // return standard error message
     /**
@@ -63,74 +78,56 @@ public abstract class AbstractRequireFiles
     abstract String getErrorMsg();
 
     @Override
-    public void execute( EnforcerRuleHelper helper )
-        throws EnforcerRuleException
-    {
+    public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
 
-        if ( !allowNulls && files.length == 0 )
-        {
-            throw new EnforcerRuleException( "The file list is empty and Null files are disabled." );
+        if (!allowNulls && files.length == 0) {
+            throw new EnforcerRuleException("The file list is empty and Null files are disabled.");
         }
 
         List<File> failures = new ArrayList<>();
-        for ( File file : files )
-        {
-            if ( !allowNulls && file == null )
-            {
-                failures.add( file );
-            }
-            else if ( !checkFile( file ) )
-            {
-                failures.add( file );
+        for (File file : files) {
+            if (!allowNulls && file == null) {
+                failures.add(file);
+            } else if (!checkFile(file)) {
+                failures.add(file);
             }
         }
 
-        if ( satisfyAny )
-        {
+        if (satisfyAny) {
             int passed = files.length - failures.size();
-            if ( passed == 0 )
-            {
-                fail( failures );
+            if (passed == 0) {
+                fail(failures);
             }
         }
         // if anything was found, log it with the optional message.
-        else if ( !failures.isEmpty() )
-        {
-            fail( failures );
+        else if (!failures.isEmpty()) {
+            fail(failures);
         }
     }
 
-    private void fail( List<File> failures )
-            throws EnforcerRuleException
-    {
+    private void fail(List<File> failures) throws EnforcerRuleException {
         String message = getMessage();
 
         StringBuilder buf = new StringBuilder();
-        if ( message != null )
-        {
-            buf.append( message + System.lineSeparator() );
+        if (message != null) {
+            buf.append(message + System.lineSeparator());
         }
-        buf.append( getErrorMsg() );
+        buf.append(getErrorMsg());
 
-        for ( File file : failures )
-        {
-            if ( file != null )
-            {
-                buf.append( file.getAbsolutePath() + System.lineSeparator() );
-            }
-            else
-            {
-                buf.append( "(an empty filename was given and allowNulls is false)" + System.lineSeparator() );
+        for (File file : failures) {
+            if (file != null) {
+                buf.append(file.getAbsolutePath() + System.lineSeparator());
+            } else {
+                buf.append("(an empty filename was given and allowNulls is false)" + System.lineSeparator());
             }
         }
 
-        throw new EnforcerRuleException( buf.toString() );
+        throw new EnforcerRuleException(buf.toString());
     }
 
     @Override
-    public String getCacheId()
-    {
-        return Integer.toString( hashCode( files ) );
+    public String getCacheId() {
+        return Integer.toString(hashCode(files));
     }
 
     /**
@@ -140,59 +137,48 @@ public abstract class AbstractRequireFiles
      * @param items The array for which to compute the hash code, may be <code>null</code>.
      * @return The hash code for the array.
      */
-    private static int hashCode( Object[] items )
-    {
+    private static int hashCode(Object[] items) {
         int hash = 0;
-        if ( items != null )
-        {
+        if (items != null) {
             hash = 1;
-            for ( Object item : items )
-            {
-                hash = 31 * hash + ( item == null ? 0 : item.hashCode() );
+            for (Object item : items) {
+                hash = 31 * hash + (item == null ? 0 : item.hashCode());
             }
         }
         return hash;
     }
 
     @Override
-    public boolean isCacheable()
-    {
+    public boolean isCacheable() {
         return true;
     }
 
     @Override
-    public boolean isResultValid( EnforcerRule cachedRule )
-    {
+    public boolean isResultValid(EnforcerRule cachedRule) {
         return true;
     }
 
-    public File[] getFiles()
-    {
+    public File[] getFiles() {
         return files;
     }
 
-    public void setFiles( File[] files )
-    {
+    public void setFiles(File[] files) {
         this.files = files;
     }
 
-    public boolean isAllowNulls()
-    {
+    public boolean isAllowNulls() {
         return allowNulls;
     }
 
-    public void setAllowNulls( boolean allowNulls )
-    {
+    public void setAllowNulls(boolean allowNulls) {
         this.allowNulls = allowNulls;
     }
 
-    public boolean isSatisfyAny()
-    {
+    public boolean isSatisfyAny() {
         return satisfyAny;
     }
 
-    public void setSatisfyAny( boolean satisfyAny )
-    {
+    public void setSatisfyAny(boolean satisfyAny) {
         this.satisfyAny = satisfyAny;
     }
 }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractStandardEnforcerRule.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractStandardEnforcerRule.java
index f369259..617b1b5 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractStandardEnforcerRule.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractStandardEnforcerRule.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -27,9 +45,7 @@ import org.apache.maven.project.MavenProject;
 /**
  * The Class AbstractStandardEnforcerRule.
  */
-public abstract class AbstractStandardEnforcerRule
-    implements EnforcerRule2
-{
+public abstract class AbstractStandardEnforcerRule implements EnforcerRule2 {
 
     /**
      * Specify a friendly message if the rule fails.
@@ -41,24 +57,20 @@ public abstract class AbstractStandardEnforcerRule
 
     private EnforcerLevel level = EnforcerLevel.ERROR;
 
-    public final void setMessage( String message )
-    {
+    public final void setMessage(String message) {
         this.message = message;
     }
 
-    public final String getMessage()
-    {
+    public final String getMessage() {
         return message;
     }
 
     @Override
-    public EnforcerLevel getLevel()
-    {
+    public EnforcerLevel getLevel() {
         return level;
     }
 
-    public void setLevel( EnforcerLevel level )
-    {
+    public void setLevel(EnforcerLevel level) {
         this.level = level;
     }
 
@@ -67,20 +79,24 @@ public abstract class AbstractStandardEnforcerRule
      * @param project the project
      * @return the identifier of the project in the format {@code <groupId>:<artifactId>:<version>}
      */
-    private static String getProjectId( MavenProject project )
-    {
-        StringBuilder buffer = new StringBuilder( 128 );
-    
-        buffer.append( ( project.getGroupId() != null && project.getGroupId().length() > 0 ) ? project.getGroupId()
-                        : "[unknown-group-id]" );
-        buffer.append( ':' );
-        buffer.append( ( project.getArtifactId() != null && project.getArtifactId().length() > 0 )
+    private static String getProjectId(MavenProject project) {
+        StringBuilder buffer = new StringBuilder(128);
+
+        buffer.append(
+                (project.getGroupId() != null && project.getGroupId().length() > 0)
+                        ? project.getGroupId()
+                        : "[unknown-group-id]");
+        buffer.append(':');
+        buffer.append(
+                (project.getArtifactId() != null && project.getArtifactId().length() > 0)
                         ? project.getArtifactId()
-                        : "[unknown-artifact-id]" );
-        buffer.append( ':' );
-        buffer.append( ( project.getVersion() != null && project.getVersion().length() > 0 ) ? project.getVersion()
-                        : "[unknown-version]" );
-    
+                        : "[unknown-artifact-id]");
+        buffer.append(':');
+        buffer.append(
+                (project.getVersion() != null && project.getVersion().length() > 0)
+                        ? project.getVersion()
+                        : "[unknown-version]");
+
         return buffer.toString();
     }
 
@@ -92,40 +108,31 @@ public abstract class AbstractStandardEnforcerRule
      * @param location The location which should be formatted, must not be {@code null}.
      * @return The formatted problem location or an empty string if unknown, never {@code null}.
      */
-    protected static String formatLocation( MavenProject project, InputLocation location )
-    {
+    protected static String formatLocation(MavenProject project, InputLocation location) {
         StringBuilder buffer = new StringBuilder();
-    
-        if ( !location.getSource().getModelId().equals( getProjectId( project ) ) )
-        {
-            buffer.append( location.getSource().getModelId() );
-    
-            if ( location.getSource().getLocation().length() > 0 )
-            {
-                if ( buffer.length() > 0 )
-                {
-                    buffer.append( ", " );
+
+        if (!location.getSource().getModelId().equals(getProjectId(project))) {
+            buffer.append(location.getSource().getModelId());
+
+            if (location.getSource().getLocation().length() > 0) {
+                if (buffer.length() > 0) {
+                    buffer.append(", ");
                 }
-                buffer.append( location.getSource().getLocation() );
+                buffer.append(location.getSource().getLocation());
             }
         }
-        if ( location.getLineNumber() > 0 )
-        {
-            if ( buffer.length() > 0 )
-            {
-                buffer.append( ", " );
+        if (location.getLineNumber() > 0) {
+            if (buffer.length() > 0) {
+                buffer.append(", ");
             }
-            buffer.append( "line " ).append( location.getLineNumber() );
+            buffer.append("line ").append(location.getLineNumber());
         }
-        if ( location.getColumnNumber() > 0 )
-        {
-            if ( buffer.length() > 0 )
-            {
-                buffer.append( ", " );
+        if (location.getColumnNumber() > 0) {
+            if (buffer.length() > 0) {
+                buffer.append(", ");
             }
-            buffer.append( "column " ).append( location.getColumnNumber() );
+            buffer.append("column ").append(location.getColumnNumber());
         }
         return buffer.toString();
     }
-
 }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractVersionEnforcer.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractVersionEnforcer.java
index 2dbfc3f..facded0 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractVersionEnforcer.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractVersionEnforcer.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -32,9 +50,7 @@ import org.codehaus.plexus.util.StringUtils;
  *
  * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
  */
-public abstract class AbstractVersionEnforcer
-    extends AbstractStandardEnforcerRule
-{
+public abstract class AbstractVersionEnforcer extends AbstractStandardEnforcerRule {
 
     /**
      * Specify the required version. Some examples are:
@@ -45,7 +61,7 @@ public abstract class AbstractVersionEnforcer
      * <li><code>[2.0.5,)</code> Versions 2.0.5 and higher</li>
      * <li><code>(,2.0.5],[2.1.1,)</code> Versions up to 2.0.5 (included) and 2.1.1 or higher</li>
      * </ul>
-     * 
+     *
      * @see {@link #setVersion(String)}
      * @see {@link #getVersion()}
      */
@@ -61,51 +77,38 @@ public abstract class AbstractVersionEnforcer
      * @throws EnforcerRuleException the enforcer rule exception
      */
     // CHECKSTYLE_OFF: LineLength
-    public void enforceVersion( Log log, String variableName, String requiredVersionRange, ArtifactVersion actualVersion )
-        throws EnforcerRuleException
-    // CHECKSTYLE_ON: LineLength
-    {
-        if ( StringUtils.isEmpty( requiredVersionRange ) )
-        {
-            throw new EnforcerRuleException( variableName + " version can't be empty." );
-        }
-        else
-        {
+    public void enforceVersion(Log log, String variableName, String requiredVersionRange, ArtifactVersion actualVersion)
+            throws EnforcerRuleException
+                // CHECKSTYLE_ON: LineLength
+            {
+        if (StringUtils.isEmpty(requiredVersionRange)) {
+            throw new EnforcerRuleException(variableName + " version can't be empty.");
+        } else {
 
             VersionRange vr;
             String msg = "Detected " + variableName + " Version: " + actualVersion;
 
             // short circuit check if the strings are exactly equal
-            if ( actualVersion.toString().equals( requiredVersionRange ) )
-            {
-                log.debug( msg + " is allowed in the range " + requiredVersionRange + "." );
-            }
-            else
-            {
-                try
-                {
-                    vr = VersionRange.createFromVersionSpec( requiredVersionRange );
-
-                    if ( containsVersion( vr, actualVersion ) )
-                    {
-                        log.debug( msg + " is allowed in the range " + requiredVersionRange + "." );
-                    }
-                    else
-                    {
+            if (actualVersion.toString().equals(requiredVersionRange)) {
+                log.debug(msg + " is allowed in the range " + requiredVersionRange + ".");
+            } else {
+                try {
+                    vr = VersionRange.createFromVersionSpec(requiredVersionRange);
+
+                    if (containsVersion(vr, actualVersion)) {
+                        log.debug(msg + " is allowed in the range " + requiredVersionRange + ".");
+                    } else {
                         String message = getMessage();
 
-                        if ( StringUtils.isEmpty( message ) )
-                        {
+                        if (StringUtils.isEmpty(message)) {
                             message = msg + " is not in the allowed range " + vr + ".";
                         }
 
-                        throw new EnforcerRuleException( message );
+                        throw new EnforcerRuleException(message);
                     }
-                }
-                catch ( InvalidVersionSpecificationException e )
-                {
-                    throw new EnforcerRuleException( "The requested " + variableName + " version "
-                        + requiredVersionRange + " is invalid.", e );
+                } catch (InvalidVersionSpecificationException e) {
+                    throw new EnforcerRuleException(
+                            "The requested " + variableName + " version " + requiredVersionRange + " is invalid.", e);
                 }
             }
         }
@@ -120,46 +123,35 @@ public abstract class AbstractVersionEnforcer
      * @param theVersion the version to be checked.
      * @return true if the version is contained by the range.
      */
-    public static boolean containsVersion( VersionRange allowedRange, ArtifactVersion theVersion )
-    {
+    public static boolean containsVersion(VersionRange allowedRange, ArtifactVersion theVersion) {
         ArtifactVersion recommendedVersion = allowedRange.getRecommendedVersion();
-        if ( recommendedVersion == null )
-        {
-            return allowedRange.containsVersion( theVersion );
-        }
-        else
-        {
+        if (recommendedVersion == null) {
+            return allowedRange.containsVersion(theVersion);
+        } else {
             // only singular versions ever have a recommendedVersion
-            int compareTo = recommendedVersion.compareTo( theVersion );
-            return ( compareTo <= 0 );
+            int compareTo = recommendedVersion.compareTo(theVersion);
+            return (compareTo <= 0);
         }
     }
 
     @Override
-    public String getCacheId()
-    {
-        if ( StringUtils.isNotEmpty( version ) )
-        {
+    public String getCacheId() {
+        if (StringUtils.isNotEmpty(version)) {
             // return the hashcodes of the parameter that matters
             return "" + version.hashCode();
-        }
-        else
-        {
+        } else {
             return "0";
         }
-
     }
 
     @Override
-    public boolean isCacheable()
-    {
+    public boolean isCacheable() {
         // the maven version is not going to change between projects in the same build.
         return true;
     }
 
     @Override
-    public boolean isResultValid( EnforcerRule theCachedRule )
-    {
+    public boolean isResultValid(EnforcerRule theCachedRule) {
         // i will always return the hash of the parameters as my id. If my parameters are the same, this
         // rule must always have the same result.
         return true;
@@ -170,8 +162,7 @@ public abstract class AbstractVersionEnforcer
      *
      * @return the required version
      */
-    public final String getVersion()
-    {
+    public final String getVersion() {
         return this.version;
     }
 
@@ -187,9 +178,7 @@ public abstract class AbstractVersionEnforcer
      *
      * @param theVersion the required version to set
      */
-    public final void setVersion( String theVersion )
-    {
+    public final void setVersion(String theVersion) {
         this.version = theVersion;
     }
-
 }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AlwaysFail.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AlwaysFail.java
index e40a7b5..1632155 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AlwaysFail.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AlwaysFail.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -27,22 +45,17 @@ import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
  * profile is enabled.
  * @author Ben Lidgey
  */
-public class AlwaysFail
-    extends AbstractNonCacheableEnforcerRule
-{
+public class AlwaysFail extends AbstractNonCacheableEnforcerRule {
 
     @Override
-    public void execute( EnforcerRuleHelper helper )
-        throws EnforcerRuleException
-    {
+    public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
         String message = getMessage();
-        
+
         StringBuilder buf = new StringBuilder();
-        if ( message != null )
-        {
-            buf.append( message ).append( System.lineSeparator() );
+        if (message != null) {
+            buf.append(message).append(System.lineSeparator());
         }
-        buf.append( "Always fails!" );
-        throw new EnforcerRuleException( buf.toString() );
+        buf.append("Always fails!");
+        throw new EnforcerRuleException(buf.toString());
     }
 }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AlwaysPass.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AlwaysPass.java
index f5906e1..8736639 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AlwaysPass.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AlwaysPass.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -27,25 +45,19 @@ import org.apache.maven.plugin.logging.Log;
  * Always pass. This rule is useful for testing the Enforcer configuration.
  * @author Ben Lidgey
  */
-public class AlwaysPass
-    extends AbstractNonCacheableEnforcerRule
-{
+public class AlwaysPass extends AbstractNonCacheableEnforcerRule {
 
     @Override
-    public void execute( EnforcerRuleHelper helper )
-        throws EnforcerRuleException
-    {
+    public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
         final Log log = helper.getLog();
-        
+
         String message = getMessage();
 
         StringBuilder buf = new StringBuilder();
-        if ( message != null )
-        {
-            buf.append( message ).append( System.lineSeparator() );
+        if (message != null) {
+            buf.append(message).append(System.lineSeparator());
         }
-        buf.append( "Always pass!" );
-        log.info( buf.toString() );
+        buf.append("Always pass!");
+        log.info(buf.toString());
     }
-
 }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDependencyManagementScope.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDependencyManagementScope.java
index 06b9461..e40e7af 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDependencyManagementScope.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDependencyManagementScope.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -22,7 +40,6 @@ package org.apache.maven.plugins.enforcer;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
-
 import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
 import org.apache.maven.enforcer.rule.api.EnforcerRule2;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
@@ -35,13 +52,10 @@ import org.apache.maven.project.MavenProject;
 import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException;
 
 /**
- * This rule bans all scope values except for {@code import} from dependencies within the dependency management. 
+ * This rule bans all scope values except for {@code import} from dependencies within the dependency management.
  * There is a configuration option to ignore certain dependencies in this check.
  */
-public class BanDependencyManagementScope
-    extends AbstractNonCacheableEnforcerRule
-    implements EnforcerRule2
-{
+public class BanDependencyManagementScope extends AbstractNonCacheableEnforcerRule implements EnforcerRule2 {
 
     /**
      * Specify the dependencies that will be ignored. This can be a list of artifacts in the format
@@ -60,95 +74,73 @@ public class BanDependencyManagementScope
     private boolean checkEffectivePom = false;
 
     @Override
-    public void execute( EnforcerRuleHelper helper )
-        throws EnforcerRuleException
-    {
+    public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
         Log logger = helper.getLog();
         MavenProject project;
-        try
-        {
-            project = (MavenProject) helper.evaluate( "${project}" );
-            if ( project == null )
-            {
-                throw new EnforcerRuleException( "${project} is null" );
+        try {
+            project = (MavenProject) helper.evaluate("${project}");
+            if (project == null) {
+                throw new EnforcerRuleException("${project} is null");
             }
             // only evaluate local depMgmt, without taking into account inheritance and interpolation
-            DependencyManagement depMgmt = checkEffectivePom ? project.getModel().getDependencyManagement()
-                            : project.getOriginalModel().getDependencyManagement();
-            if ( depMgmt != null && depMgmt.getDependencies() != null )
-            {
-                List<Dependency> violatingDependencies  = getViolatingDependencies( logger, depMgmt );
-                if ( !violatingDependencies.isEmpty() )
-                {
+            DependencyManagement depMgmt = checkEffectivePom
+                    ? project.getModel().getDependencyManagement()
+                    : project.getOriginalModel().getDependencyManagement();
+            if (depMgmt != null && depMgmt.getDependencies() != null) {
+                List<Dependency> violatingDependencies = getViolatingDependencies(logger, depMgmt);
+                if (!violatingDependencies.isEmpty()) {
                     String message = getMessage();
                     StringBuilder buf = new StringBuilder();
-                    if ( message == null )
-                    {
+                    if (message == null) {
                         message = "Scope other than 'import' is not allowed in 'dependencyManagement'";
                     }
-                    buf.append( message + System.lineSeparator() );
-                    for ( Dependency violatingDependency : violatingDependencies )
-                    {
-                        buf.append( getErrorMessage( project, violatingDependency ) );
+                    buf.append(message + System.lineSeparator());
+                    for (Dependency violatingDependency : violatingDependencies) {
+                        buf.append(getErrorMessage(project, violatingDependency));
                     }
-                    throw new EnforcerRuleException( buf.toString() );
+                    throw new EnforcerRuleException(buf.toString());
                 }
             }
-        }
-        catch ( ExpressionEvaluationException e )
-        {
-            throw new EnforcerRuleException( "Cannot resolve expression: " + e.getCause(), e );
-        }
-        catch ( InvalidVersionSpecificationException e )
-        {
-            throw new EnforcerRuleException( "Invalid version range give in excludes " + e.getCause(), e );
+        } catch (ExpressionEvaluationException e) {
+            throw new EnforcerRuleException("Cannot resolve expression: " + e.getCause(), e);
+        } catch (InvalidVersionSpecificationException e) {
+            throw new EnforcerRuleException("Invalid version range give in excludes " + e.getCause(), e);
         }
     }
 
-    protected List<Dependency> getViolatingDependencies( Log logger, DependencyManagement depMgmt )
-        throws InvalidVersionSpecificationException
-    {
+    protected List<Dependency> getViolatingDependencies(Log logger, DependencyManagement depMgmt)
+            throws InvalidVersionSpecificationException {
         final ArtifactMatcher excludesMatcher;
-        if ( excludes != null )
-        {
-            excludesMatcher = new ArtifactMatcher( excludes, Collections.emptyList() );
-        }
-        else
-        {
+        if (excludes != null) {
+            excludesMatcher = new ArtifactMatcher(excludes, Collections.emptyList());
+        } else {
             excludesMatcher = null;
         }
         List<Dependency> violatingDependencies = new ArrayList<>();
-        for ( Dependency dependency : depMgmt.getDependencies() )
-        {
-            if ( dependency.getScope() != null && !"import".equals( dependency.getScope() ) )
-            {
-                if ( excludesMatcher != null && excludesMatcher.match( dependency ) )
-                {
-                    logger.debug( "Skipping excluded dependency " + dependency + " with scope "
-                        + dependency.getScope() );
+        for (Dependency dependency : depMgmt.getDependencies()) {
+            if (dependency.getScope() != null && !"import".equals(dependency.getScope())) {
+                if (excludesMatcher != null && excludesMatcher.match(dependency)) {
+                    logger.debug("Skipping excluded dependency " + dependency + " with scope " + dependency.getScope());
                     continue;
                 }
-                violatingDependencies.add( dependency );
+                violatingDependencies.add(dependency);
             }
         }
         return violatingDependencies;
     }
 
-    private static CharSequence getErrorMessage( MavenProject project, Dependency violatingDependency )
-    {
+    private static CharSequence getErrorMessage(MavenProject project, Dependency violatingDependency) {
         return "Banned scope '" + violatingDependency.getScope() + "' used on dependency '"
-                        + violatingDependency.getManagementKey() + "' @ "
-                        + formatLocation( project, violatingDependency.getLocation( "" ) )
-                        + System.lineSeparator();
+                + violatingDependency.getManagementKey() + "' @ "
+                + formatLocation(project, violatingDependency.getLocation(""))
+                + System.lineSeparator();
     }
 
-    public void setExcludes( List<String> theExcludes )
-    {
+    public void setExcludes(List<String> theExcludes) {
         this.excludes = theExcludes;
     }
 
-    public void setCheckEffectivePom( boolean checkEffectivePom )
-    {
+    public void setCheckEffectivePom(boolean checkEffectivePom) {
         this.checkEffectivePom = checkEffectivePom;
     }
 }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDistributionManagement.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDistributionManagement.java
index 3f2d846..9924baf 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDistributionManagement.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDistributionManagement.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -30,13 +48,11 @@ import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluatio
  * This rule will check if a pom contains a <code>distributionManagement</code> part. This should be by best practice
  * only defined once. It could happen that you like to check the parent as well. This can be activated by using the
  * <code>ignoreParent</code> which is by default turned off (<code>true</code>) which means not to check the parent.
- * 
+ *
  * @author Karl Heinz Marbaise
  * @since 1.4
  */
-public class BanDistributionManagement
-    extends AbstractNonCacheableEnforcerRule
-{
+public class BanDistributionManagement extends AbstractNonCacheableEnforcerRule {
 
     /**
      * Allow using a repository entry in the distributionManagement area.
@@ -54,73 +70,54 @@ public class BanDistributionManagement
     private boolean allowSite = false;
 
     @Override
-    public void execute( EnforcerRuleHelper helper )
-        throws EnforcerRuleException
-    {
+    public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
         Log logger = helper.getLog();
 
-        try
-        {
-            MavenProject project = (MavenProject) helper.evaluate( "${project}" );
+        try {
+            MavenProject project = (MavenProject) helper.evaluate("${project}");
 
-            if ( project.isExecutionRoot() )
-            {
-                if ( project.getParent() == null )
-                {
+            if (project.isExecutionRoot()) {
+                if (project.getParent() == null) {
                     // Does it make sense to check something? If yes please make a JIRA ticket for it.
-                    logger.debug( "We have no parent and in the root of a build we don't check anything," );
-                    logger.debug( "because that is the location where we defined maven-enforcer-plugin." );
-                }
-                else
-                {
-                    logger.debug( "We are in the root of the execution and we have a parent." );
+                    logger.debug("We have no parent and in the root of a build we don't check anything,");
+                    logger.debug("because that is the location where we defined maven-enforcer-plugin.");
+                } else {
+                    logger.debug("We are in the root of the execution and we have a parent.");
 
-                    DistributionManagementCheck check = new DistributionManagementCheck( project );
-                    check.execute( isAllowRepository(), isAllowSnapshotRepository(), isAllowSite() );
+                    DistributionManagementCheck check = new DistributionManagementCheck(project);
+                    check.execute(isAllowRepository(), isAllowSnapshotRepository(), isAllowSite());
                 }
+            } else {
+                logger.debug("We are in a deeper level.");
+                DistributionManagementCheck check = new DistributionManagementCheck(project);
+                check.execute(isAllowRepository(), isAllowSnapshotRepository(), isAllowSite());
             }
-            else
-            {
-                logger.debug( "We are in a deeper level." );
-                DistributionManagementCheck check = new DistributionManagementCheck( project );
-                check.execute( isAllowRepository(), isAllowSnapshotRepository(), isAllowSite() );
-
-            }
-        }
-        catch ( ExpressionEvaluationException e )
-        {
-            throw new EnforcerRuleException( e.getMessage(), e );
+        } catch (ExpressionEvaluationException e) {
+            throw new EnforcerRuleException(e.getMessage(), e);
         }
     }
 
-    public boolean isAllowRepository()
-    {
+    public boolean isAllowRepository() {
         return allowRepository;
     }
 
-    public void setAllowRepository( boolean allowRepository )
-    {
+    public void setAllowRepository(boolean allowRepository) {
         this.allowRepository = allowRepository;
     }
 
-    public boolean isAllowSnapshotRepository()
-    {
+    public boolean isAllowSnapshotRepository() {
         return allowSnapshotRepository;
     }
 
-    public void setAllowSnapshotRepository( boolean allowSnapshotRepository )
-    {
+    public void setAllowSnapshotRepository(boolean allowSnapshotRepository) {
         this.allowSnapshotRepository = allowSnapshotRepository;
     }
 
-    public boolean isAllowSite()
-    {
+    public boolean isAllowSite() {
         return allowSite;
     }
 
-    public void setAllowSite( boolean allowSite )
-    {
+    public void setAllowSite(boolean allowSite) {
         this.allowSite = allowSite;
     }
-
 }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDuplicatePomDependencyVersions.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDuplicatePomDependencyVersions.java
index ed46d9f..ea9d8ff 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDuplicatePomDependencyVersions.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDuplicatePomDependencyVersions.java
@@ -1,201 +1,195 @@
-package org.apache.maven.plugins.enforcer;
-
-/*
- * 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.
- */
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
-import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
-import org.apache.maven.model.Dependency;
-import org.apache.maven.model.Model;
-import org.apache.maven.model.Profile;
-import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
-import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException;
-import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
-
-/**
- * Since Maven 3 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique. Early versions of Maven
- * 3 already warn, this rule can force to break a build for this reason.
- * 
- * @author Robert Scholte
- * @since 1.3
- */
-public class BanDuplicatePomDependencyVersions
-    extends AbstractNonCacheableEnforcerRule
-{
-    @Override
-    public void execute( EnforcerRuleHelper helper )
-        throws EnforcerRuleException
-    {
-        // get the project
-        MavenProject project;
-        try
-        {
-            project = (MavenProject) helper.evaluate( "${project}" );
-        }
-        catch ( ExpressionEvaluationException eee )
-        {
-            throw new EnforcerRuleException( "Unable to retrieve the MavenProject: ", eee );
-        }
-
-        // re-read model, because M3 uses optimized model
-        MavenXpp3Reader modelReader = new MavenXpp3Reader();
-
-        Model model;
-        try ( FileInputStream pomInputStream = new FileInputStream( project.getFile() ) )
-        {
-            model = modelReader.read( pomInputStream, false );
-        }
-        catch ( IOException | XmlPullParserException e )
-        {
-            throw new EnforcerRuleException( "Unable to retrieve the MavenProject: ", e );
-        }
-
-        // @todo reuse ModelValidator when possible
-
-        // Object modelValidator = null;
-        // try
-        // {
-        // modelValidator = helper.getComponent( "org.apache.maven.model.validation.ModelValidator" );
-        // }
-        // catch ( ComponentLookupException e1 )
-        // {
-        // // noop
-        // }
-
-        // if( modelValidator == null )
-        // {
-        maven2Validation( helper, model );
-        // }
-        // else
-        // {
-        // }
-    }
-
-    private void maven2Validation( EnforcerRuleHelper helper, Model model )
-        throws EnforcerRuleException
-    {
-        List<Dependency> dependencies = model.getDependencies();
-        Map<String, Integer> duplicateDependencies = validateDependencies( dependencies );
-
-        int duplicates = duplicateDependencies.size();
-
-        StringBuilder summary = new StringBuilder();
-        messageBuilder( duplicateDependencies, "dependencies.dependency", summary );
-
-        if ( model.getDependencyManagement() != null )
-        {
-            List<Dependency> managementDependencies = model.getDependencyManagement().getDependencies();
-            Map<String, Integer> duplicateManagementDependencies = validateDependencies( managementDependencies );
-            duplicates += duplicateManagementDependencies.size();
-
-            messageBuilder( duplicateManagementDependencies, "dependencyManagement.dependencies.dependency", summary );
-        }
-
-        List<Profile> profiles = model.getProfiles();
-        for ( Profile profile : profiles )
-        {
-            List<Dependency> profileDependencies = profile.getDependencies();
-
-            Map<String, Integer> duplicateProfileDependencies = validateDependencies( profileDependencies );
-
-            duplicates += duplicateProfileDependencies.size();
-
-            messageBuilder( duplicateProfileDependencies, "profiles.profile[" + profile.getId()
-                + "].dependencies.dependency", summary );
-
-            if ( profile.getDependencyManagement() != null )
-            {
-                List<Dependency> profileManagementDependencies = profile.getDependencyManagement().getDependencies();
-
-                Map<String, Integer> duplicateProfileManagementDependencies =
-                    validateDependencies( profileManagementDependencies );
-
-                duplicates += duplicateProfileManagementDependencies.size();
-
-                messageBuilder( duplicateProfileManagementDependencies, "profiles.profile[" + profile.getId()
-                    + "].dependencyManagement.dependencies.dependency", summary );
-            }
-        }
-
-        if ( summary.length() > 0 )
-        {
-            StringBuilder message = new StringBuilder();
-            message.append( "Found " )
-                .append( duplicates )
-                .append( " duplicate dependency " );
-            message.append( duplicateDependencies.size() == 1 ? "declaration" : "declarations" )
-                .append( " in this project:" + System.lineSeparator() );
-            message.append( summary );
-            throw new EnforcerRuleException( message.toString() );
-        }
-    }
-
-    private void messageBuilder( Map<String, Integer> duplicateDependencies, String prefix, StringBuilder message )
-    {
-        if ( !duplicateDependencies.isEmpty() )
-        {
-            for ( Map.Entry<String, Integer> entry : duplicateDependencies.entrySet() )
-            {
-                message.append( " - " )
-                    .append( prefix )
-                    .append( '[' )
-                    .append( entry.getKey() )
-                    .append( "] ( " )
-                    .append( entry.getValue() )
-                    .append( " times )" + System.lineSeparator() );
-            }
-        }
-    }
-
-    private Map<String, Integer> validateDependencies( List<Dependency> dependencies )
-        throws EnforcerRuleException
-    {
-        Map<String, Integer> duplicateDeps = new HashMap<>();
-        Set<String> deps = new HashSet<>();
-        for ( Dependency dependency : dependencies )
-        {
-            String key = dependency.getManagementKey();
-
-            if ( deps.contains( key ) )
-            {
-                int times = 1;
-                if ( duplicateDeps.containsKey( key ) )
-                {
-                    times = duplicateDeps.get( key );
-                }
-                duplicateDeps.put( key, times + 1 );
-            }
-            else
-            {
-                deps.add( key );
-            }
-        }
-        return duplicateDeps;
-    }
-
-}
+/*
+ * 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.
+ */
+package org.apache.maven.plugins.enforcer;
+
+/*
+ * 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.
+ */
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
+import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
+import org.apache.maven.model.Dependency;
+import org.apache.maven.model.Model;
+import org.apache.maven.model.Profile;
+import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+
+/**
+ * Since Maven 3 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique. Early versions of Maven
+ * 3 already warn, this rule can force to break a build for this reason.
+ *
+ * @author Robert Scholte
+ * @since 1.3
+ */
+public class BanDuplicatePomDependencyVersions extends AbstractNonCacheableEnforcerRule {
+    @Override
+    public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
+        // get the project
+        MavenProject project;
+        try {
+            project = (MavenProject) helper.evaluate("${project}");
+        } catch (ExpressionEvaluationException eee) {
+            throw new EnforcerRuleException("Unable to retrieve the MavenProject: ", eee);
+        }
+
+        // re-read model, because M3 uses optimized model
+        MavenXpp3Reader modelReader = new MavenXpp3Reader();
+
+        Model model;
+        try (FileInputStream pomInputStream = new FileInputStream(project.getFile())) {
+            model = modelReader.read(pomInputStream, false);
+        } catch (IOException | XmlPullParserException e) {
+            throw new EnforcerRuleException("Unable to retrieve the MavenProject: ", e);
+        }
+
+        // @todo reuse ModelValidator when possible
+
+        // Object modelValidator = null;
+        // try
+        // {
+        // modelValidator = helper.getComponent( "org.apache.maven.model.validation.ModelValidator" );
+        // }
+        // catch ( ComponentLookupException e1 )
+        // {
+        // // noop
+        // }
+
+        // if( modelValidator == null )
+        // {
+        maven2Validation(helper, model);
+        // }
+        // else
+        // {
+        // }
+    }
+
+    private void maven2Validation(EnforcerRuleHelper helper, Model model) throws EnforcerRuleException {
+        List<Dependency> dependencies = model.getDependencies();
+        Map<String, Integer> duplicateDependencies = validateDependencies(dependencies);
+
+        int duplicates = duplicateDependencies.size();
+
+        StringBuilder summary = new StringBuilder();
+        messageBuilder(duplicateDependencies, "dependencies.dependency", summary);
+
+        if (model.getDependencyManagement() != null) {
+            List<Dependency> managementDependencies =
+                    model.getDependencyManagement().getDependencies();
+            Map<String, Integer> duplicateManagementDependencies = validateDependencies(managementDependencies);
+            duplicates += duplicateManagementDependencies.size();
+
+            messageBuilder(duplicateManagementDependencies, "dependencyManagement.dependencies.dependency", summary);
+        }
+
+        List<Profile> profiles = model.getProfiles();
+        for (Profile profile : profiles) {
+            List<Dependency> profileDependencies = profile.getDependencies();
+
+            Map<String, Integer> duplicateProfileDependencies = validateDependencies(profileDependencies);
+
+            duplicates += duplicateProfileDependencies.size();
+
+            messageBuilder(
+                    duplicateProfileDependencies,
+                    "profiles.profile[" + profile.getId() + "].dependencies.dependency",
+                    summary);
+
+            if (profile.getDependencyManagement() != null) {
+                List<Dependency> profileManagementDependencies =
+                        profile.getDependencyManagement().getDependencies();
+
+                Map<String, Integer> duplicateProfileManagementDependencies =
+                        validateDependencies(profileManagementDependencies);
+
+                duplicates += duplicateProfileManagementDependencies.size();
+
+                messageBuilder(
+                        duplicateProfileManagementDependencies,
+                        "profiles.profile[" + profile.getId() + "].dependencyManagement.dependencies.dependency",
+                        summary);
+            }
+        }
+
+        if (summary.length() > 0) {
+            StringBuilder message = new StringBuilder();
+            message.append("Found ").append(duplicates).append(" duplicate dependency ");
+            message.append(duplicateDependencies.size() == 1 ? "declaration" : "declarations")
+                    .append(" in this project:" + System.lineSeparator());
+            message.append(summary);
+            throw new EnforcerRuleException(message.toString());
+        }
+    }
+
+    private void messageBuilder(Map<String, Integer> duplicateDependencies, String prefix, StringBuilder message) {
+        if (!duplicateDependencies.isEmpty()) {
+            for (Map.Entry<String, Integer> entry : duplicateDependencies.entrySet()) {
+                message.append(" - ")
+                        .append(prefix)
+                        .append('[')
+                        .append(entry.getKey())
+                        .append("] ( ")
+                        .append(entry.getValue())
+                        .append(" times )" + System.lineSeparator());
+            }
+        }
+    }
+
+    private Map<String, Integer> validateDependencies(List<Dependency> dependencies) throws EnforcerRuleException {
+        Map<String, Integer> duplicateDeps = new HashMap<>();
+        Set<String> deps = new HashSet<>();
+        for (Dependency dependency : dependencies) {
+            String key = dependency.getManagementKey();
+
+            if (deps.contains(key)) {
+                int times = 1;
+                if (duplicateDeps.containsKey(key)) {
+                    times = duplicateDeps.get(key);
+                }
+                duplicateDeps.put(key, times + 1);
+            } else {
+                deps.add(key);
+            }
+        }
+        return duplicateDeps;
+    }
+}
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDynamicVersions.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDynamicVersions.java
index c3a5cc0..fe71503 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDynamicVersions.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDynamicVersions.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -29,7 +47,6 @@ import java.util.List;
 import java.util.Objects;
 import java.util.function.Predicate;
 import java.util.stream.Collectors;
-
 import org.apache.maven.RepositoryUtils;
 import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
@@ -66,12 +83,10 @@ import org.eclipse.aether.version.VersionConstraint;
  * <li>the special placeholders {@code LATEST} or {@code RELEASE} or</li>
  * <li>versions ending with {@code -SNAPSHOT}.
  * </ul>
- * 
+ *
  * @since 3.2.0
  */
-public class BanDynamicVersions
-    extends AbstractNonCacheableEnforcerRule
-{
+public class BanDynamicVersions extends AbstractNonCacheableEnforcerRule {
 
     private static final String RELEASE = "RELEASE";
 
@@ -117,53 +132,44 @@ public class BanDynamicVersions
 
     /**
      * Specify the ignored dependencies. This can be a list of artifacts in the format
-     * <code>groupId[:artifactId[:version[:type[:scope:[classifier]]]]]</code>. 
+     * <code>groupId[:artifactId[:version[:type[:scope:[classifier]]]]]</code>.
      * Any of the sections can be a wildcard by using '*' (e.g. {@code group:*:1.0}).
      * <br>
      * Any of the ignored dependencies may have dynamic versions.
-     * 
+     *
      * @see {@link #setIgnores(List)}
      */
     private List<String> ignores = null;
 
-    public void setIgnores( List<String> ignores )
-    {
+    public void setIgnores(List<String> ignores) {
         this.ignores = ignores;
     }
 
-    public void setAllowSnapshots( boolean allowSnapshots )
-    {
+    public void setAllowSnapshots(boolean allowSnapshots) {
         this.allowSnapshots = allowSnapshots;
     }
 
-    public void setAllowLatest( boolean allowLatest )
-    {
+    public void setAllowLatest(boolean allowLatest) {
         this.allowLatest = allowLatest;
     }
 
-    public void setAllowRelease( boolean allowRelease )
-    {
+    public void setAllowRelease(boolean allowRelease) {
         this.allowRelease = allowRelease;
     }
 
-    public void setAllowRanges( boolean allowRanges )
-    {
+    public void setAllowRanges(boolean allowRanges) {
         this.allowRanges = allowRanges;
     }
 
-    public void setExcludeOptionals( boolean excludeOptionals )
-    {
+    public void setExcludeOptionals(boolean excludeOptionals) {
         this.excludeOptionals = excludeOptionals;
     }
 
-    public void setExcludedScopes( String[] excludedScopes )
-    {
+    public void setExcludedScopes(String[] excludedScopes) {
         this.excludedScopes = excludedScopes;
     }
 
-    private final class BannedDynamicVersionCollector
-        implements DependencyVisitor
-    {
+    private final class BannedDynamicVersionCollector implements DependencyVisitor {
 
         private final Log log;
 
@@ -175,13 +181,11 @@ public class BanDynamicVersions
 
         private final Predicate<DependencyNode> predicate;
 
-        public int getNumViolations()
-        {
+        public int getNumViolations() {
             return numViolations;
         }
 
-        BannedDynamicVersionCollector( Log log, Predicate<DependencyNode> predicate )
-        {
+        BannedDynamicVersionCollector(Log log, Predicate<DependencyNode> predicate) {
             this.log = log;
             nodeStack = new ArrayDeque<>();
             this.predicate = predicate;
@@ -189,194 +193,148 @@ public class BanDynamicVersions
             numViolations = 0;
         }
 
-        private boolean isBannedDynamicVersion( VersionConstraint versionConstraint )
-        {
-            if ( versionConstraint.getVersion() != null )
-            {
-                if ( versionConstraint.getVersion().toString().equals( LATEST ) )
-                {
+        private boolean isBannedDynamicVersion(VersionConstraint versionConstraint) {
+            if (versionConstraint.getVersion() != null) {
+                if (versionConstraint.getVersion().toString().equals(LATEST)) {
                     return !allowLatest;
-                }
-                else if ( versionConstraint.getVersion().toString().equals( RELEASE ) )
-                {
+                } else if (versionConstraint.getVersion().toString().equals(RELEASE)) {
                     return !allowRelease;
-                }
-                else if ( versionConstraint.getVersion().toString().endsWith( SNAPSHOT_SUFFIX ) )
-                {
+                } else if (versionConstraint.getVersion().toString().endsWith(SNAPSHOT_SUFFIX)) {
                     return !allowSnapshots;
                 }
-            }
-            else if ( versionConstraint.getRange() != null )
-            {
-                if ( allowRangesWithIdenticalBounds 
-                     && Objects.equals( versionConstraint.getRange().getLowerBound(), 
-                                        versionConstraint.getRange().getUpperBound() ) ) 
-                {
-                        return false;
+            } else if (versionConstraint.getRange() != null) {
+                if (allowRangesWithIdenticalBounds
+                        && Objects.equals(
+                                versionConstraint.getRange().getLowerBound(),
+                                versionConstraint.getRange().getUpperBound())) {
+                    return false;
                 }
                 return !allowRanges;
-            }
-            else
-            {
-                log.warn( "Unexpected version constraint found: " + versionConstraint );
+            } else {
+                log.warn("Unexpected version constraint found: " + versionConstraint);
             }
             return false;
-
         }
 
         @Override
-        public boolean visitEnter( DependencyNode node )
-        {
-            if ( isRoot )
-            {
+        public boolean visitEnter(DependencyNode node) {
+            if (isRoot) {
                 isRoot = false;
-            }
-            else
-            {
-                log.debug( "Found node " + node + " with version constraint " + node.getVersionConstraint() );
-                if ( predicate.test( node ) && isBannedDynamicVersion( node.getVersionConstraint() ) )
-                {
+            } else {
+                log.debug("Found node " + node + " with version constraint " + node.getVersionConstraint());
+                if (predicate.test(node) && isBannedDynamicVersion(node.getVersionConstraint())) {
                     MessageBuilder msgBuilder = MessageUtils.buffer();
-                    log.warn( msgBuilder.a( "Dependency " )
-                              .strong( node.getDependency() )
-                              .mojo( dumpIntermediatePath( nodeStack ) )
-                              .a( " is referenced with a banned dynamic version " + node.getVersionConstraint() )
-                              .toString() );
+                    log.warn(msgBuilder
+                            .a("Dependency ")
+                            .strong(node.getDependency())
+                            .mojo(dumpIntermediatePath(nodeStack))
+                            .a(" is referenced with a banned dynamic version " + node.getVersionConstraint())
+                            .toString());
                     numViolations++;
                     return false;
                 }
-                nodeStack.addLast( node );
+                nodeStack.addLast(node);
             }
             return true;
         }
 
         @Override
-        public boolean visitLeave( DependencyNode node )
-        {
-            if ( !nodeStack.isEmpty() )
-            {
+        public boolean visitLeave(DependencyNode node) {
+            if (!nodeStack.isEmpty()) {
                 nodeStack.removeLast();
             }
             return true;
         }
     }
 
-    @SuppressWarnings( "unchecked" )
+    @SuppressWarnings("unchecked")
     @Override
-    public void execute( EnforcerRuleHelper helper )
-        throws EnforcerRuleException
-    {
+    public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
         MavenProject project;
         DefaultRepositorySystemSession newRepoSession;
         RepositorySystem repoSystem;
         List<RemoteRepository> remoteRepositories;
-        try
-        {
-            project = (MavenProject) Objects.requireNonNull( helper.evaluate( "${project}" ), "${project} is null" );
-            RepositorySystemSession repoSession =
-                (RepositorySystemSession) Objects.requireNonNull( helper.evaluate( "${repositorySystemSession}" ),
-                                                                  "${repositorySystemSession} is null" );
+        try {
+            project = (MavenProject) Objects.requireNonNull(helper.evaluate("${project}"), "${project} is null");
+            RepositorySystemSession repoSession = (RepositorySystemSession) Objects.requireNonNull(
+                    helper.evaluate("${repositorySystemSession}"), "${repositorySystemSession} is null");
             // get a new session to be able to tweak the dependency selector
-            newRepoSession = new DefaultRepositorySystemSession( repoSession );
-            remoteRepositories = (List<RemoteRepository>) helper.evaluate( "${project.remoteProjectRepositories}" );
-            repoSystem = helper.getComponent( RepositorySystem.class );
-        }
-        catch ( ExpressionEvaluationException eee )
-        {
-            throw new EnforcerRuleException( "Cannot resolve expression", eee );
-        }
-        catch ( ComponentLookupException cle )
-        {
-            throw new EnforcerRuleException( "Unable to retrieve component RepositorySystem", cle );
+            newRepoSession = new DefaultRepositorySystemSession(repoSession);
+            remoteRepositories = (List<RemoteRepository>) helper.evaluate("${project.remoteProjectRepositories}");
+            repoSystem = helper.getComponent(RepositorySystem.class);
+        } catch (ExpressionEvaluationException eee) {
+            throw new EnforcerRuleException("Cannot resolve expression", eee);
+        } catch (ComponentLookupException cle) {
+            throw new EnforcerRuleException("Unable to retrieve component RepositorySystem", cle);
         }
         Log log = helper.getLog();
 
         Collection<DependencySelector> depSelectors = new ArrayList<>();
-        depSelectors.add( new ScopeDependencySelector( excludedScopes ) );
-        if ( excludeOptionals )
-        {
-            depSelectors.add( new OptionalDependencySelector() );
+        depSelectors.add(new ScopeDependencySelector(excludedScopes));
+        if (excludeOptionals) {
+            depSelectors.add(new OptionalDependencySelector());
         }
-        newRepoSession.setDependencySelector( new AndDependencySelector( depSelectors ) );
+        newRepoSession.setDependencySelector(new AndDependencySelector(depSelectors));
 
-        Dependency rootDependency = RepositoryUtils.toDependency( project.getArtifact(), null );
-        try
-        {
+        Dependency rootDependency = RepositoryUtils.toDependency(project.getArtifact(), null);
+        try {
             // use root dependency with unresolved direct dependencies
-            int numViolations = emitDependenciesWithBannedDynamicVersions( rootDependency, repoSystem, newRepoSession,
-                                                                           remoteRepositories, log );
-            if ( numViolations > 0 )
-            {
-                ChoiceFormat dependenciesFormat = new ChoiceFormat( "1#dependency|1<dependencies" );
-                throw new EnforcerRuleException( "Found " + numViolations + " "
-                    + dependenciesFormat.format( numViolations )
-                    + " with dynamic versions. Look at the warnings emitted above for the details." );
+            int numViolations = emitDependenciesWithBannedDynamicVersions(
+                    rootDependency, repoSystem, newRepoSession, remoteRepositories, log);
+            if (numViolations > 0) {
+                ChoiceFormat dependenciesFormat = new ChoiceFormat("1#dependency|1<dependencies");
+                throw new EnforcerRuleException("Found " + numViolations + " "
+                        + dependenciesFormat.format(numViolations)
+                        + " with dynamic versions. Look at the warnings emitted above for the details.");
             }
-        }
-        catch ( DependencyCollectionException e )
-        {
-            throw new EnforcerRuleException( "Could not retrieve dependency metadata for project",
-                                             e );
+        } catch (DependencyCollectionException e) {
+            throw new EnforcerRuleException("Could not retrieve dependency metadata for project", e);
         }
     }
 
-    private static String dumpIntermediatePath( Collection<DependencyNode> path )
-    {
-        if ( path.isEmpty() )
-        {
+    private static String dumpIntermediatePath(Collection<DependencyNode> path) {
+        if (path.isEmpty()) {
             return "";
         }
-        return " via " + path.stream().map( n -> n.getArtifact().toString() ).collect( Collectors.joining( " -> " ) );
+        return " via " + path.stream().map(n -> n.getArtifact().toString()).collect(Collectors.joining(" -> "));
     }
 
-    private static final class ExcludeArtifactPatternsPredicate
-        implements Predicate<DependencyNode>
-    {
+    private static final class ExcludeArtifactPatternsPredicate implements Predicate<DependencyNode> {
 
         private final ArtifactMatcher artifactMatcher;
 
-        ExcludeArtifactPatternsPredicate( List<String> excludes )
-        {
-            this.artifactMatcher = new ArtifactMatcher( excludes, Collections.emptyList() );
+        ExcludeArtifactPatternsPredicate(List<String> excludes) {
+            this.artifactMatcher = new ArtifactMatcher(excludes, Collections.emptyList());
         }
 
         @Override
-        public boolean test( DependencyNode depNode )
-        {
-            try
-            {
-                return artifactMatcher.match( RepositoryUtils.toArtifact( depNode.getArtifact() ) );
-            }
-            catch ( InvalidVersionSpecificationException e )
-            {
-                throw new IllegalArgumentException( "Invalid version found for dependency node " + depNode, e );
+        public boolean test(DependencyNode depNode) {
+            try {
+                return artifactMatcher.match(RepositoryUtils.toArtifact(depNode.getArtifact()));
+            } catch (InvalidVersionSpecificationException e) {
+                throw new IllegalArgumentException("Invalid version found for dependency node " + depNode, e);
             }
         }
-
     }
 
-    protected int emitDependenciesWithBannedDynamicVersions( org.eclipse.aether.graph.Dependency rootDependency,
-                                                             RepositorySystem repoSystem,
-                                                             RepositorySystemSession repoSession,
-                                                             List<RemoteRepository> remoteRepositories, Log log )
-        throws DependencyCollectionException
-    {
-        CollectRequest collectRequest = new CollectRequest( rootDependency, remoteRepositories );
-        CollectResult collectResult = repoSystem.collectDependencies( repoSession, collectRequest );
+    protected int emitDependenciesWithBannedDynamicVersions(
+            org.eclipse.aether.graph.Dependency rootDependency,
+            RepositorySystem repoSystem,
+            RepositorySystemSession repoSession,
+            List<RemoteRepository> remoteRepositories,
+            Log log)
+            throws DependencyCollectionException {
+        CollectRequest collectRequest = new CollectRequest(rootDependency, remoteRepositories);
+        CollectResult collectResult = repoSystem.collectDependencies(repoSession, collectRequest);
         Predicate<DependencyNode> predicate;
-        if ( ignores != null && !ignores.isEmpty() )
-        {
-            predicate = new ExcludeArtifactPatternsPredicate( ignores );
-        }
-        else
-        {
+        if (ignores != null && !ignores.isEmpty()) {
+            predicate = new ExcludeArtifactPatternsPredicate(ignores);
+        } else {
             predicate = d -> true;
         }
-        BannedDynamicVersionCollector bannedDynamicVersionCollector =
-            new BannedDynamicVersionCollector( log, predicate );
-        DependencyVisitor depVisitor = new TreeDependencyVisitor( bannedDynamicVersionCollector );
-        collectResult.getRoot().accept( depVisitor );
+        BannedDynamicVersionCollector bannedDynamicVersionCollector = new BannedDynamicVersionCollector(log, predicate);
+        DependencyVisitor depVisitor = new TreeDependencyVisitor(bannedDynamicVersionCollector);
+        collectResult.getRoot().accept(depVisitor);
         return bannedDynamicVersionCollector.getNumViolations();
     }
-
 }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanTransitiveDependencies.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanTransitiveDependencies.java
index e7ef71b..a89a554 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanTransitiveDependencies.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanTransitiveDependencies.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -21,7 +39,6 @@ package org.apache.maven.plugins.enforcer;
 
 import java.util.Collections;
 import java.util.List;
-
 import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
 import org.apache.maven.enforcer.rule.api.EnforcerRule;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
@@ -40,13 +57,10 @@ import org.codehaus.plexus.logging.console.ConsoleLogger;
 /**
  * This rule bans all transitive dependencies. There is a configuration option to exclude certain artifacts from being
  * checked.
- * 
+ *
  * @author Jakub Senko
  */
-public class BanTransitiveDependencies
-    extends AbstractNonCacheableEnforcerRule
-    implements EnforcerRule
-{
+public class BanTransitiveDependencies extends AbstractNonCacheableEnforcerRule implements EnforcerRule {
 
     private EnforcerRuleHelper helper;
 
@@ -71,12 +85,11 @@ public class BanTransitiveDependencies
     /**
      * Searches dependency tree recursively for transitive dependencies that are not excluded, while generating nice
      * info message along the way.
-     * 
+     *
      * @throws InvalidVersionSpecificationException
      */
-    private static boolean searchTree( DependencyNode node, int level, ArtifactMatcher excludes, StringBuilder message )
-        throws InvalidVersionSpecificationException
-    {
+    private static boolean searchTree(DependencyNode node, int level, ArtifactMatcher excludes, StringBuilder message)
+            throws InvalidVersionSpecificationException {
 
         List<DependencyNode> children = node.getChildren();
 
@@ -93,46 +106,38 @@ public class BanTransitiveDependencies
          */
         StringBuilder messageFromChildren = message == null ? null : new StringBuilder();
 
-        if ( excludes.match( node.getArtifact() ) )
-        {
+        if (excludes.match(node.getArtifact())) {
             // is excluded, we don't care about descendants
             excluded = true;
             hasTransitiveDependencies = false;
-        }
-        else
-        {
-            for ( DependencyNode childNode : children )
-            {
+        } else {
+            for (DependencyNode childNode : children) {
                 /*
                  * if any of the children has transitive d. so does the parent
                  */
                 hasTransitiveDependencies =
-                    ( searchTree( childNode, level + 1, excludes, messageFromChildren ) || hasTransitiveDependencies );
+                        (searchTree(childNode, level + 1, excludes, messageFromChildren) || hasTransitiveDependencies);
             }
         }
 
-        if ( ( excluded || hasTransitiveDependencies ) && message != null ) // then generate message
+        if ((excluded || hasTransitiveDependencies) && message != null) // then generate message
         {
-            for ( int i = 0; i < level; i++ )
-            {
-                message.append( "   " );
+            for (int i = 0; i < level; i++) {
+                message.append("   ");
             }
 
-            message.append( node.getArtifact() );
+            message.append(node.getArtifact());
 
-            if ( excluded )
-            {
-                message.append( " [excluded]" + System.lineSeparator() );
+            if (excluded) {
+                message.append(" [excluded]" + System.lineSeparator());
             }
 
-            if ( hasTransitiveDependencies )
-            {
-                if ( level == 1 )
-                {
-                    message.append( " has transitive dependencies:" );
+            if (hasTransitiveDependencies) {
+                if (level == 1) {
+                    message.append(" has transitive dependencies:");
                 }
 
-                message.append( System.lineSeparator() ).append( messageFromChildren );
+                message.append(System.lineSeparator()).append(messageFromChildren);
             }
         }
 
@@ -140,73 +145,56 @@ public class BanTransitiveDependencies
     }
 
     @Override
-    public void execute( EnforcerRuleHelper helper )
-        throws EnforcerRuleException
-    {
+    public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
         this.helper = helper;
 
-        if ( excludes == null )
-        {
+        if (excludes == null) {
             excludes = Collections.emptyList();
         }
-        if ( includes == null )
-        {
+        if (includes == null) {
             includes = Collections.emptyList();
         }
 
-        final ArtifactMatcher exclusions = new ArtifactMatcher( excludes, includes );
+        final ArtifactMatcher exclusions = new ArtifactMatcher(excludes, includes);
 
         DependencyNode rootNode = null;
 
-        try
-        {
-            MavenProject project = (MavenProject) helper.evaluate( "${project}" );
-            MavenSession session = (MavenSession) helper.evaluate( "${session}" );
-            
+        try {
+            MavenProject project = (MavenProject) helper.evaluate("${project}");
+            MavenSession session = (MavenSession) helper.evaluate("${session}");
+
             ProjectBuildingRequest buildingRequest =
-                new DefaultProjectBuildingRequest( session.getProjectBuildingRequest() );
-            buildingRequest.setProject( project );
-            
-            rootNode = createDependencyGraphBuilder().buildDependencyGraph( buildingRequest, null );
-        }
-        catch ( Exception e )
-        {
-            throw new EnforcerRuleException( "Error: Could not construct dependency tree.", e );
+                    new DefaultProjectBuildingRequest(session.getProjectBuildingRequest());
+            buildingRequest.setProject(project);
+
+            rootNode = createDependencyGraphBuilder().buildDependencyGraph(buildingRequest, null);
+        } catch (Exception e) {
+            throw new EnforcerRuleException("Error: Could not construct dependency tree.", e);
         }
 
         String message = getMessage();
         StringBuilder generatedMessage = null;
-        if ( message == null )
-        {
+        if (message == null) {
             generatedMessage = new StringBuilder();
         }
 
-        try
-        {
-            if ( searchTree( rootNode, 0, exclusions, generatedMessage ) )
-            {
-                throw new EnforcerRuleException( message == null ? generatedMessage.toString() : message );
+        try {
+            if (searchTree(rootNode, 0, exclusions, generatedMessage)) {
+                throw new EnforcerRuleException(message == null ? generatedMessage.toString() : message);
             }
+        } catch (InvalidVersionSpecificationException e) {
+            throw new EnforcerRuleException("Error: Invalid version range.", e);
         }
-        catch ( InvalidVersionSpecificationException e )
-        {
-            throw new EnforcerRuleException( "Error: Invalid version range.", e );
-        }
-
     }
 
-    private DependencyGraphBuilder createDependencyGraphBuilder()
-        throws ComponentLookupException
-    {
+    private DependencyGraphBuilder createDependencyGraphBuilder() throws ComponentLookupException {
         // CHECKSTYLE_OFF: LineLength
-        DefaultDependencyGraphBuilder builder =
-            (DefaultDependencyGraphBuilder) helper.getContainer().lookup( DependencyGraphBuilder.class.getCanonicalName(),
-                                                                          "default" );
+        DefaultDependencyGraphBuilder builder = (DefaultDependencyGraphBuilder)
+                helper.getContainer().lookup(DependencyGraphBuilder.class.getCanonicalName(), "default");
         // CHECKSTYLE_ON: LineLength
 
-        builder.enableLogging( new ConsoleLogger( ConsoleLogger.LEVEL_DISABLED, "DefaultDependencyGraphBuilder" ) );
+        builder.enableLogging(new ConsoleLogger(ConsoleLogger.LEVEL_DISABLED, "DefaultDependencyGraphBuilder"));
 
         return builder;
     }
-
 }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedDependencies.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedDependencies.java
index 29785fa..f5061a2 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedDependencies.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedDependencies.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -21,7 +39,6 @@ package org.apache.maven.plugins.enforcer;
 
 import java.util.List;
 import java.util.Set;
-
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
 import org.apache.maven.plugin.logging.Log;
@@ -29,20 +46,18 @@ import org.apache.maven.plugins.enforcer.utils.ArtifactUtils;
 
 /**
  * This rule checks that lists of dependencies are not included.
- * 
+ *
  * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
  */
-public class BannedDependencies
-    extends AbstractBanDependencies
-{
+public class BannedDependencies extends AbstractBanDependencies {
 
     /**
      * Specify the banned dependencies. This can be a list of artifacts in the format
-     * <code>groupId[:artifactId][:version]</code>. Any of the sections can be a wildcard 
+     * <code>groupId[:artifactId][:version]</code>. Any of the sections can be a wildcard
      * by using '*' (ie group:*:1.0) <br>
-     * The rule will fail if any dependency matches any exclude, unless it also matches 
+     * The rule will fail if any dependency matches any exclude, unless it also matches
      * an include rule.
-     * 
+     *
      * @see {@link #setExcludes(List)}
      * @see {@link #getExcludes()}
      */
@@ -50,91 +65,81 @@ public class BannedDependencies
 
     /**
      * Specify the allowed dependencies. This can be a list of artifacts in the format
-     * <code>groupId[:artifactId][:version]</code>. Any of the sections can be a wildcard 
+     * <code>groupId[:artifactId][:version]</code>. Any of the sections can be a wildcard
      * by using '*' (ie group:*:1.0) <br>
-     * Includes override the exclude rules. It is meant to allow wide exclusion rules 
+     * Includes override the exclude rules. It is meant to allow wide exclusion rules
      * with wildcards and still allow a
      * smaller set of includes. <br>
      * For example, to ban all xerces except xerces-api -> exclude "xerces", include "xerces:xerces-api"
-     * 
+     *
      * @see {@link #setIncludes(List)}
      * @see {@link #getIncludes()}
      */
     private List<String> includes = null;
 
     @Override
-    protected Set<Artifact> checkDependencies( Set<Artifact> theDependencies, Log log )
-        throws EnforcerRuleException
-    {
+    protected Set<Artifact> checkDependencies(Set<Artifact> theDependencies, Log log) throws EnforcerRuleException {
 
-        Set<Artifact> excluded = ArtifactUtils.checkDependencies( theDependencies, excludes );
+        Set<Artifact> excluded = ArtifactUtils.checkDependencies(theDependencies, excludes);
 
         // anything specifically included should be removed
         // from the ban list.
-        if ( excluded != null )
-        {
-            Set<Artifact> included = ArtifactUtils.checkDependencies( theDependencies, includes );
+        if (excluded != null) {
+            Set<Artifact> included = ArtifactUtils.checkDependencies(theDependencies, includes);
 
-            if ( included != null )
-            {
-                excluded.removeAll( included );
+            if (included != null) {
+                excluded.removeAll(included);
             }
         }
         return excluded;
-
     }
 
     /**
      * Gets the excludes.
-     * 
+     *
      * @return the excludes
      */
-    public List<String> getExcludes()
-    {
+    public List<String> getExcludes() {
         return this.excludes;
     }
 
     /**
      * Specify the banned dependencies. This can be a list of artifacts in the format
-     * <code>groupId[:artifactId][:version]</code>. Any of the sections can be a wildcard 
+     * <code>groupId[:artifactId][:version]</code>. Any of the sections can be a wildcard
      * by using '*' (ie group:*:1.0) <br>
-     * The rule will fail if any dependency matches any exclude, unless it also matches an 
+     * The rule will fail if any dependency matches any exclude, unless it also matches an
      * include rule.
-     * 
+     *
      * @see #getExcludes()
      * @param theExcludes the excludes to set
      */
-    public void setExcludes( List<String> theExcludes )
-    {
+    public void setExcludes(List<String> theExcludes) {
         this.excludes = theExcludes;
     }
 
     /**
      * Gets the includes.
-     * 
+     *
      * @return the includes
      */
-    public List<String> getIncludes()
-    {
+    public List<String> getIncludes() {
         return this.includes;
     }
 
     /**
      * Specify the allowed dependencies. This can be a list of artifacts in the format
-     * <code>groupId[:artifactId][:version]</code>. Any of the sections can be a wildcard 
+     * <code>groupId[:artifactId][:version]</code>. Any of the sections can be a wildcard
      * by using '*' (ie group:*:1.0) <br>
-     * Includes override the exclude rules. It is meant to allow wide exclusion rules with 
+     * Includes override the exclude rules. It is meant to allow wide exclusion rules with
      * wildcards and still allow a
      * smaller set of includes. <br>
      * For example, to ban all xerces except xerces-api → exclude "xerces",
      * include "xerces:xerces-api"
-     * 
+     *
      * @see #setIncludes(List)
      * @param theIncludes the includes to set
      */
-    public void setIncludes( List<String> theIncludes )
-    {
+    public void setIncludes(List<String> theIncludes) {
         this.includes = theIncludes;
     }
-
 }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedPlugins.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedPlugins.java
index 9e0a7e8..25738d5 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedPlugins.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedPlugins.java
@@ -1,47 +1,59 @@
-package org.apache.maven.plugins.enforcer;
-
-/*
- * 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.
- */
-
-import java.util.Set;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.project.ProjectBuildingRequest;
-
-/**
- * This rule checks that lists of plugins are not included.
- *
- * @author <a href="mailto:velo.br@gmail.com">Marvin Froeder</a>
- */
-public class BannedPlugins
-    extends BannedDependencies
-{
-    @Override
-    protected Set<Artifact> getDependenciesToCheck( ProjectBuildingRequest buildingRequest )
-    {
-        return buildingRequest.getProject().getPluginArtifacts();
-    }
-
-    @Override
-    protected CharSequence getErrorMessage( Artifact artifact )
-    {
-        return "Found Banned Plugin: " + artifact.getId() + System.lineSeparator();
-    }
-
-}
+/*
+ * 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.
+ */
+package org.apache.maven.plugins.enforcer;
+
+/*
+ * 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.
+ */
+
+import java.util.Set;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.project.ProjectBuildingRequest;
+
+/**
+ * This rule checks that lists of plugins are not included.
+ *
+ * @author <a href="mailto:velo.br@gmail.com">Marvin Froeder</a>
+ */
+public class BannedPlugins extends BannedDependencies {
+    @Override
+    protected Set<Artifact> getDependenciesToCheck(ProjectBuildingRequest buildingRequest) {
+        return buildingRequest.getProject().getPluginArtifacts();
+    }
+
+    @Override
+    protected CharSequence getErrorMessage(Artifact artifact) {
+        return "Found Banned Plugin: " + artifact.getId() + System.lineSeparator();
+    }
+}
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedRepositories.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedRepositories.java
index 95b1cd0..ab5e03a 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedRepositories.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedRepositories.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -22,7 +40,6 @@ package org.apache.maven.plugins.enforcer;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
-
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
@@ -32,12 +49,10 @@ import org.codehaus.plexus.util.StringUtils;
 
 /**
  * This rule checks that this project's maven session whether have banned repositories.
- * 
+ *
  * @author <a href="mailto:wangyf2010@gmail.com">Simon Wang</a>
  */
-public class BannedRepositories
-    extends AbstractNonCacheableEnforcerRule
-{
+public class BannedRepositories extends AbstractNonCacheableEnforcerRule {
 
     // ----------------------------------------------------------------------
     // Mojo parameters
@@ -46,14 +61,14 @@ public class BannedRepositories
     /**
      * Specify explicitly banned non-plugin repositories. This is a list of repository url patterns. Support wildcard
      * "*".
-     * 
+     *
      * @see {@link #setBannedRepositories(List)}
      */
     private List<String> bannedRepositories = Collections.emptyList();
 
     /**
      * Specify explicitly banned plugin repositories. This is a list of repository url patterns. Support wildcard "*".
-     * 
+     *
      * @see {@link #setBannedPluginRepositories(List)}
      */
     private List<String> bannedPluginRepositories = Collections.emptyList();
@@ -61,7 +76,7 @@ public class BannedRepositories
     /**
      * Specify explicitly allowed non-plugin repositories, then all others repositories would be banned. This is a list
      * of repository url patterns. Support wildcard "*".
-     * 
+     *
      * @see {@link #setAllowedRepositories(List)}
      */
     private List<String> allowedRepositories = Collections.emptyList();
@@ -69,7 +84,7 @@ public class BannedRepositories
     /**
      * Specify explicitly allowed plugin repositories, then all others repositories would be banned. This is a list of
      * repository url patterns. Support wildcard "*".
-     * 
+     *
      * @see {@link #setAllowedPluginRepositories(List)}
      */
     private List<String> allowedPluginRepositories = Collections.emptyList();
@@ -79,36 +94,30 @@ public class BannedRepositories
     // ----------------------------------------------------------------------
 
     @Override
-    public void execute( EnforcerRuleHelper helper )
-        throws EnforcerRuleException
-    {
+    public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
         MavenProject project;
-        try
-        {
-            project = (MavenProject) helper.evaluate( "${project}" );
+        try {
+            project = (MavenProject) helper.evaluate("${project}");
 
-            List<ArtifactRepository> resultBannedRepos =
-                checkRepositories( project.getRemoteArtifactRepositories(), this.allowedRepositories,
-                                   this.bannedRepositories );
+            List<ArtifactRepository> resultBannedRepos = checkRepositories(
+                    project.getRemoteArtifactRepositories(), this.allowedRepositories, this.bannedRepositories);
 
-            List<ArtifactRepository> resultBannedPluginRepos =
-                checkRepositories( project.getPluginArtifactRepositories(), this.allowedPluginRepositories,
-                                   this.bannedPluginRepositories );
+            List<ArtifactRepository> resultBannedPluginRepos = checkRepositories(
+                    project.getPluginArtifactRepositories(),
+                    this.allowedPluginRepositories,
+                    this.bannedPluginRepositories);
 
-            String repoErrMsg = populateErrorMessage( resultBannedRepos, " " );
-            String pluginRepoErrMsg = populateErrorMessage( resultBannedPluginRepos, " plugin " );
+            String repoErrMsg = populateErrorMessage(resultBannedRepos, " ");
+            String pluginRepoErrMsg = populateErrorMessage(resultBannedPluginRepos, " plugin ");
 
             String errMsg = repoErrMsg + pluginRepoErrMsg;
 
-            if ( errMsg != null && !StringUtils.isEmpty( errMsg ) )
-            {
-                throw new EnforcerRuleException( errMsg );
+            if (errMsg != null && !StringUtils.isEmpty(errMsg)) {
+                throw new EnforcerRuleException(errMsg);
             }
 
-        }
-        catch ( ExpressionEvaluationException e )
-        {
-            throw new EnforcerRuleException( e.getLocalizedMessage() );
+        } catch (ExpressionEvaluationException e) {
+            throw new EnforcerRuleException(e.getLocalizedMessage());
         }
     }
 
@@ -116,23 +125,19 @@ public class BannedRepositories
     // Protected methods
     // ----------------------------------------------------------------------
 
-    protected void setBannedRepositories( List<String> bannedRepositories )
-    {
+    protected void setBannedRepositories(List<String> bannedRepositories) {
         this.bannedRepositories = bannedRepositories;
     }
 
-    protected void setBannedPluginRepositories( List<String> bannedPluginRepositories )
-    {
+    protected void setBannedPluginRepositories(List<String> bannedPluginRepositories) {
         this.bannedPluginRepositories = bannedPluginRepositories;
     }
 
-    protected void setAllowedRepositories( List<String> allowedRepositories )
-    {
+    protected void setAllowedRepositories(List<String> allowedRepositories) {
         this.allowedRepositories = allowedRepositories;
     }
 
-    protected void setAllowedPluginRepositories( List<String> allowedPluginRepositories )
-    {
+    protected void setAllowedPluginRepositories(List<String> allowedPluginRepositories) {
         this.allowedPluginRepositories = allowedPluginRepositories;
     }
 
@@ -142,42 +147,34 @@ public class BannedRepositories
 
     /**
      * Check whether specified repositories have banned repositories.
-     * 
+     *
      * @param repositories: candidate repositories.
      * @param includes : 'include' patterns.
      * @param excludes : 'exclude' patterns.
      * @return Banned repositories.
      */
-    private List<ArtifactRepository> checkRepositories( List<ArtifactRepository> repositories, List<String> includes,
-                                                        List<String> excludes )
-    {
+    private List<ArtifactRepository> checkRepositories(
+            List<ArtifactRepository> repositories, List<String> includes, List<String> excludes) {
         List<ArtifactRepository> bannedRepos = new ArrayList<>();
 
-        for ( ArtifactRepository repo : repositories )
-        {
+        for (ArtifactRepository repo : repositories) {
             String url = repo.getUrl().trim();
-            if ( includes.size() > 0 && !match( url, includes ) )
-            {
-                bannedRepos.add( repo );
+            if (includes.size() > 0 && !match(url, includes)) {
+                bannedRepos.add(repo);
                 continue;
             }
 
-            if ( excludes.size() > 0 && match( url, excludes ) )
-            {
-                bannedRepos.add( repo );
+            if (excludes.size() > 0 && match(url, excludes)) {
+                bannedRepos.add(repo);
             }
-
         }
 
         return bannedRepos;
     }
 
-    private boolean match( String url, List<String> patterns )
-    {
-        for ( String pattern : patterns )
-        {
-            if ( this.match( url, pattern ) )
-            {
+    private boolean match(String url, List<String> patterns) {
+        for (String pattern : patterns) {
+            if (this.match(url, pattern)) {
                 return true;
             }
         }
@@ -185,32 +182,26 @@ public class BannedRepositories
         return false;
     }
 
-    private boolean match( String text, String pattern )
-    {
-        return text.matches( pattern.replace( "?", ".?" ).replace( "*", ".*?" ) );
+    private boolean match(String text, String pattern) {
+        return text.matches(pattern.replace("?", ".?").replace("*", ".*?"));
     }
 
-    private String populateErrorMessage( List<ArtifactRepository> resultBannedRepos, String errorMessagePrefix )
-    {
-        StringBuffer errMsg = new StringBuffer( "" );
-        if ( !resultBannedRepos.isEmpty() )
-        {
-            errMsg.append( "Current maven session contains banned" + errorMessagePrefix
-                + "repository urls, please double check your pom or settings.xml:" + System.lineSeparator()
-                + getRepositoryUrlString( resultBannedRepos ) + System.lineSeparator() + System.lineSeparator() );
+    private String populateErrorMessage(List<ArtifactRepository> resultBannedRepos, String errorMessagePrefix) {
+        StringBuffer errMsg = new StringBuffer("");
+        if (!resultBannedRepos.isEmpty()) {
+            errMsg.append("Current maven session contains banned" + errorMessagePrefix
+                    + "repository urls, please double check your pom or settings.xml:" + System.lineSeparator()
+                    + getRepositoryUrlString(resultBannedRepos) + System.lineSeparator() + System.lineSeparator());
         }
 
         return errMsg.toString();
     }
 
-    private String getRepositoryUrlString( List<ArtifactRepository> resultBannedRepos )
-    {
-        StringBuilder urls = new StringBuilder( "" );
-        for ( ArtifactRepository repo : resultBannedRepos )
-        {
-            urls.append( repo.getId() + " - " + repo.getUrl() + System.lineSeparator() );
+    private String getRepositoryUrlString(List<ArtifactRepository> resultBannedRepos) {
+        StringBuilder urls = new StringBuilder("");
+        for (ArtifactRepository repo : resultBannedRepos) {
+            urls.append(repo.getId() + " - " + repo.getUrl() + System.lineSeparator());
         }
         return urls.toString();
     }
-
 }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DefaultEnforcementRuleHelper.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DefaultEnforcementRuleHelper.java
index 7f80748..85a08ee 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DefaultEnforcementRuleHelper.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DefaultEnforcementRuleHelper.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -24,7 +42,6 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.function.Supplier;
-
 import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.plugin.logging.Log;
@@ -39,9 +56,7 @@ import org.codehaus.plexus.component.repository.exception.ComponentLookupExcepti
  *
  * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
  */
-public class DefaultEnforcementRuleHelper
-    implements EnforcerRuleHelper
-{
+public class DefaultEnforcementRuleHelper implements EnforcerRuleHelper {
 
     /** The log. */
     private Log log;
@@ -63,17 +78,13 @@ public class DefaultEnforcementRuleHelper
      * @param log the log
      * @param container the container
      */
-    public DefaultEnforcementRuleHelper( MavenSession session, ExpressionEvaluator evaluator, Log log,
-                                         PlexusContainer container )
-    {
+    public DefaultEnforcementRuleHelper(
+            MavenSession session, ExpressionEvaluator evaluator, Log log, PlexusContainer container) {
         this.evaluator = evaluator;
         this.log = log;
-        if ( container != null )
-        {
+        if (container != null) {
             this.container = container;
-        }
-        else
-        {
+        } else {
             this.container = session.getContainer();
         }
 
@@ -81,75 +92,57 @@ public class DefaultEnforcementRuleHelper
     }
 
     @Override
-    public Log getLog()
-    {
+    public Log getLog() {
         return log;
     }
 
     @Override
-    public File alignToBaseDirectory( File theFile )
-    {
-        return evaluator.alignToBaseDirectory( theFile );
+    public File alignToBaseDirectory(File theFile) {
+        return evaluator.alignToBaseDirectory(theFile);
     }
 
     @Override
-    public Object evaluate( String theExpression )
-        throws ExpressionEvaluationException
-    {
-        return evaluator.evaluate( theExpression );
+    public Object evaluate(String theExpression) throws ExpressionEvaluationException {
+        return evaluator.evaluate(theExpression);
     }
 
     @Override
-    public <T> T getComponent( Class<T> clazz )
-        throws ComponentLookupException
-    {
-        return container.lookup( clazz );
+    public <T> T getComponent(Class<T> clazz) throws ComponentLookupException {
+        return container.lookup(clazz);
     }
 
     @Override
-    public Object getComponent( String theComponentKey )
-        throws ComponentLookupException
-    {
-        return container.lookup( theComponentKey );
+    public Object getComponent(String theComponentKey) throws ComponentLookupException {
+        return container.lookup(theComponentKey);
     }
 
     @Override
-    public Object getComponent( String theRole, String theRoleHint )
-        throws ComponentLookupException
-    {
-        return container.lookup( theRole, theRoleHint );
+    public Object getComponent(String theRole, String theRoleHint) throws ComponentLookupException {
+        return container.lookup(theRole, theRoleHint);
     }
 
     @Override
-    public List<Object> getComponentList( String theRole )
-        throws ComponentLookupException
-    {
-        return container.lookupList( theRole );
+    public List<Object> getComponentList(String theRole) throws ComponentLookupException {
+        return container.lookupList(theRole);
     }
 
     @Override
-    public Map<String, Object> getComponentMap( String theRole )
-        throws ComponentLookupException
-    {
-        return container.lookupMap( theRole );
+    public Map<String, Object> getComponentMap(String theRole) throws ComponentLookupException {
+        return container.lookupMap(theRole);
     }
-    
+
     @Override
-    public <T> T getComponent( Class<T> clazz, String roleHint )
-        throws ComponentLookupException
-    {
-        return container.lookup( clazz, roleHint );
+    public <T> T getComponent(Class<T> clazz, String roleHint) throws ComponentLookupException {
+        return container.lookup(clazz, roleHint);
     }
 
     @Override
-    public PlexusContainer getContainer()
-    {
+    public PlexusContainer getContainer() {
         return container;
     }
 
     @Override
-    public Object getCache( String key, Supplier<?> producer )
-    {
-        return cache.computeIfAbsent( key, ( x ) -> producer.get() );
+    public Object getCache(String key, Supplier<?> producer) {
+        return cache.computeIfAbsent(key, (x) -> producer.get());
     }
 }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DependencyConvergence.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DependencyConvergence.java
index fdb95e0..c6c2a13 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DependencyConvergence.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DependencyConvergence.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -22,7 +40,6 @@ package org.apache.maven.plugins.enforcer;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
-
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
@@ -44,15 +61,12 @@ import org.codehaus.plexus.component.repository.exception.ComponentLookupExcepti
 /**
  * @author <a href="mailto:rex@e-hoffman.org">Rex Hoffman</a>
  */
-public class DependencyConvergence
-    implements EnforcerRule
-{
+public class DependencyConvergence implements EnforcerRule {
     private static Log log;
 
     private boolean uniqueVersions;
 
-    public void setUniqueVersions( boolean uniqueVersions )
-    {
+    public void setUniqueVersions(boolean uniqueVersions) {
         this.uniqueVersions = uniqueVersions;
     }
 
@@ -62,141 +76,114 @@ public class DependencyConvergence
      * {@link DependencyTreeBuilder#buildDependencyTree(MavenProject, ArtifactRepository, ArtifactFactory, ArtifactMetadataSource, ArtifactFilter, ArtifactCollector)}
      * factory method. <br/>
      * This method simply exists to hide all the ugly lookup that the {@link EnforcerRuleHelper} has to do.
-     * 
+     *
      * @param helper
      * @return a Dependency Node which is the root of the project's dependency tree
      * @throws EnforcerRuleException
      */
     // CHECKSTYLE_ON: LineLength
-    private DependencyNode getNode( EnforcerRuleHelper helper )
-        throws EnforcerRuleException
-    {
-        try
-        {
-            MavenProject project = (MavenProject) helper.evaluate( "${project}" );
-            MavenSession session = (MavenSession) helper.evaluate( "${session}" );
+    private DependencyNode getNode(EnforcerRuleHelper helper) throws EnforcerRuleException {
+        try {
+            MavenProject project = (MavenProject) helper.evaluate("${project}");
+            MavenSession session = (MavenSession) helper.evaluate("${session}");
             DependencyCollectorBuilder dependencyCollectorBuilder =
-                helper.getComponent( DependencyCollectorBuilder.class );
-            ArtifactRepository repository = (ArtifactRepository) helper.evaluate( "${localRepository}" );
+                    helper.getComponent(DependencyCollectorBuilder.class);
+            ArtifactRepository repository = (ArtifactRepository) helper.evaluate("${localRepository}");
 
             ProjectBuildingRequest buildingRequest =
-                new DefaultProjectBuildingRequest( session.getProjectBuildingRequest() );
-            buildingRequest.setProject( project );
-            buildingRequest.setLocalRepository( repository );
-            ArtifactFilter filter = ( Artifact a ) -> ( "compile".equalsIgnoreCase( a.getScope () )
-                    || "runtime".equalsIgnoreCase( a.getScope () ) )
-                    && !a.isOptional();
-
-            return dependencyCollectorBuilder.collectDependencyGraph( buildingRequest, filter );
-        }
-        catch ( ExpressionEvaluationException | ComponentLookupException e )
-        {
-            throw new EnforcerRuleException( "Unable to lookup a component " + e.getLocalizedMessage(), e );
-        }
-        catch ( DependencyCollectorBuilderException e )
-        {
-            throw new EnforcerRuleException( "Could not build dependency tree " + e.getLocalizedMessage(), e );
+                    new DefaultProjectBuildingRequest(session.getProjectBuildingRequest());
+            buildingRequest.setProject(project);
+            buildingRequest.setLocalRepository(repository);
+            ArtifactFilter filter = (Artifact a) ->
+                    ("compile".equalsIgnoreCase(a.getScope()) || "runtime".equalsIgnoreCase(a.getScope()))
+                            && !a.isOptional();
+
+            return dependencyCollectorBuilder.collectDependencyGraph(buildingRequest, filter);
+        } catch (ExpressionEvaluationException | ComponentLookupException e) {
+            throw new EnforcerRuleException("Unable to lookup a component " + e.getLocalizedMessage(), e);
+        } catch (DependencyCollectorBuilderException e) {
+            throw new EnforcerRuleException("Could not build dependency tree " + e.getLocalizedMessage(), e);
         }
     }
 
     @Override
-    public void execute( EnforcerRuleHelper helper )
-        throws EnforcerRuleException
-    {
-        if ( log == null )
-        {
+    public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
+        if (log == null) {
             log = helper.getLog();
         }
-        try
-        {
-            DependencyNode node = getNode( helper );
-            DependencyVersionMap visitor = new DependencyVersionMap( log );
-            visitor.setUniqueVersions( uniqueVersions );
-            node.accept( visitor );
+        try {
+            DependencyNode node = getNode(helper);
+            DependencyVersionMap visitor = new DependencyVersionMap(log);
+            visitor.setUniqueVersions(uniqueVersions);
+            node.accept(visitor);
             List<CharSequence> errorMsgs = new ArrayList<>();
-            errorMsgs.addAll( getConvergenceErrorMsgs( visitor.getConflictedVersionNumbers() ) );
-            for ( CharSequence errorMsg : errorMsgs )
-            {
-                log.warn( errorMsg );
+            errorMsgs.addAll(getConvergenceErrorMsgs(visitor.getConflictedVersionNumbers()));
+            for (CharSequence errorMsg : errorMsgs) {
+                log.warn(errorMsg);
             }
-            if ( errorMsgs.size() > 0 )
-            {
-                throw new EnforcerRuleException( "Failed while enforcing releasability. "
-                    + "See above detailed error message." );
+            if (errorMsgs.size() > 0) {
+                throw new EnforcerRuleException(
+                        "Failed while enforcing releasability. " + "See above detailed error message.");
             }
-        }
-        catch ( Exception e )
-        {
-            throw new EnforcerRuleException( e.getLocalizedMessage(), e );
+        } catch (Exception e) {
+            throw new EnforcerRuleException(e.getLocalizedMessage(), e);
         }
     }
 
-    private StringBuilder buildTreeString( DependencyNode node )
-    {
+    private StringBuilder buildTreeString(DependencyNode node) {
         List<String> loc = new ArrayList<>();
         DependencyNode currentNode = node;
-        while ( currentNode != null )
-        {
-            loc.add( currentNode.getArtifact().toString() );
+        while (currentNode != null) {
+            loc.add(currentNode.getArtifact().toString());
             currentNode = currentNode.getParent();
         }
-        Collections.reverse( loc );
+        Collections.reverse(loc);
         StringBuilder builder = new StringBuilder();
-        for ( int i = 0; i < loc.size(); i++ )
-        {
-            for ( int j = 0; j < i; j++ )
-            {
-                builder.append( "  " );
+        for (int i = 0; i < loc.size(); i++) {
+            for (int j = 0; j < i; j++) {
+                builder.append("  ");
             }
-            builder.append( "+-" + loc.get( i ) );
-            builder.append( System.lineSeparator() );
+            builder.append("+-" + loc.get(i));
+            builder.append(System.lineSeparator());
         }
         return builder;
     }
 
-    private List<String> getConvergenceErrorMsgs( List<List<DependencyNode>> errors )
-    {
+    private List<String> getConvergenceErrorMsgs(List<List<DependencyNode>> errors) {
         List<String> errorMsgs = new ArrayList<>();
-        for ( List<DependencyNode> nodeList : errors )
-        {
-            errorMsgs.add( buildConvergenceErrorMsg( nodeList ) );
+        for (List<DependencyNode> nodeList : errors) {
+            errorMsgs.add(buildConvergenceErrorMsg(nodeList));
         }
         return errorMsgs;
     }
 
-    private String buildConvergenceErrorMsg( List<DependencyNode> nodeList )
-    {
+    private String buildConvergenceErrorMsg(List<DependencyNode> nodeList) {
         StringBuilder builder = new StringBuilder();
-        builder.append( System.lineSeparator() + "Dependency convergence error for "
-            + nodeList.get( 0 ).getArtifact().toString()
-            + " paths to dependency are:" + System.lineSeparator() );
-        if ( nodeList.size() > 0 )
-        {
-            builder.append( buildTreeString( nodeList.get( 0 ) ) );
+        builder.append(System.lineSeparator() + "Dependency convergence error for "
+                + nodeList.get(0).getArtifact().toString()
+                + " paths to dependency are:" + System.lineSeparator());
+        if (nodeList.size() > 0) {
+            builder.append(buildTreeString(nodeList.get(0)));
         }
-        for ( DependencyNode node : nodeList.subList( 1, nodeList.size() ) )
-        {
-            builder.append( "and" + System.lineSeparator() );
-            builder.append( buildTreeString( node ) );
+        for (DependencyNode node : nodeList.subList(1, nodeList.size())) {
+            builder.append("and" + System.lineSeparator());
+            builder.append(buildTreeString(node));
         }
         return builder.toString();
     }
 
     @Override
-    public String getCacheId()
-    {
+    public String getCacheId() {
         return "";
     }
 
     @Override
-    public boolean isCacheable()
-    {
+    public boolean isCacheable() {
         return false;
     }
 
     @Override
-    public boolean isResultValid( EnforcerRule rule )
-    {
+    public boolean isResultValid(EnforcerRule rule) {
         return false;
     }
 }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EnforcerDescriptor.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EnforcerDescriptor.java
index cb6d9f1..7c967fa 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EnforcerDescriptor.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EnforcerDescriptor.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -26,17 +44,14 @@ import org.apache.maven.enforcer.rule.api.EnforcerRule;
  *
  * @author <a href="mailto:gastaldi@apache.org">George Gastaldi</a>
  */
-public class EnforcerDescriptor
-{
+public class EnforcerDescriptor {
     EnforcerRule[] rules;
 
-    public EnforcerRule[] getRules()
-    {
+    public EnforcerRule[] getRules() {
         return rules;
     }
 
-    public void setRules( EnforcerRule[] rules )
-    {
+    public void setRules(EnforcerRule[] rules) {
         this.rules = rules;
     }
 }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EnforcerExpressionEvaluator.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EnforcerExpressionEvaluator.java
index c7385e9..406c274 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EnforcerExpressionEvaluator.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EnforcerExpressionEvaluator.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -29,9 +47,7 @@ import org.apache.maven.plugin.PluginParameterExpressionEvaluator;
  *
  * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
  */
-public class EnforcerExpressionEvaluator
-    extends PluginParameterExpressionEvaluator
-{
+public class EnforcerExpressionEvaluator extends PluginParameterExpressionEvaluator {
 
     /**
      * The Constructor.
@@ -39,9 +55,7 @@ public class EnforcerExpressionEvaluator
      * @param mavenSession {@link MavenSession}
      * @param theExecution {@link MojoExecution}
      */
-    public EnforcerExpressionEvaluator( MavenSession mavenSession, MojoExecution theExecution )
-    {
-        super( mavenSession, theExecution );
+    public EnforcerExpressionEvaluator(MavenSession mavenSession, MojoExecution theExecution) {
+        super(mavenSession, theExecution);
     }
-
 }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EvaluateBeanshell.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EvaluateBeanshell.java
index e29f786..14e3333 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EvaluateBeanshell.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/EvaluateBeanshell.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -19,76 +37,62 @@ package org.apache.maven.plugins.enforcer;
  * under the License.
  */
 
+import bsh.EvalError;
+import bsh.Interpreter;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
 import org.apache.maven.plugin.logging.Log;
 import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException;
 import org.codehaus.plexus.util.StringUtils;
 
-import bsh.EvalError;
-import bsh.Interpreter;
-
 /**
  * Rule for Maven Enforcer using Beanshell to evaluate a conditional expression.
  *
  * @author hugonnem
  */
-public class EvaluateBeanshell
-    extends AbstractNonCacheableEnforcerRule
-{
+public class EvaluateBeanshell extends AbstractNonCacheableEnforcerRule {
 
     /** Beanshell interpreter. */
-    private static final ThreadLocal<Interpreter> INTERPRETER = new ThreadLocal<Interpreter>()
-    {
+    private static final ThreadLocal<Interpreter> INTERPRETER = new ThreadLocal<Interpreter>() {
         @Override
-        protected Interpreter initialValue()
-        {
+        protected Interpreter initialValue() {
             return new Interpreter();
         }
     };
 
     /** The condition to be evaluated.
-     *  
+     *
      * @see {@link #setCondition(String)}
      * @see {@link #getCondition()}
      * */
     private String condition;
 
-    public final void setCondition( String condition )
-    {
+    public final void setCondition(String condition) {
         this.condition = condition;
     }
-    
-    public final String getCondition()
-    {
+
+    public final String getCondition() {
         return condition;
     }
 
     @Override
-    public void execute( EnforcerRuleHelper helper )
-        throws EnforcerRuleException
-    {
+    public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
         Log log = helper.getLog();
 
-        try
-        {
-            log.debug( "Echo condition : " + this.condition );
+        try {
+            log.debug("Echo condition : " + this.condition);
             // Evaluate condition within Plexus Container
-            String script = (String) helper.evaluate( this.condition );
-            log.debug( "Echo script : " + script );
-            if ( !evaluateCondition( script, log ) )
-            {
+            String script = (String) helper.evaluate(this.condition);
+            log.debug("Echo script : " + script);
+            if (!evaluateCondition(script, log)) {
                 String message = getMessage();
-                if ( StringUtils.isEmpty( message ) )
-                {
+                if (StringUtils.isEmpty(message)) {
                     message = "The expression \"" + condition + "\" is not true.";
                 }
-                throw new EnforcerRuleException( message );
+                throw new EnforcerRuleException(message);
             }
-        }
-        catch ( ExpressionEvaluationException e )
-        {
-            throw new EnforcerRuleException( "Unable to evaluate an expression '" + condition + "'", e );
+        } catch (ExpressionEvaluationException e) {
+            throw new EnforcerRuleException("Unable to evaluate an expression '" + condition + "'", e);
         }
     }
 
@@ -100,18 +104,13 @@ public class EvaluateBeanshell
      * @return boolean the evaluation of the expression
      * @throws EnforcerRuleException if the script could not be evaluated
      */
-    protected boolean evaluateCondition( String script, Log log )
-        throws EnforcerRuleException
-    {
+    protected boolean evaluateCondition(String script, Log log) throws EnforcerRuleException {
         Boolean evaluation;
-        try
-        {
-            evaluation = (Boolean) INTERPRETER.get().eval( script );
-            log.debug( "Echo evaluating : " + evaluation );
-        }
-        catch ( EvalError ex )
-        {
-            throw new EnforcerRuleException( "Couldn't evaluate condition: " + script, ex );
+        try {
+            evaluation = (Boolean) INTERPRETER.get().eval(script);
+            log.debug("Echo evaluating : " + evaluation);
+        } catch (EvalError ex) {
+            throw new EnforcerRuleException("Couldn't evaluate condition: " + script, ex);
         }
         return evaluation.booleanValue();
     }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/ExternalRules.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/ExternalRules.java
index ad0e7bc..954c655 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/ExternalRules.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/ExternalRules.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -19,6 +37,10 @@ package org.apache.maven.plugins.enforcer;
  * under the License.
  */
 
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.file.Files;
 import org.apache.maven.enforcer.rule.api.EnforcerRule;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
@@ -31,18 +53,12 @@ import org.codehaus.plexus.configuration.xml.XmlPlexusConfiguration;
 import org.codehaus.plexus.util.xml.Xpp3DomBuilder;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.file.Files;
-
 /**
  * An enforcer rule that will invoke rules from an external resource
  *
  * @author <a href="mailto:gastaldi@apache.org">George Gastaldi</a>
  */
-public class ExternalRules extends AbstractNonCacheableEnforcerRule
-{
+public class ExternalRules extends AbstractNonCacheableEnforcerRule {
     private static final String LOCATION_PREFIX_CLASSPATH = "classpath:";
 
     /**
@@ -51,23 +67,18 @@ public class ExternalRules extends AbstractNonCacheableEnforcerRule
      */
     String location;
 
-    public ExternalRules()
-    {
-    }
+    public ExternalRules() {}
 
-    public ExternalRules( String location )
-    {
+    public ExternalRules(String location) {
         this.location = location;
     }
 
     @Override
-    public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException
-    {
+    public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
         // Find descriptor
-        EnforcerDescriptor enforcerDescriptor = getEnforcerDescriptor( helper );
-        for ( EnforcerRule rule : enforcerDescriptor.getRules() )
-        {
-            rule.execute( helper );
+        EnforcerDescriptor enforcerDescriptor = getEnforcerDescriptor(helper);
+        for (EnforcerRule rule : enforcerDescriptor.getRules()) {
+            rule.execute(helper);
         }
     }
 
@@ -78,75 +89,54 @@ public class ExternalRules extends AbstractNonCacheableEnforcerRule
      * @return an {@link EnforcerDescriptor} for this rule
      * @throws EnforcerRuleException if any failure happens while reading the descriptor
      */
-    EnforcerDescriptor getEnforcerDescriptor( EnforcerRuleHelper helper )
-            throws EnforcerRuleException
-    {
-        try ( InputStream descriptorStream = resolveDescriptor( helper ) )
-        {
+    EnforcerDescriptor getEnforcerDescriptor(EnforcerRuleHelper helper) throws EnforcerRuleException {
+        try (InputStream descriptorStream = resolveDescriptor(helper)) {
             EnforcerDescriptor descriptor = new EnforcerDescriptor();
             // To get configuration from the enforcer-plugin mojo do:
-            //helper.evaluate(helper.getComponent(MojoExecution.class).getConfiguration().getChild("fail").getValue())
+            // helper.evaluate(helper.getComponent(MojoExecution.class).getConfiguration().getChild("fail").getValue())
             // Configure EnforcerDescriptor from the XML
-            ComponentConfigurator configurator = helper.getComponent( ComponentConfigurator.class, "basic" );
-            configurator.configureComponent( descriptor, toPlexusConfiguration( descriptorStream ), helper,
-                    getClassRealm( helper ) );
+            ComponentConfigurator configurator = helper.getComponent(ComponentConfigurator.class, "basic");
+            configurator.configureComponent(
+                    descriptor, toPlexusConfiguration(descriptorStream), helper, getClassRealm(helper));
             return descriptor;
-        }
-        catch ( EnforcerRuleException e )
-        {
+        } catch (EnforcerRuleException e) {
             throw e;
-        }
-        catch ( Exception e )
-        {
-            throw new EnforcerRuleException( "Error while enforcing rules", e );
+        } catch (Exception e) {
+            throw new EnforcerRuleException("Error while enforcing rules", e);
         }
     }
 
-    private InputStream resolveDescriptor( EnforcerRuleHelper helper )
-            throws ComponentLookupException, EnforcerRuleException
-    {
+    private InputStream resolveDescriptor(EnforcerRuleHelper helper)
+            throws ComponentLookupException, EnforcerRuleException {
         InputStream descriptorStream;
-        if ( location != null )
-        {
-            if ( location.startsWith( LOCATION_PREFIX_CLASSPATH ) )
-            {
-                String classpathLocation = location.substring( LOCATION_PREFIX_CLASSPATH.length() );
-                ClassLoader classRealm = getClassRealm( helper );
-                descriptorStream = classRealm.getResourceAsStream( classpathLocation );
-                if ( descriptorStream == null )
-                {
-                    throw new EnforcerRuleException( "Location '" + classpathLocation + "' not found in classpath" );
+        if (location != null) {
+            if (location.startsWith(LOCATION_PREFIX_CLASSPATH)) {
+                String classpathLocation = location.substring(LOCATION_PREFIX_CLASSPATH.length());
+                ClassLoader classRealm = getClassRealm(helper);
+                descriptorStream = classRealm.getResourceAsStream(classpathLocation);
+                if (descriptorStream == null) {
+                    throw new EnforcerRuleException("Location '" + classpathLocation + "' not found in classpath");
                 }
-            }
-            else
-            {
-                File descriptorFile = helper.alignToBaseDirectory( new File( location ) );
-                try
-                {
-                    descriptorStream = Files.newInputStream( descriptorFile.toPath() );
-                }
-                catch ( IOException e )
-                {
-                    throw new EnforcerRuleException( "Could not read descriptor in " + descriptorFile, e );
+            } else {
+                File descriptorFile = helper.alignToBaseDirectory(new File(location));
+                try {
+                    descriptorStream = Files.newInputStream(descriptorFile.toPath());
+                } catch (IOException e) {
+                    throw new EnforcerRuleException("Could not read descriptor in " + descriptorFile, e);
                 }
             }
-        }
-        else
-        {
-            throw new EnforcerRuleException( "No location provided" );
+        } else {
+            throw new EnforcerRuleException("No location provided");
         }
         return descriptorStream;
     }
 
-    private static PlexusConfiguration toPlexusConfiguration( InputStream descriptorStream )
-            throws XmlPullParserException, IOException
-    {
-        return new XmlPlexusConfiguration( Xpp3DomBuilder.build( descriptorStream, "UTF-8" ) );
+    private static PlexusConfiguration toPlexusConfiguration(InputStream descriptorStream)
+            throws XmlPullParserException, IOException {
+        return new XmlPlexusConfiguration(Xpp3DomBuilder.build(descriptorStream, "UTF-8"));
     }
 
-    private ClassRealm getClassRealm( EnforcerRuleHelper helper ) throws ComponentLookupException
-    {
-        return helper.getComponent( MojoExecution.class ).getMojoDescriptor().getRealm();
+    private ClassRealm getClassRealm(EnforcerRuleHelper helper) throws ComponentLookupException {
+        return helper.getComponent(MojoExecution.class).getMojoDescriptor().getRealm();
     }
-
-}
\ No newline at end of file
+}
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/ReactorModuleConvergence.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/ReactorModuleConvergence.java
index 71d8e5b..bfea8b7 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/ReactorModuleConvergence.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/ReactorModuleConvergence.java
@@ -1,479 +1,420 @@
-package org.apache.maven.plugins.enforcer;
-
-/*
- * 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.
- */
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
-import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
-import org.apache.maven.execution.MavenSession;
-import org.apache.maven.model.Dependency;
-import org.apache.maven.plugin.logging.Log;
-import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException;
-import org.codehaus.plexus.util.StringUtils;
-
-/**
- * This rule will check if a multi module build will follow the best practices.
- * 
- * @author Karl-Heinz Marbaise
- * @since 1.4
- */
-public class ReactorModuleConvergence
-    extends AbstractNonCacheableEnforcerRule
-{
-    private static final String MODULE_TEXT = " module: ";
-
-    private boolean ignoreModuleDependencies = false;
-
-    private Log logger;
-
-    @Override
-    public void execute( EnforcerRuleHelper helper )
-        throws EnforcerRuleException
-    {
-        logger = helper.getLog();
-
-        MavenSession session;
-        try
-        {
-            session = (MavenSession) helper.evaluate( "${session}" );
-        }
-        catch ( ExpressionEvaluationException eee )
-        {
-            throw new EnforcerRuleException( "Unable to retrieve the MavenSession: ", eee );
-        }
-
-        List<MavenProject> sortedProjects = session.getProjectDependencyGraph().getSortedProjects();
-        if ( sortedProjects != null && !sortedProjects.isEmpty() )
-        {
-            checkReactor( sortedProjects );
-            checkParentsInReactor( sortedProjects );
-            checkMissingParentsInReactor( sortedProjects );
-            checkParentsPartOfTheReactor( sortedProjects );
-            if ( !isIgnoreModuleDependencies() )
-            {
-                checkDependenciesWithinReactor( sortedProjects );
-            }
-        }
-
-    }
-
-    private void checkParentsPartOfTheReactor( List<MavenProject> sortedProjects )
-        throws EnforcerRuleException
-    {
-        List<MavenProject> parentsWhichAreNotPartOfTheReactor =
-            existParentsWhichAreNotPartOfTheReactor( sortedProjects );
-        if ( !parentsWhichAreNotPartOfTheReactor.isEmpty() )
-        {
-            StringBuilder sb = new StringBuilder().append( System.lineSeparator() );
-            addMessageIfExist( sb );
-            for ( MavenProject mavenProject : parentsWhichAreNotPartOfTheReactor )
-            {
-                sb.append( MODULE_TEXT );
-                sb.append( mavenProject.getId() );
-                sb.append( System.lineSeparator() );
-            }
-            throw new EnforcerRuleException( "Module parents have been found which could not be found in the reactor."
-                + sb.toString() );
-        }
-    }
-
-    /**
-     * Convenience method to create a user readable message.
-     * 
-     * @param sortedProjects The list of reactor projects.
-     * @throws EnforcerRuleException In case of a violation.
-     */
-    private void checkMissingParentsInReactor( List<MavenProject> sortedProjects )
-        throws EnforcerRuleException
-    {
-        List<MavenProject> modulesWithoutParentsInReactor = existModulesWithoutParentsInReactor( sortedProjects );
-        if ( !modulesWithoutParentsInReactor.isEmpty() )
-        {
-            StringBuilder sb = new StringBuilder().append( System.lineSeparator() );
-            addMessageIfExist( sb );
-            for ( MavenProject mavenProject : modulesWithoutParentsInReactor )
-            {
-                sb.append( MODULE_TEXT );
-                sb.append( mavenProject.getId() );
-                sb.append( System.lineSeparator() );
-            }
-            throw new EnforcerRuleException( "Reactor contains modules without parents." + sb.toString() );
-        }
-    }
-
-    private void checkDependenciesWithinReactor( List<MavenProject> sortedProjects )
-        throws EnforcerRuleException
-    {
-        // After we are sure having consistent version we can simply use the first one?
-        String reactorVersion = sortedProjects.get( 0 ).getVersion();
-
-        Map<MavenProject, List<Dependency>> areThereDependenciesWhichAreNotPartOfTheReactor =
-            areThereDependenciesWhichAreNotPartOfTheReactor( reactorVersion, sortedProjects );
-        if ( !areThereDependenciesWhichAreNotPartOfTheReactor.isEmpty() )
-        {
-            StringBuilder sb = new StringBuilder().append( System.lineSeparator() );
-            addMessageIfExist( sb );
-            // CHECKSTYLE_OFF: LineLength
-            for ( Entry<MavenProject, List<Dependency>> item : areThereDependenciesWhichAreNotPartOfTheReactor.entrySet() )
-            {
-                sb.append( MODULE_TEXT );
-                sb.append( item.getKey().getId() );
-                sb.append( System.lineSeparator() );
-                for ( Dependency dependency : item.getValue() )
-                {
-                    String id =
-                        dependency.getGroupId() + ":" + dependency.getArtifactId() + ":" + dependency.getVersion();
-                    sb.append( "    dependency: " );
-                    sb.append( id );
-                    sb.append( System.lineSeparator() );
-                }
-            }
-            throw new EnforcerRuleException(
-                                             "Reactor modules contains dependencies which do not reference the reactor."
-                                                 + sb.toString() );
-            // CHECKSTYLE_ON: LineLength
-        }
-    }
-
-    /**
-     * Convenience method to create a user readable message.
-     * 
-     * @param sortedProjects The list of reactor projects.
-     * @throws EnforcerRuleException In case of a violation.
-     */
-    private void checkParentsInReactor( List<MavenProject> sortedProjects )
-        throws EnforcerRuleException
-    {
-        // After we are sure having consistent version we can simply use the first one?
-        String reactorVersion = sortedProjects.get( 0 ).getVersion();
-
-        List<MavenProject> areParentsFromTheReactor = areParentsFromTheReactor( reactorVersion, sortedProjects );
-        if ( !areParentsFromTheReactor.isEmpty() )
-        {
-            StringBuilder sb = new StringBuilder().append( System.lineSeparator() );
-            addMessageIfExist( sb );
-            for ( MavenProject mavenProject : areParentsFromTheReactor )
-            {
-                sb.append( " --> " );
-                sb.append( mavenProject.getId() );
-                sb.append( " parent:" );
-                sb.append( mavenProject.getParent().getId() );
-                sb.append( System.lineSeparator() );
-            }
-            throw new EnforcerRuleException( "Reactor modules have parents which contain a wrong version."
-                + sb.toString() );
-        }
-    }
-
-    /**
-     * Convenience method to create user readable message.
-     * 
-     * @param sortedProjects The list of reactor projects.
-     * @throws EnforcerRuleException In case of a violation.
-     */
-    private void checkReactor( List<MavenProject> sortedProjects )
-        throws EnforcerRuleException
-    {
-        List<MavenProject> consistenceCheckResult = isReactorVersionConsistent( sortedProjects );
-        if ( !consistenceCheckResult.isEmpty() )
-        {
-            StringBuilder sb = new StringBuilder().append( System.lineSeparator() );
-            addMessageIfExist( sb );
-            for ( MavenProject mavenProject : consistenceCheckResult )
-            {
-                sb.append( " --> " );
-                sb.append( mavenProject.getId() );
-                sb.append( System.lineSeparator() );
-            }
-            throw new EnforcerRuleException( "The reactor contains different versions." + sb.toString() );
-        }
-    }
-
-    private List<MavenProject> areParentsFromTheReactor( String reactorVersion, List<MavenProject> sortedProjects )
-    {
-        List<MavenProject> result = new ArrayList<>();
-
-        for ( MavenProject mavenProject : sortedProjects )
-        {
-            logger.debug( "Project: " + mavenProject.getId() );
-            if ( hasParent( mavenProject ) )
-            {
-                if ( !mavenProject.isExecutionRoot() )
-                {
-                    MavenProject parent = mavenProject.getParent();
-                    if ( !reactorVersion.equals( parent.getVersion() ) )
-                    {
-                        logger.debug( "The project: " + mavenProject.getId()
-                            + " has a parent which version does not match the other elements in reactor" );
-                        result.add( mavenProject );
-                    }
-                }
-            }
-            else
-            {
-                // This situation is currently ignored, cause it's handled by existModulesWithoutParentsInReactor()
-            }
-        }
-
-        return result;
-    }
-
-    private List<MavenProject> existParentsWhichAreNotPartOfTheReactor( List<MavenProject> sortedProjects )
-    {
-        List<MavenProject> result = new ArrayList<>();
-
-        for ( MavenProject mavenProject : sortedProjects )
-        {
-            logger.debug( "Project: " + mavenProject.getId() );
-            if ( hasParent( mavenProject ) )
-            {
-                if ( !mavenProject.isExecutionRoot() )
-                {
-                    MavenProject parent = mavenProject.getParent();
-                    if ( !isProjectPartOfTheReactor( parent, sortedProjects ) )
-                    {
-                        result.add( mavenProject );
-                    }
-                }
-            }
-        }
-
-        return result;
-    }
-
-    /**
-     * This will check of the groupId/artifactId can be found in any reactor project. The version will be ignored cause
-     * versions are checked before.
-     * 
-     * @param project The project which should be checked if it is contained in the sortedProjects.
-     * @param sortedProjects The list of existing projects.
-     * @return true if the project has been found within the list false otherwise.
-     */
-    private boolean isProjectPartOfTheReactor( MavenProject project, List<MavenProject> sortedProjects )
-    {
-        return isGAPartOfTheReactor( project.getGroupId(), project.getArtifactId(), sortedProjects );
-    }
-
-    private boolean isDependencyPartOfTheReactor( Dependency dependency, List<MavenProject> sortedProjects )
-    {
-        return isGAPartOfTheReactor( dependency.getGroupId(), dependency.getArtifactId(), sortedProjects );
-    }
-
-    /**
-     * This will check if the given <code>groupId/artifactId</code> is part of the current reactor.
-     * 
-     * @param groupId The groupId
-     * @param artifactId The artifactId
-     * @param sortedProjects The list of projects within the reactor.
-     * @return true if the groupId/artifactId is part of the reactor false otherwise.
-     */
-    private boolean isGAPartOfTheReactor( String groupId, String artifactId, List<MavenProject> sortedProjects )
-    {
-        boolean result = false;
-        for ( MavenProject mavenProject : sortedProjects )
-        {
-            String parentId = groupId + ":" + artifactId;
-            String projectId = mavenProject.getGroupId() + ":" + mavenProject.getArtifactId();
-            if ( parentId.equals( projectId ) )
-            {
-                result = true;
-            }
-        }
-        return result;
-    }
-
-    /**
-     * Assume we have a module which is a child of a multi module build but this child does not have a parent. This
-     * method will exactly search for such cases.
-     * 
-     * @param sortedProjects The sorted list of the reactor modules.
-     * @return The resulting list will contain the modules in the reactor which do not have a parent. The list will
-     *         never null. If the list is empty no violation have happened.
-     */
-    private List<MavenProject> existModulesWithoutParentsInReactor( List<MavenProject> sortedProjects )
-    {
-        List<MavenProject> result = new ArrayList<>();
-
-        for ( MavenProject mavenProject : sortedProjects )
-        {
-            logger.debug( "Project: " + mavenProject.getId() );
-            if ( !hasParent( mavenProject ) )
-            {
-                // TODO: Should add an option to force having a parent?
-                if ( mavenProject.isExecutionRoot() )
-                {
-                    logger.debug( "The root does not need having a parent." );
-                }
-                else
-                {
-                    logger.debug( "The module: " + mavenProject.getId() + " has no parent." );
-                    result.add( mavenProject );
-                }
-            }
-        }
-
-        return result;
-    }
-
-    /**
-     * Convenience method to handle adding a dependency to the Map of List.
-     * 
-     * @param result The result List which should be handled.
-     * @param project The MavenProject which will be added.
-     * @param dependency The dependency which will be added.
-     */
-    private void addDep( Map<MavenProject, List<Dependency>> result, MavenProject project, Dependency dependency )
-    {
-        if ( result.containsKey( project ) )
-        {
-            List<Dependency> list = result.get( project );
-            if ( list == null )
-            {
-                list = new ArrayList<>();
-            }
-            list.add( dependency );
-            result.put( project, list );
-        }
-        else
-        {
-            List<Dependency> list = new ArrayList<>();
-            list.add( dependency );
-            result.put( project, list );
-        }
-    }
-
-    /**
-     * Go through the list of modules in the builds and check if we have dependencies. If yes we will check every
-     * dependency based on groupId/artifactId if it belongs to the multi module build. In such a case it will be checked
-     * if the version does fit the version in the rest of build.
-     * 
-     * @param reactorVersion The version of the reactor.
-     * @param sortedProjects The list of existing projects within this build.
-     * @return List of violations. Never null. If the list is empty than no violation has happened.
-     */
-    // CHECKSTYLE_OFF: LineLength
-    private Map<MavenProject, List<Dependency>> areThereDependenciesWhichAreNotPartOfTheReactor( String reactorVersion,
-                                                                                                 List<MavenProject> sortedProjects )
-    // CHECKSTYLE_ON: LineLength
-    {
-        Map<MavenProject, List<Dependency>> result = new HashMap<>();
-        for ( MavenProject mavenProject : sortedProjects )
-        {
-            logger.debug( "Project: " + mavenProject.getId() );
-
-            List<Dependency> dependencies = mavenProject.getDependencies();
-            if ( hasDependencies( dependencies ) )
-            {
-                for ( Dependency dependency : dependencies )
-                {
-                    logger.debug( " -> Dep:" + dependency.getGroupId() + ":" + dependency.getArtifactId() + ":"
-                        + dependency.getVersion() );
-                    if ( isDependencyPartOfTheReactor( dependency, sortedProjects ) )
-                    {
-                        if ( !dependency.getVersion().equals( reactorVersion ) )
-                        {
-                            addDep( result, mavenProject, dependency );
-                        }
-                    }
-                }
-            }
-        }
-
-        return result;
-    }
-
-    /**
-     * This method will check the following situation within a multi-module build.
-     * 
-     * <pre>
-     *  &lt;parent&gt;
-     *    &lt;groupId&gt;...&lt;/groupId&gt;
-     *    &lt;artifactId&gt;...&lt;/artifactId&gt;
-     *    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
-     *  &lt;/parent&gt;
-     *  
-     *  &lt;version&gt;1.1-SNAPSHOT&lt;/version&gt;
-     * </pre>
-     * 
-     * @param projectList The sorted list of the reactor modules.
-     * @return The resulting list will contain the modules in the reactor which do the thing in the example above. The
-     *         list will never null. If the list is empty no violation have happened.
-     */
-    private List<MavenProject> isReactorVersionConsistent( List<MavenProject> projectList )
-    {
-        List<MavenProject> result = new ArrayList<>();
-
-        if ( projectList != null && !projectList.isEmpty() )
-        {
-            String version = projectList.get( 0 ).getVersion();
-            logger.debug( "First version:" + version );
-            for ( MavenProject mavenProject : projectList )
-            {
-                logger.debug( " -> checking " + mavenProject.getId() );
-                if ( !version.equals( mavenProject.getVersion() ) )
-                {
-                    result.add( mavenProject );
-                }
-            }
-        }
-        return result;
-    }
-
-    private boolean hasDependencies( List<Dependency> dependencies )
-    {
-        return dependencies != null && !dependencies.isEmpty();
-    }
-
-    private boolean hasParent( MavenProject mavenProject )
-    {
-        return mavenProject.getParent() != null;
-    }
-
-    public boolean isIgnoreModuleDependencies()
-    {
-        return ignoreModuleDependencies;
-    }
-
-    public void setIgnoreModuleDependencies( boolean ignoreModuleDependencies )
-    {
-        this.ignoreModuleDependencies = ignoreModuleDependencies;
-    }
-
-    /**
-     * This will add the given user message to the output.
-     * 
-     * @param sb The already initialized exception message part.
-     */
-    private void addMessageIfExist( StringBuilder sb )
-    {
-        if ( !StringUtils.isEmpty( getMessage() ) )
-        {
-            sb.append( getMessage() );
-            sb.append( System.lineSeparator() );
-        }
-    }
-
-}
+/*
+ * 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.
+ */
+package org.apache.maven.plugins.enforcer;
+
+/*
+ * 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.
+ */
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
+import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.model.Dependency;
+import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException;
+import org.codehaus.plexus.util.StringUtils;
+
+/**
+ * This rule will check if a multi module build will follow the best practices.
+ *
+ * @author Karl-Heinz Marbaise
+ * @since 1.4
+ */
+public class ReactorModuleConvergence extends AbstractNonCacheableEnforcerRule {
+    private static final String MODULE_TEXT = " module: ";
+
+    private boolean ignoreModuleDependencies = false;
+
+    private Log logger;
+
+    @Override
+    public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
+        logger = helper.getLog();
+
+        MavenSession session;
+        try {
+            session = (MavenSession) helper.evaluate("${session}");
+        } catch (ExpressionEvaluationException eee) {
+            throw new EnforcerRuleException("Unable to retrieve the MavenSession: ", eee);
+        }
+
+        List<MavenProject> sortedProjects = session.getProjectDependencyGraph().getSortedProjects();
+        if (sortedProjects != null && !sortedProjects.isEmpty()) {
+            checkReactor(sortedProjects);
+            checkParentsInReactor(sortedProjects);
+            checkMissingParentsInReactor(sortedProjects);
+            checkParentsPartOfTheReactor(sortedProjects);
+            if (!isIgnoreModuleDependencies()) {
+                checkDependenciesWithinReactor(sortedProjects);
+            }
+        }
+    }
+
+    private void checkParentsPartOfTheReactor(List<MavenProject> sortedProjects) throws EnforcerRuleException {
+        List<MavenProject> parentsWhichAreNotPartOfTheReactor = existParentsWhichAreNotPartOfTheReactor(sortedProjects);
+        if (!parentsWhichAreNotPartOfTheReactor.isEmpty()) {
+            StringBuilder sb = new StringBuilder().append(System.lineSeparator());
+            addMessageIfExist(sb);
+            for (MavenProject mavenProject : parentsWhichAreNotPartOfTheReactor) {
+                sb.append(MODULE_TEXT);
+                sb.append(mavenProject.getId());
+                sb.append(System.lineSeparator());
+            }
+            throw new EnforcerRuleException(
+                    "Module parents have been found which could not be found in the reactor." + sb.toString());
+        }
+    }
+
+    /**
+     * Convenience method to create a user readable message.
+     *
+     * @param sortedProjects The list of reactor projects.
+     * @throws EnforcerRuleException In case of a violation.
+     */
+    private void checkMissingParentsInReactor(List<MavenProject> sortedProjects) throws EnforcerRuleException {
+        List<MavenProject> modulesWithoutParentsInReactor = existModulesWithoutParentsInReactor(sortedProjects);
+        if (!modulesWithoutParentsInReactor.isEmpty()) {
+            StringBuilder sb = new StringBuilder().append(System.lineSeparator());
+            addMessageIfExist(sb);
+            for (MavenProject mavenProject : modulesWithoutParentsInReactor) {
+                sb.append(MODULE_TEXT);
+                sb.append(mavenProject.getId());
+                sb.append(System.lineSeparator());
+            }
+            throw new EnforcerRuleException("Reactor contains modules without parents." + sb.toString());
+        }
+    }
+
+    private void checkDependenciesWithinReactor(List<MavenProject> sortedProjects) throws EnforcerRuleException {
+        // After we are sure having consistent version we can simply use the first one?
+        String reactorVersion = sortedProjects.get(0).getVersion();
+
+        Map<MavenProject, List<Dependency>> areThereDependenciesWhichAreNotPartOfTheReactor =
+                areThereDependenciesWhichAreNotPartOfTheReactor(reactorVersion, sortedProjects);
+        if (!areThereDependenciesWhichAreNotPartOfTheReactor.isEmpty()) {
+            StringBuilder sb = new StringBuilder().append(System.lineSeparator());
+            addMessageIfExist(sb);
+            // CHECKSTYLE_OFF: LineLength
+            for (Entry<MavenProject, List<Dependency>> item :
+                    areThereDependenciesWhichAreNotPartOfTheReactor.entrySet()) {
+                sb.append(MODULE_TEXT);
+                sb.append(item.getKey().getId());
+                sb.append(System.lineSeparator());
+                for (Dependency dependency : item.getValue()) {
+                    String id =
+                            dependency.getGroupId() + ":" + dependency.getArtifactId() + ":" + dependency.getVersion();
+                    sb.append("    dependency: ");
+                    sb.append(id);
+                    sb.append(System.lineSeparator());
+                }
+            }
+            throw new EnforcerRuleException(
+                    "Reactor modules contains dependencies which do not reference the reactor." + sb.toString());
+            // CHECKSTYLE_ON: LineLength
+        }
+    }
+
+    /**
+     * Convenience method to create a user readable message.
+     *
+     * @param sortedProjects The list of reactor projects.
+     * @throws EnforcerRuleException In case of a violation.
+     */
+    private void checkParentsInReactor(List<MavenProject> sortedProjects) throws EnforcerRuleException {
+        // After we are sure having consistent version we can simply use the first one?
+        String reactorVersion = sortedProjects.get(0).getVersion();
+
+        List<MavenProject> areParentsFromTheReactor = areParentsFromTheReactor(reactorVersion, sortedProjects);
+        if (!areParentsFromTheReactor.isEmpty()) {
+            StringBuilder sb = new StringBuilder().append(System.lineSeparator());
+            addMessageIfExist(sb);
+            for (MavenProject mavenProject : areParentsFromTheReactor) {
+                sb.append(" --> ");
+                sb.append(mavenProject.getId());
+                sb.append(" parent:");
+                sb.append(mavenProject.getParent().getId());
+                sb.append(System.lineSeparator());
+            }
+            throw new EnforcerRuleException(
+                    "Reactor modules have parents which contain a wrong version." + sb.toString());
+        }
+    }
+
+    /**
+     * Convenience method to create user readable message.
+     *
+     * @param sortedProjects The list of reactor projects.
+     * @throws EnforcerRuleException In case of a violation.
+     */
+    private void checkReactor(List<MavenProject> sortedProjects) throws EnforcerRuleException {
+        List<MavenProject> consistenceCheckResult = isReactorVersionConsistent(sortedProjects);
+        if (!consistenceCheckResult.isEmpty()) {
+            StringBuilder sb = new StringBuilder().append(System.lineSeparator());
+            addMessageIfExist(sb);
+            for (MavenProject mavenProject : consistenceCheckResult) {
+                sb.append(" --> ");
+                sb.append(mavenProject.getId());
+                sb.append(System.lineSeparator());
+            }
+            throw new EnforcerRuleException("The reactor contains different versions." + sb.toString());
+        }
+    }
+
+    private List<MavenProject> areParentsFromTheReactor(String reactorVersion, List<MavenProject> sortedProjects) {
+        List<MavenProject> result = new ArrayList<>();
+
+        for (MavenProject mavenProject : sortedProjects) {
+            logger.debug("Project: " + mavenProject.getId());
+            if (hasParent(mavenProject)) {
+                if (!mavenProject.isExecutionRoot()) {
+                    MavenProject parent = mavenProject.getParent();
+                    if (!reactorVersion.equals(parent.getVersion())) {
+                        logger.debug("The project: " + mavenProject.getId()
+                                + " has a parent which version does not match the other elements in reactor");
+                        result.add(mavenProject);
+                    }
+                }
+            } else {
+                // This situation is currently ignored, cause it's handled by existModulesWithoutParentsInReactor()
+            }
+        }
+
+        return result;
+    }
+
+    private List<MavenProject> existParentsWhichAreNotPartOfTheReactor(List<MavenProject> sortedProjects) {
+        List<MavenProject> result = new ArrayList<>();
+
+        for (MavenProject mavenProject : sortedProjects) {
+            logger.debug("Project: " + mavenProject.getId());
+            if (hasParent(mavenProject)) {
+                if (!mavenProject.isExecutionRoot()) {
+                    MavenProject parent = mavenProject.getParent();
+                    if (!isProjectPartOfTheReactor(parent, sortedProjects)) {
+                        result.add(mavenProject);
+                    }
+                }
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * This will check of the groupId/artifactId can be found in any reactor project. The version will be ignored cause
+     * versions are checked before.
+     *
+     * @param project The project which should be checked if it is contained in the sortedProjects.
+     * @param sortedProjects The list of existing projects.
+     * @return true if the project has been found within the list false otherwise.
+     */
+    private boolean isProjectPartOfTheReactor(MavenProject project, List<MavenProject> sortedProjects) {
+        return isGAPartOfTheReactor(project.getGroupId(), project.getArtifactId(), sortedProjects);
+    }
+
+    private boolean isDependencyPartOfTheReactor(Dependency dependency, List<MavenProject> sortedProjects) {
+        return isGAPartOfTheReactor(dependency.getGroupId(), dependency.getArtifactId(), sortedProjects);
+    }
+
+    /**
+     * This will check if the given <code>groupId/artifactId</code> is part of the current reactor.
+     *
+     * @param groupId The groupId
+     * @param artifactId The artifactId
+     * @param sortedProjects The list of projects within the reactor.
+     * @return true if the groupId/artifactId is part of the reactor false otherwise.
+     */
+    private boolean isGAPartOfTheReactor(String groupId, String artifactId, List<MavenProject> sortedProjects) {
+        boolean result = false;
+        for (MavenProject mavenProject : sortedProjects) {
+            String parentId = groupId + ":" + artifactId;
+            String projectId = mavenProject.getGroupId() + ":" + mavenProject.getArtifactId();
+            if (parentId.equals(projectId)) {
+                result = true;
+            }
+        }
+        return result;
+    }
+
+    /**
+     * Assume we have a module which is a child of a multi module build but this child does not have a parent. This
+     * method will exactly search for such cases.
+     *
+     * @param sortedProjects The sorted list of the reactor modules.
+     * @return The resulting list will contain the modules in the reactor which do not have a parent. The list will
+     *         never null. If the list is empty no violation have happened.
+     */
+    private List<MavenProject> existModulesWithoutParentsInReactor(List<MavenProject> sortedProjects) {
+        List<MavenProject> result = new ArrayList<>();
+
+        for (MavenProject mavenProject : sortedProjects) {
+            logger.debug("Project: " + mavenProject.getId());
+            if (!hasParent(mavenProject)) {
+                // TODO: Should add an option to force having a parent?
+                if (mavenProject.isExecutionRoot()) {
+                    logger.debug("The root does not need having a parent.");
+                } else {
+                    logger.debug("The module: " + mavenProject.getId() + " has no parent.");
+                    result.add(mavenProject);
+                }
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * Convenience method to handle adding a dependency to the Map of List.
+     *
+     * @param result The result List which should be handled.
+     * @param project The MavenProject which will be added.
+     * @param dependency The dependency which will be added.
+     */
+    private void addDep(Map<MavenProject, List<Dependency>> result, MavenProject project, Dependency dependency) {
+        if (result.containsKey(project)) {
+            List<Dependency> list = result.get(project);
+            if (list == null) {
+                list = new ArrayList<>();
+            }
+            list.add(dependency);
+            result.put(project, list);
+        } else {
+            List<Dependency> list = new ArrayList<>();
+            list.add(dependency);
+            result.put(project, list);
+        }
+    }
+
+    /**
+     * Go through the list of modules in the builds and check if we have dependencies. If yes we will check every
+     * dependency based on groupId/artifactId if it belongs to the multi module build. In such a case it will be checked
+     * if the version does fit the version in the rest of build.
+     *
+     * @param reactorVersion The version of the reactor.
+     * @param sortedProjects The list of existing projects within this build.
+     * @return List of violations. Never null. If the list is empty than no violation has happened.
+     */
+    // CHECKSTYLE_OFF: LineLength
+    private Map<MavenProject, List<Dependency>> areThereDependenciesWhichAreNotPartOfTheReactor(
+            String reactorVersion, List<MavenProject> sortedProjects)
+                // CHECKSTYLE_ON: LineLength
+            {
+        Map<MavenProject, List<Dependency>> result = new HashMap<>();
+        for (MavenProject mavenProject : sortedProjects) {
+            logger.debug("Project: " + mavenProject.getId());
+
+            List<Dependency> dependencies = mavenProject.getDependencies();
+            if (hasDependencies(dependencies)) {
+                for (Dependency dependency : dependencies) {
+                    logger.debug(" -> Dep:" + dependency.getGroupId() + ":" + dependency.getArtifactId() + ":"
+                            + dependency.getVersion());
+                    if (isDependencyPartOfTheReactor(dependency, sortedProjects)) {
+                        if (!dependency.getVersion().equals(reactorVersion)) {
+                            addDep(result, mavenProject, dependency);
+                        }
+                    }
+                }
+            }
+        }
+
+        return result;
+    }
+
+    /**
+     * This method will check the following situation within a multi-module build.
+     *
+     * <pre>
+     *  &lt;parent&gt;
+     *    &lt;groupId&gt;...&lt;/groupId&gt;
+     *    &lt;artifactId&gt;...&lt;/artifactId&gt;
+     *    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
+     *  &lt;/parent&gt;
+     *
+     *  &lt;version&gt;1.1-SNAPSHOT&lt;/version&gt;
+     * </pre>
+     *
+     * @param projectList The sorted list of the reactor modules.
+     * @return The resulting list will contain the modules in the reactor which do the thing in the example above. The
+     *         list will never null. If the list is empty no violation have happened.
+     */
+    private List<MavenProject> isReactorVersionConsistent(List<MavenProject> projectList) {
+        List<MavenProject> result = new ArrayList<>();
+
+        if (projectList != null && !projectList.isEmpty()) {
+            String version = projectList.get(0).getVersion();
+            logger.debug("First version:" + version);
+            for (MavenProject mavenProject : projectList) {
+                logger.debug(" -> checking " + mavenProject.getId());
+                if (!version.equals(mavenProject.getVersion())) {
+                    result.add(mavenProject);
+                }
+            }
+        }
+        return result;
+    }
+
+    private boolean hasDependencies(List<Dependency> dependencies) {
+        return dependencies != null && !dependencies.isEmpty();
+    }
+
+    private boolean hasParent(MavenProject mavenProject) {
+        return mavenProject.getParent() != null;
+    }
+
+    public boolean isIgnoreModuleDependencies() {
+        return ignoreModuleDependencies;
+    }
+
+    public void setIgnoreModuleDependencies(boolean ignoreModuleDependencies) {
+        this.ignoreModuleDependencies = ignoreModuleDependencies;
+    }
+
+    /**
+     * This will add the given user message to the output.
+     *
+     * @param sb The already initialized exception message part.
+     */
+    private void addMessageIfExist(StringBuilder sb) {
+        if (!StringUtils.isEmpty(getMessage())) {
+            sb.append(getMessage());
+            sb.append(System.lineSeparator());
+        }
+    }
+}
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireActiveProfile.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireActiveProfile.java
index 20f8def..c9d7c46 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireActiveProfile.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireActiveProfile.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -22,7 +40,6 @@ package org.apache.maven.plugins.enforcer;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
-
 import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
 import org.apache.maven.project.MavenProject;
@@ -34,12 +51,10 @@ import org.codehaus.plexus.util.StringUtils;
  *
  * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
  */
-public class RequireActiveProfile
-    extends AbstractNonCacheableEnforcerRule
-{
+public class RequireActiveProfile extends AbstractNonCacheableEnforcerRule {
 
     /** Comma separated list of profiles to check.
-     *  
+     *
      * @see {@link #setProfiles(String)}
      * @see {@link #getProfiles()}
      */
@@ -51,80 +66,61 @@ public class RequireActiveProfile
      * @see {@link #isAll()}
      */
     private boolean all = true;
-    
-    public final String getProfiles()
-    {
+
+    public final String getProfiles() {
         return profiles;
     }
-    
-    public final void setProfiles( String profiles )
-    {
+
+    public final void setProfiles(String profiles) {
         this.profiles = profiles;
     }
-    
-    public final boolean isAll()
-    {
+
+    public final boolean isAll() {
         return all;
     }
-    
-    public final void setAll( boolean all )
-    {
+
+    public final void setAll(boolean all) {
         this.all = all;
     }
 
     @Override
-    public void execute( EnforcerRuleHelper theHelper )
-        throws EnforcerRuleException
-    {
+    public void execute(EnforcerRuleHelper theHelper) throws EnforcerRuleException {
         List<String> missingProfiles = new ArrayList<>();
-        try
-        {
-            MavenProject project = (MavenProject) theHelper.evaluate( "${project}" );
-            if ( StringUtils.isNotEmpty( profiles ) )
-            {
-                String[] profileIds = profiles.split( "," );
-                for ( String profileId : profileIds )
-                {
-                    if ( !isProfileActive( project, profileId ) )
-                    {
-                        missingProfiles.add( profileId );
+        try {
+            MavenProject project = (MavenProject) theHelper.evaluate("${project}");
+            if (StringUtils.isNotEmpty(profiles)) {
+                String[] profileIds = profiles.split(",");
+                for (String profileId : profileIds) {
+                    if (!isProfileActive(project, profileId)) {
+                        missingProfiles.add(profileId);
                     }
                 }
 
                 boolean fail = false;
-                if ( !missingProfiles.isEmpty() )
-                {
-                    if ( all || missingProfiles.size() == profileIds.length )
-                    {
-                      fail = true;
+                if (!missingProfiles.isEmpty()) {
+                    if (all || missingProfiles.size() == profileIds.length) {
+                        fail = true;
                     }
                 }
 
-                if ( fail )
-                {
+                if (fail) {
                     String message = getMessage();
                     StringBuilder buf = new StringBuilder();
-                    if ( message != null )
-                    {
-                        buf.append( message + System.lineSeparator() );
+                    if (message != null) {
+                        buf.append(message + System.lineSeparator());
                     }
 
-                    for ( String profile : missingProfiles )
-                    {
-                        buf.append( "Profile \"" + profile + "\" is not activated." + System.lineSeparator() );
+                    for (String profile : missingProfiles) {
+                        buf.append("Profile \"" + profile + "\" is not activated." + System.lineSeparator());
                     }
 
-                    throw new EnforcerRuleException( buf.toString() );
+                    throw new EnforcerRuleException(buf.toString());
                 }
-
             }
 
+        } catch (ExpressionEvaluationException e) {
+            throw new EnforcerRuleException("Unable to retrieve the project.", e);
         }
-        catch ( ExpressionEvaluationException e )
-        {
-            throw new EnforcerRuleException( "Unable to retrieve the project.", e );
-        }
-
     }
 
     /**
@@ -134,12 +130,10 @@ public class RequireActiveProfile
      * @param profileId the profile name
      * @return <code>true</code> if profile is active, otherwise <code>false</code>
      */
-    protected boolean isProfileActive( MavenProject project, String profileId )
-    {
-        for ( Map.Entry<String, List<String>> entry : project.getInjectedProfileIds().entrySet() )
-        {
-            if ( entry.getValue().contains( profileId ) )
-            {
+    protected boolean isProfileActive(MavenProject project, String profileId) {
+        for (Map.Entry<String, List<String>> entry :
+                project.getInjectedProfileIds().entrySet()) {
+            if (entry.getValue().contains(profileId)) {
                 return true;
             }
         }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireEnvironmentVariable.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireEnvironmentVariable.java
index d325f98..1f23e34 100755
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireEnvironmentVariable.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireEnvironmentVariable.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -27,9 +45,7 @@ import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
  *
  * @author <a href='mailto:marvin[at]marvinformatics[dot]com'>Marvin Froeder</a>
  */
-public class RequireEnvironmentVariable
-    extends AbstractPropertyEnforcerRule
-{
+public class RequireEnvironmentVariable extends AbstractPropertyEnforcerRule {
 
     /**
      * Specify the required variable.
@@ -38,57 +54,49 @@ public class RequireEnvironmentVariable
 
     /**
      * @param variableName the variable name
-     * 
+     *
      * @see #setVariableName(String)
      * @see #getVariableName()
      */
-    public final void setVariableName( String variableName )
-    {
+    public final void setVariableName(String variableName) {
         this.variableName = variableName;
     }
-    
-    public final String getVariableName()
-    {
+
+    public final String getVariableName() {
         return variableName;
     }
 
     @Override
-    public String resolveValue( EnforcerRuleHelper helper )
-    {
-        String envValue = System.getenv( variableName );
+    public String resolveValue(EnforcerRuleHelper helper) {
+        String envValue = System.getenv(variableName);
         return envValue;
     }
 
     @Override
-    public boolean isCacheable()
-    {
+    public boolean isCacheable() {
         // environment variables won't change while maven is on the run
         return true;
     }
 
     @Override
-    public boolean isResultValid( EnforcerRule cachedRule )
-    {
+    public boolean isResultValid(EnforcerRule cachedRule) {
         // this rule shall always have the same result, since environment
         // variables are set before maven is launched
         return true;
     }
 
     @Override
-    public String getCacheId()
-    {
+    public String getCacheId() {
         return variableName;
     }
 
     @Override
-    public String getPropertyName()
-    {
+    public String getPropertyName() {
         return variableName;
     }
 
     @Override
-    public String getName()
-    {
+    public String getName() {
         return "Environment variable";
     }
 }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireExplicitDependencyScope.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireExplicitDependencyScope.java
index 2a5b96e..164445b 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireExplicitDependencyScope.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireExplicitDependencyScope.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -21,7 +39,6 @@ package org.apache.maven.plugins.enforcer;
 
 import java.text.ChoiceFormat;
 import java.util.List;
-
 import org.apache.maven.enforcer.rule.api.EnforcerLevel;
 import org.apache.maven.enforcer.rule.api.EnforcerRule2;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
@@ -36,62 +53,49 @@ import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluatio
  * Checks that all dependencies have an explicitly declared scope in the non-effective pom (i.e. without taking
  * inheritance or dependency management into account).
  */
-public class RequireExplicitDependencyScope
-    extends AbstractNonCacheableEnforcerRule
-    implements EnforcerRule2
-{
+public class RequireExplicitDependencyScope extends AbstractNonCacheableEnforcerRule implements EnforcerRule2 {
 
     @Override
-    public void execute( EnforcerRuleHelper helper )
-        throws EnforcerRuleException
-    {
-        try
-        {
+    public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
+        try {
             int numMissingDependencyScopes = 0;
-            MavenProject project = (MavenProject) helper.evaluate( "${project}" );
-            if ( project == null )
-            {
-                throw new ExpressionEvaluationException( "${project} is null" );
+            MavenProject project = (MavenProject) helper.evaluate("${project}");
+            if (project == null) {
+                throw new ExpressionEvaluationException("${project} is null");
             }
             List<Dependency> dependencies = project.getOriginalModel().getDependencies(); // this is the non-effective
-                                                                                          // model but the original one
-                                                                                          // without inheritance and
-                                                                                          // interpolation resolved
+            // model but the original one
+            // without inheritance and
+            // interpolation resolved
             // check scope without considering inheritance
-            for ( Dependency dependency : dependencies )
-            {
-                helper.getLog().debug( "Found dependency " + dependency );
-                if ( dependency.getScope() == null )
-                {
+            for (Dependency dependency : dependencies) {
+                helper.getLog().debug("Found dependency " + dependency);
+                if (dependency.getScope() == null) {
                     MessageBuilder msgBuilder = MessageUtils.buffer();
                     msgBuilder
-                        .a( "Dependency " ).strong( dependency.getManagementKey() )
-                        .a( " @ " ).strong( formatLocation( project, dependency.getLocation( "" ) ) )
-                        .a( " does not have an explicit scope defined!" ).toString();
-                    if ( getLevel() == EnforcerLevel.ERROR )
-                    {
-                        helper.getLog().error( msgBuilder.toString() );
-                    }
-                    else
-                    {
-                        helper.getLog().warn( msgBuilder.toString() );
+                            .a("Dependency ")
+                            .strong(dependency.getManagementKey())
+                            .a(" @ ")
+                            .strong(formatLocation(project, dependency.getLocation("")))
+                            .a(" does not have an explicit scope defined!")
+                            .toString();
+                    if (getLevel() == EnforcerLevel.ERROR) {
+                        helper.getLog().error(msgBuilder.toString());
+                    } else {
+                        helper.getLog().warn(msgBuilder.toString());
                     }
                     numMissingDependencyScopes++;
                 }
             }
-            if ( numMissingDependencyScopes > 0 )
-            {
-                ChoiceFormat scopesFormat = new ChoiceFormat( "1#scope|1<scopes" );
+            if (numMissingDependencyScopes > 0) {
+                ChoiceFormat scopesFormat = new ChoiceFormat("1#scope|1<scopes");
                 String logCategory = getLevel() == EnforcerLevel.ERROR ? "errors" : "warnings";
-                throw new EnforcerRuleException( "Found " + numMissingDependencyScopes + " missing dependency "
-                    + scopesFormat.format( numMissingDependencyScopes )
-                    + ". Look at the " + logCategory + " emitted above for the details." );
+                throw new EnforcerRuleException("Found " + numMissingDependencyScopes + " missing dependency "
+                        + scopesFormat.format(numMissingDependencyScopes)
+                        + ". Look at the " + logCategory + " emitted above for the details.");
             }
-        }
-        catch ( ExpressionEvaluationException eee )
-        {
-            throw new EnforcerRuleException( "Cannot resolve expression: " + eee.getCause(), eee );
+        } catch (ExpressionEvaluationException eee) {
+            throw new EnforcerRuleException("Cannot resolve expression: " + eee.getCause(), eee);
         }
     }
-
 }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFileChecksum.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFileChecksum.java
index 1ca890d..6239cfa 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFileChecksum.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFileChecksum.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -23,7 +41,6 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
-
 import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
@@ -35,9 +52,7 @@ import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
  * @author Lyubomyr Shaydariv
  * @see RequireTextFileChecksum
  */
-public class RequireFileChecksum
-    extends AbstractNonCacheableEnforcerRule
-{
+public class RequireFileChecksum extends AbstractNonCacheableEnforcerRule {
 
     protected File file;
 
@@ -48,56 +63,45 @@ public class RequireFileChecksum
     private String nonexistentFileMessage;
 
     @Override
-    public void execute( EnforcerRuleHelper helper )
-        throws EnforcerRuleException
-    {
-        if ( this.file == null )
-        {
-            throw new EnforcerRuleException( "Input file unspecified" );
+    public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
+        if (this.file == null) {
+            throw new EnforcerRuleException("Input file unspecified");
         }
 
-        if ( this.type == null )
-        {
-            throw new EnforcerRuleException( "Hash type unspecified" );
+        if (this.type == null) {
+            throw new EnforcerRuleException("Hash type unspecified");
         }
 
-        if ( this.checksum == null )
-        {
-            throw new EnforcerRuleException( "Checksum unspecified" );
+        if (this.checksum == null) {
+            throw new EnforcerRuleException("Checksum unspecified");
         }
 
-        if ( !this.file.exists() )
-        {
+        if (!this.file.exists()) {
             String message = nonexistentFileMessage;
-            if ( message == null )
-            {
+            if (message == null) {
                 message = "File does not exist: " + this.file.getAbsolutePath();
             }
-            throw new EnforcerRuleException( message );
+            throw new EnforcerRuleException(message);
         }
 
-        if ( this.file.isDirectory() )
-        {
-            throw new EnforcerRuleException( "Cannot calculate the checksum of directory: "
-                + this.file.getAbsolutePath() );
+        if (this.file.isDirectory()) {
+            throw new EnforcerRuleException(
+                    "Cannot calculate the checksum of directory: " + this.file.getAbsolutePath());
         }
 
-        if ( !this.file.canRead() )
-        {
-            throw new EnforcerRuleException( "Cannot read file: " + this.file.getAbsolutePath() );
+        if (!this.file.canRead()) {
+            throw new EnforcerRuleException("Cannot read file: " + this.file.getAbsolutePath());
         }
 
         String checksum = calculateChecksum();
 
-        if ( !checksum.equalsIgnoreCase( this.checksum ) )
-        {
+        if (!checksum.equalsIgnoreCase(this.checksum)) {
             String exceptionMessage = getMessage();
-            if ( exceptionMessage == null )
-            {
-                exceptionMessage = this.type + " hash of " + this.file + " was " + checksum
-                    + " but expected " + this.checksum;
+            if (exceptionMessage == null) {
+                exceptionMessage =
+                        this.type + " hash of " + this.file + " was " + checksum + " but expected " + this.checksum;
             }
-            throw new EnforcerRuleException( exceptionMessage );
+            throw new EnforcerRuleException(exceptionMessage);
         }
     }
 
@@ -106,8 +110,7 @@ public class RequireFileChecksum
      *
      * @param file file
      */
-    public void setFile( File file )
-    {
+    public void setFile(File file) {
         this.file = file;
     }
 
@@ -116,8 +119,7 @@ public class RequireFileChecksum
      *
      * @param checksum checksum
      */
-    public void setChecksum( String checksum )
-    {
+    public void setChecksum(String checksum) {
         this.checksum = checksum;
     }
 
@@ -126,8 +128,7 @@ public class RequireFileChecksum
      *
      * @param type algorithm
      */
-    public void setType( String type )
-    {
+    public void setType(String type) {
         this.type = type;
     }
 
@@ -136,51 +137,32 @@ public class RequireFileChecksum
      *
      * @param nonexistentFileMessage message
      */
-    public void setNonexistentFileMessage( String nonexistentFileMessage )
-    {
+    public void setNonexistentFileMessage(String nonexistentFileMessage) {
         this.nonexistentFileMessage = nonexistentFileMessage;
     }
 
-    protected String calculateChecksum()
-        throws EnforcerRuleException
-    {
-        try ( InputStream inputStream = new FileInputStream( this.file ) )
-        {
-            return calculateChecksum( inputStream );
-        }
-        catch ( IOException e )
-        {
-            throw new EnforcerRuleException( "Unable to calculate checksum", e );
+    protected String calculateChecksum() throws EnforcerRuleException {
+        try (InputStream inputStream = new FileInputStream(this.file)) {
+            return calculateChecksum(inputStream);
+        } catch (IOException e) {
+            throw new EnforcerRuleException("Unable to calculate checksum", e);
         }
     }
 
-    protected String calculateChecksum( InputStream inputStream )
-        throws IOException, EnforcerRuleException
-    {
+    protected String calculateChecksum(InputStream inputStream) throws IOException, EnforcerRuleException {
         String checksum;
-        if ( "md5".equals( this.type ) )
-        {
-            checksum = DigestUtils.md5Hex( inputStream );
-        }
-        else if ( "sha1".equals( this.type ) )
-        {
-            checksum = DigestUtils.sha1Hex( inputStream );
-        }
-        else if ( "sha256".equals( this.type ) )
-        {
-            checksum = DigestUtils.sha256Hex( inputStream );
-        }
-        else if ( "sha384".equals( this.type ) )
-        {
-            checksum = DigestUtils.sha384Hex( inputStream );
-        }
-        else if ( "sha512".equals( this.type ) )
-        {
-            checksum = DigestUtils.sha512Hex( inputStream );
-        }
-        else
-        {
-            throw new EnforcerRuleException( "Unsupported hash type: " + this.type );
+        if ("md5".equals(this.type)) {
+            checksum = DigestUtils.md5Hex(inputStream);
+        } else if ("sha1".equals(this.type)) {
+            checksum = DigestUtils.sha1Hex(inputStream);
+        } else if ("sha256".equals(this.type)) {
+            checksum = DigestUtils.sha256Hex(inputStream);
+        } else if ("sha384".equals(this.type)) {
+            checksum = DigestUtils.sha384Hex(inputStream);
+        } else if ("sha512".equals(this.type)) {
+            checksum = DigestUtils.sha512Hex(inputStream);
+        } else {
+            throw new EnforcerRuleException("Unsupported hash type: " + this.type);
         }
         return checksum;
     }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesDontExist.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesDontExist.java
index 7ad08f5..e2a16e5 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesDontExist.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesDontExist.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -24,20 +42,15 @@ import java.io.File;
 /**
  * The Class RequireFilesDontExist.
  */
-public class RequireFilesDontExist
-    extends AbstractRequireFiles
-{
+public class RequireFilesDontExist extends AbstractRequireFiles {
     @Override
-    boolean checkFile( File file )
-    {
+    boolean checkFile(File file) {
         // if we get here and the handle is null, treat it as a success
         return file == null ? true : !file.exists();
     }
 
     @Override
-    String getErrorMsg()
-    {
+    String getErrorMsg() {
         return "Some files should not exist:" + System.lineSeparator();
     }
-
 }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesExist.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesExist.java
index 5675f55..6bf8186 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesExist.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesExist.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -25,49 +43,38 @@ import java.io.IOException;
 /**
  * The Class RequireFilesExist.
  */
-public class RequireFilesExist
-    extends AbstractRequireFiles
-{
+public class RequireFilesExist extends AbstractRequireFiles {
     @Override
-    boolean checkFile( File file )
-    {
+    boolean checkFile(File file) {
         // if we get here and the handle is null, treat it as a success
-        return file == null ? true : file.exists() && osIndependentNameMatch( file, true );
+        return file == null ? true : file.exists() && osIndependentNameMatch(file, true);
     }
 
     @Override
-    String getErrorMsg()
-    {
+    String getErrorMsg() {
         return "Some required files are missing:" + System.lineSeparator();
     }
 
     /**
      * OSes like Windows are case insensitive, so this method will compare the file path with the actual path. A simple
      * {@link File#exists()} is not enough for such OS.
-     * 
+     *
      * @param file the file to verify
      * @param defaultValue value to return in case an IO exception occurs, should never happen as the file already
      *            exists
      * @return
      */
-    private boolean osIndependentNameMatch( File file, boolean defaultValue )
-    {
-        try
-        {
+    private boolean osIndependentNameMatch(File file, boolean defaultValue) {
+        try {
             File absFile;
-            if ( !file.isAbsolute() )
-            {
-                absFile = new File( new File( "." ).getCanonicalFile(), file.getPath() );
-            }
-            else
-            {
+            if (!file.isAbsolute()) {
+                absFile = new File(new File(".").getCanonicalFile(), file.getPath());
+            } else {
                 absFile = file;
             }
 
-            return absFile.toURI().equals( absFile.getCanonicalFile().toURI() );
-        }
-        catch ( IOException e )
-        {
+            return absFile.toURI().equals(absFile.getCanonicalFile().toURI());
+        } catch (IOException e) {
             return defaultValue;
         }
     }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesSize.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesSize.java
index 6ad9285..39b8f66 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesSize.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesSize.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -20,7 +38,6 @@ package org.apache.maven.plugins.enforcer;
  */
 
 import java.io.File;
-
 import org.apache.maven.enforcer.rule.api.EnforcerRule;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
@@ -34,9 +51,7 @@ import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluatio
  * @author brianf
  * @author Roman Stumm
  */
-public class RequireFilesSize
-    extends AbstractRequireFiles
-{
+public class RequireFilesSize extends AbstractRequireFiles {
 
     private static final long MAXSIZE = 10000;
 
@@ -53,112 +68,88 @@ public class RequireFilesSize
     private Log log;
 
     @Override
-    public void execute( EnforcerRuleHelper helper )
-        throws EnforcerRuleException
-    {
+    public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
         this.log = helper.getLog();
 
         // if the file is already defined, use that. Otherwise get the main artifact.
-        if ( getFiles().length == 0 )
-        {
-            try
-            {
-                MavenProject project = (MavenProject) helper.evaluate( "${project}" );
-                setFiles( new File[1] );
+        if (getFiles().length == 0) {
+            try {
+                MavenProject project = (MavenProject) helper.evaluate("${project}");
+                setFiles(new File[1]);
                 getFiles()[0] = project.getArtifact().getFile();
 
-                super.execute( helper );
+                super.execute(helper);
+            } catch (ExpressionEvaluationException e) {
+                throw new EnforcerRuleException("Unable to retrieve the project.", e);
             }
-            catch ( ExpressionEvaluationException e )
-            {
-                throw new EnforcerRuleException( "Unable to retrieve the project.", e );
-            }
-        }
-        else
-        {
-            super.execute( helper );
+        } else {
+            super.execute(helper);
         }
-
     }
 
     @Override
-    public boolean isCacheable()
-    {
+    public boolean isCacheable() {
         return false;
     }
 
     @Override
-    public boolean isResultValid( EnforcerRule cachedRule )
-    {
+    public boolean isResultValid(EnforcerRule cachedRule) {
         return false;
     }
 
     @Override
-    boolean checkFile( File file )
-    {
-        if ( file == null )
-        {
+    boolean checkFile(File file) {
+        if (file == null) {
             // if we get here and it's null, treat it as a success.
             return true;
         }
 
         // check the file now
-        if ( file.exists() )
-        {
+        if (file.exists()) {
             long length = file.length();
-            if ( length < minsize )
-            {
-                this.errorMsg = ( file + " size (" + length + ") too small. Min. is " + minsize );
+            if (length < minsize) {
+                this.errorMsg = (file + " size (" + length + ") too small. Min. is " + minsize);
                 return false;
-            }
-            else if ( length > maxsize )
-            {
-                this.errorMsg = ( file + " size (" + length + ") too large. Max. is " + maxsize );
+            } else if (length > maxsize) {
+                this.errorMsg = (file + " size (" + length + ") too large. Max. is " + maxsize);
                 return false;
-            }
-            else
-            {
+            } else {
 
-                this.log.debug( file
-                    + " size ("
-                    + length
-                    + ") is OK ("
-                    + ( minsize == maxsize || minsize == 0 ? ( "max. " + maxsize )
-                                    : ( "between " + minsize + " and " + maxsize ) ) + " byte)." );
+                this.log.debug(file
+                        + " size ("
+                        + length
+                        + ") is OK ("
+                        + (minsize == maxsize || minsize == 0
+                                ? ("max. " + maxsize)
+                                : ("between " + minsize + " and " + maxsize))
+                        + " byte).");
 
                 return true;
             }
-        }
-        else
-        {
-            this.errorMsg = ( file + " does not exist!" );
+        } else {
+            this.errorMsg = (file + " does not exist!");
             return false;
         }
     }
 
     @Override
-    String getErrorMsg()
-    {
+    String getErrorMsg() {
         return this.errorMsg;
     }
 
-    public long getMaxsize()
-    {
+    public long getMaxsize() {
         return maxsize;
     }
 
-    public void setMaxsize( long maxsize )
-    {
+    public void setMaxsize(long maxsize) {
         this.maxsize = maxsize;
     }
 
-    public long getMinsize()
-    {
+    public long getMinsize() {
         return minsize;
     }
 
-    public void setMinsize( long minsize )
-    {
+    public void setMinsize(long minsize) {
         this.minsize = minsize;
     }
 }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireJavaVendor.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireJavaVendor.java
index 172ee68..be179e6 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireJavaVendor.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireJavaVendor.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -19,24 +37,22 @@ package org.apache.maven.plugins.enforcer;
  * under the License.
  */
 
+import java.util.List;
 import org.apache.commons.lang3.SystemUtils;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
 
-import java.util.List;
-
 /**
  * This rule checks that the Java vendor is allowed.
- * Rule will fail is it matches any of the excludes or doesn't match any include in case it was set. 
+ * Rule will fail is it matches any of the excludes or doesn't match any include in case it was set.
  *
  * @author Tim Sijstermans
  * @since 3.0.0
  */
-public class RequireJavaVendor extends AbstractNonCacheableEnforcerRule
-{
+public class RequireJavaVendor extends AbstractNonCacheableEnforcerRule {
     /**
      * Java vendors to include. If none is defined, all are included.
-     * 
+     *
      */
     private List<String> includes;
 
@@ -46,25 +62,19 @@ public class RequireJavaVendor extends AbstractNonCacheableEnforcerRule
     private List<String> excludes;
 
     @Override
-    public void execute( EnforcerRuleHelper helper ) throws EnforcerRuleException
-    {
-        if ( excludes != null && excludes.contains( SystemUtils.JAVA_VENDOR ) )
-        {
+    public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
+        if (excludes != null && excludes.contains(SystemUtils.JAVA_VENDOR)) {
             String message = getMessage();
-            if ( message == null ) 
-            {
-                message = String.format( "%s is an excluded Required Java Vendor", SystemUtils.JAVA_VENDOR );
+            if (message == null) {
+                message = String.format("%s is an excluded Required Java Vendor", SystemUtils.JAVA_VENDOR);
             }
-            throw new EnforcerRuleException( message );
-        }
-        else if ( includes != null && !includes.contains( SystemUtils.JAVA_VENDOR ) )
-        {
+            throw new EnforcerRuleException(message);
+        } else if (includes != null && !includes.contains(SystemUtils.JAVA_VENDOR)) {
             String message = getMessage();
-            if ( message == null ) 
-            {
-                message = String.format( "%s is not an included Required Java Vendor", SystemUtils.JAVA_VENDOR );
+            if (message == null) {
+                message = String.format("%s is not an included Required Java Vendor", SystemUtils.JAVA_VENDOR);
             }
-            throw new EnforcerRuleException( message );
+            throw new EnforcerRuleException(message);
         }
     }
 
@@ -75,8 +85,7 @@ public class RequireJavaVendor extends AbstractNonCacheableEnforcerRule
      *
      * @param theExcludes the vendor to to exclude from the include list.
      */
-    public void setExcludes( List<String> theExcludes )
-    {
+    public void setExcludes(List<String> theExcludes) {
         this.excludes = theExcludes;
     }
 
@@ -91,13 +100,12 @@ public class RequireJavaVendor extends AbstractNonCacheableEnforcerRule
      * <li><code>AdoptOpenJDK</code> prohibits vendor name AdoptOpenJDK </li>
      * <li><code>Amazon</code> prohibits vendor name Amazon </li>
      * </ul>
-     * 
+     *
      * @param theIncludes the list of required vendors.
-     * 
+     *
      * @see #setExcludes(List)
      */
-    public void setIncludes( List<String> theIncludes )
-    {
+    public void setIncludes(List<String> theIncludes) {
         this.includes = theIncludes;
     }
 }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireJavaVersion.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireJavaVersion.java
index 4076ac8..5ce1f47 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireJavaVersion.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireJavaVersion.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -22,7 +40,6 @@ package org.apache.maven.plugins.enforcer;
 import java.util.Arrays;
 import java.util.Iterator;
 import java.util.List;
-
 import org.apache.commons.lang3.SystemUtils;
 import org.apache.maven.artifact.versioning.ArtifactVersion;
 import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
@@ -36,27 +53,24 @@ import org.codehaus.plexus.util.StringUtils;
  *
  * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
  */
-public class RequireJavaVersion
-    extends AbstractVersionEnforcer
-{
+public class RequireJavaVersion extends AbstractVersionEnforcer {
     @Override
-    public void execute( EnforcerRuleHelper helper )
-        throws EnforcerRuleException
-    {
+    public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
         String javaVersion = SystemUtils.JAVA_VERSION;
         Log log = helper.getLog();
 
-        log.debug( "Detected Java String: '" + javaVersion + "'" );
-        javaVersion = normalizeJDKVersion( javaVersion );
-        log.debug( "Normalized Java String: '" + javaVersion + "'" );
+        log.debug("Detected Java String: '" + javaVersion + "'");
+        javaVersion = normalizeJDKVersion(javaVersion);
+        log.debug("Normalized Java String: '" + javaVersion + "'");
 
-        ArtifactVersion detectedJdkVersion = new DefaultArtifactVersion( javaVersion );
+        ArtifactVersion detectedJdkVersion = new DefaultArtifactVersion(javaVersion);
 
-        log.debug( "Parsed Version: Major: " + detectedJdkVersion.getMajorVersion() + " Minor: "
-            + detectedJdkVersion.getMinorVersion() + " Incremental: " + detectedJdkVersion.getIncrementalVersion()
-            + " Build: " + detectedJdkVersion.getBuildNumber() + " Qualifier: " + detectedJdkVersion.getQualifier() );
+        log.debug("Parsed Version: Major: " + detectedJdkVersion.getMajorVersion() + " Minor: "
+                + detectedJdkVersion.getMinorVersion() + " Incremental: " + detectedJdkVersion.getIncrementalVersion()
+                + " Build: " + detectedJdkVersion.getBuildNumber() + " Qualifier: "
+                + detectedJdkVersion.getQualifier());
 
-        enforceVersion( helper.getLog(), "JDK", getVersion(), detectedJdkVersion );
+        enforceVersion(helper.getLog(), "JDK", getVersion(), detectedJdkVersion);
     }
 
     /**
@@ -65,37 +79,31 @@ public class RequireJavaVersion
      * @param theJdkVersion to be converted.
      * @return the converted string.
      */
-    public static String normalizeJDKVersion( String theJdkVersion )
-    {
+    public static String normalizeJDKVersion(String theJdkVersion) {
 
-        theJdkVersion = theJdkVersion.replaceAll( "_|-", "." );
-        String tokenArray[] = StringUtils.split( theJdkVersion, "." );
-        List<String> tokens = Arrays.asList( tokenArray );
-        StringBuilder buffer = new StringBuilder( theJdkVersion.length() );
+        theJdkVersion = theJdkVersion.replaceAll("_|-", ".");
+        String tokenArray[] = StringUtils.split(theJdkVersion, ".");
+        List<String> tokens = Arrays.asList(tokenArray);
+        StringBuilder buffer = new StringBuilder(theJdkVersion.length());
 
         Iterator<String> iter = tokens.iterator();
-        for ( int i = 0; i < tokens.size() && i < 4; i++ )
-        {
+        for (int i = 0; i < tokens.size() && i < 4; i++) {
             String section = iter.next();
-            section = section.replaceAll( "[^0-9]", "" );
+            section = section.replaceAll("[^0-9]", "");
 
-            if ( StringUtils.isNotEmpty( section ) )
-            {
-                buffer.append( Integer.parseInt( section ) );
+            if (StringUtils.isNotEmpty(section)) {
+                buffer.append(Integer.parseInt(section));
 
-                if ( i != 2 )
-                {
-                    buffer.append( '.' );
-                }
-                else
-                {
-                    buffer.append( '-' );
+                if (i != 2) {
+                    buffer.append('.');
+                } else {
+                    buffer.append('-');
                 }
             }
         }
 
         String version = buffer.toString();
-        version = StringUtils.stripEnd( version, "-" );
-        return StringUtils.stripEnd( version, "." );
+        version = StringUtils.stripEnd(version, "-");
+        return StringUtils.stripEnd(version, ".");
     }
 }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireMavenVersion.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireMavenVersion.java
index 733f0cd..5db9977 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireMavenVersion.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireMavenVersion.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -30,31 +48,21 @@ import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluatio
  *
  * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
  */
-public class RequireMavenVersion
-    extends AbstractVersionEnforcer
-{
+public class RequireMavenVersion extends AbstractVersionEnforcer {
     @Override
-    public void execute( EnforcerRuleHelper helper )
-        throws EnforcerRuleException
-    {
-        try
-        {
-            MavenSession mavenSession = (MavenSession) helper.evaluate( "${session}" );
-            String mavenVersion = mavenSession.getSystemProperties().getProperty( "maven.version" );
-            helper.getLog().debug( "Detected Maven Version: " + mavenVersion );
-            if ( mavenVersion == null )
-            {
+    public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
+        try {
+            MavenSession mavenSession = (MavenSession) helper.evaluate("${session}");
+            String mavenVersion = mavenSession.getSystemProperties().getProperty("maven.version");
+            helper.getLog().debug("Detected Maven Version: " + mavenVersion);
+            if (mavenVersion == null) {
                 throw new EnforcerRuleException(
-                        "Unable to detect Maven Version - missing system property - maven.version" );
+                        "Unable to detect Maven Version - missing system property - maven.version");
             }
-            DefaultArtifactVersion detectedVersion = new DefaultArtifactVersion( mavenVersion );
-            enforceVersion( helper.getLog(), "Maven", getVersion(), detectedVersion );
-        }
-        catch ( ExpressionEvaluationException e )
-        {
-            throw new EnforcerRuleException( "Unable to retrieve the session.", e );
+            DefaultArtifactVersion detectedVersion = new DefaultArtifactVersion(mavenVersion);
+            enforceVersion(helper.getLog(), "Maven", getVersion(), detectedVersion);
+        } catch (ExpressionEvaluationException e) {
+            throw new EnforcerRuleException("Unable to retrieve the session.", e);
         }
-
     }
-
 }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireNoRepositories.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireNoRepositories.java
index ec784db..d114472 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireNoRepositories.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireNoRepositories.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -22,7 +40,6 @@ package org.apache.maven.plugins.enforcer;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
-
 import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
 import org.apache.maven.execution.MavenSession;
@@ -38,140 +55,120 @@ import org.codehaus.plexus.util.StringUtils;
  *
  * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
  */
-public class RequireNoRepositories
-    extends AbstractNonCacheableEnforcerRule
-{
+public class RequireNoRepositories extends AbstractNonCacheableEnforcerRule {
     private static final String VERSION = " version:";
 
     /**
      * Whether to ban non-plugin repositories. By default they are banned.
-     * 
+     *
      * @see #setBanRepositories(boolean)
      */
     private boolean banRepositories = true;
 
     /**
      * Whether to ban plugin repositories. By default they are banned.
-     * 
+     *
      * @see #setBanPluginRepositories(boolean)
      */
     private boolean banPluginRepositories = true;
 
     /**
      * Specify explicitly allowed non-plugin repositories. This is a list of ids.
-     * 
+     *
      * @see #setAllowedRepositories(List)
      */
     private List<String> allowedRepositories = Collections.emptyList();
 
     /**
      * Specify explicitly allowed plugin repositories. This is a list of ids.
-     * 
+     *
      * @see #setAllowedPluginRepositories(List)
      */
     private List<String> allowedPluginRepositories = Collections.emptyList();
 
     /**
      * Whether to allow repositories which only resolve snapshots. By default they are banned.
-     * 
+     *
      * @see #setAllowSnapshotRepositories(boolean)
      */
     private boolean allowSnapshotRepositories = false;
 
     /**
      * Whether to allow plugin repositories which only resolve snapshots. By default they are banned.
-     * 
+     *
      * @see {@link #setAllowSnapshotPluginRepositories(boolean)}
      */
     private boolean allowSnapshotPluginRepositories = false;
 
-    public final void setBanRepositories( boolean banRepositories )
-    {
+    public final void setBanRepositories(boolean banRepositories) {
         this.banRepositories = banRepositories;
     }
-    
-    public final void setBanPluginRepositories( boolean banPluginRepositories )
-    {
+
+    public final void setBanPluginRepositories(boolean banPluginRepositories) {
         this.banPluginRepositories = banPluginRepositories;
     }
-    
-    public final void setAllowedRepositories( List<String> allowedRepositories )
-    {
+
+    public final void setAllowedRepositories(List<String> allowedRepositories) {
         this.allowedRepositories = allowedRepositories;
     }
-    
-    public final void setAllowedPluginRepositories( List<String> allowedPluginRepositories )
-    {
+
+    public final void setAllowedPluginRepositories(List<String> allowedPluginRepositories) {
         this.allowedPluginRepositories = allowedPluginRepositories;
     }
-    
-    public final void setAllowSnapshotRepositories( boolean allowSnapshotRepositories )
-    {
+
+    public final void setAllowSnapshotRepositories(boolean allowSnapshotRepositories) {
         this.allowSnapshotRepositories = allowSnapshotRepositories;
     }
-    
-    public final void setAllowSnapshotPluginRepositories( boolean allowSnapshotPluginRepositories )
-    {
+
+    public final void setAllowSnapshotPluginRepositories(boolean allowSnapshotPluginRepositories) {
         this.allowSnapshotPluginRepositories = allowSnapshotPluginRepositories;
     }
 
     @Override
-    public void execute( EnforcerRuleHelper helper )
-        throws EnforcerRuleException
-    {
+    public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
         Log logger = helper.getLog();
 
         MavenSession session;
-        try
-        {
-            session = (MavenSession) helper.evaluate( "${session}" );
+        try {
+            session = (MavenSession) helper.evaluate("${session}");
 
-            List<MavenProject> sortedProjects = session.getProjectDependencyGraph().getSortedProjects();
+            List<MavenProject> sortedProjects =
+                    session.getProjectDependencyGraph().getSortedProjects();
 
             List<Model> models = new ArrayList<>();
-            for ( MavenProject mavenProject : sortedProjects )
-            {
-                logger.debug( "Scanning project: " + mavenProject.getGroupId() + ":" + mavenProject.getArtifactId()
-                    + VERSION + mavenProject.getVersion() );
-                models.add( mavenProject.getOriginalModel() );
+            for (MavenProject mavenProject : sortedProjects) {
+                logger.debug("Scanning project: " + mavenProject.getGroupId() + ":" + mavenProject.getArtifactId()
+                        + VERSION + mavenProject.getVersion());
+                models.add(mavenProject.getOriginalModel());
             }
-            
+
             List<Model> badModels = new ArrayList<>();
 
             StringBuilder newMsg = new StringBuilder();
-            newMsg.append( "Some poms have repositories defined:" + System.lineSeparator() );
+            newMsg.append("Some poms have repositories defined:" + System.lineSeparator());
 
-            for ( Model model : models )
-            {
-                if ( banRepositories )
-                {
+            for (Model model : models) {
+                if (banRepositories) {
                     List<Repository> repos = model.getRepositories();
-                    if ( repos != null && !repos.isEmpty() )
-                    {
+                    if (repos != null && !repos.isEmpty()) {
                         List<String> bannedRepos =
-                            findBannedRepositories( repos, allowedRepositories, allowSnapshotRepositories );
-                        if ( !bannedRepos.isEmpty() )
-                        {
-                            badModels.add( model );
-                            newMsg.append(
-                                model.getGroupId() + ":" + model.getArtifactId() + VERSION + model.getVersion()
-                                    + " has repositories " + bannedRepos );
+                                findBannedRepositories(repos, allowedRepositories, allowSnapshotRepositories);
+                        if (!bannedRepos.isEmpty()) {
+                            badModels.add(model);
+                            newMsg.append(model.getGroupId() + ":" + model.getArtifactId() + VERSION
+                                    + model.getVersion() + " has repositories " + bannedRepos);
                         }
                     }
                 }
-                if ( banPluginRepositories )
-                {
+                if (banPluginRepositories) {
                     List<Repository> repos = model.getPluginRepositories();
-                    if ( repos != null && !repos.isEmpty() )
-                    {
-                        List<String> bannedRepos =
-                            findBannedRepositories( repos, allowedPluginRepositories, allowSnapshotPluginRepositories );
-                        if ( !bannedRepos.isEmpty() )
-                        {
-                            badModels.add( model );
-                            newMsg.append(
-                                model.getGroupId() + ":" + model.getArtifactId() + VERSION + model.getVersion()
-                                    + " has plugin repositories " + bannedRepos );
+                    if (repos != null && !repos.isEmpty()) {
+                        List<String> bannedRepos = findBannedRepositories(
+                                repos, allowedPluginRepositories, allowSnapshotPluginRepositories);
+                        if (!bannedRepos.isEmpty()) {
+                            badModels.add(model);
+                            newMsg.append(model.getGroupId() + ":" + model.getArtifactId() + VERSION
+                                    + model.getVersion() + " has plugin repositories " + bannedRepos);
                         }
                     }
                 }
@@ -179,46 +176,40 @@ public class RequireNoRepositories
 
             // if anything was found, log it then append the
             // optional message.
-            if ( !badModels.isEmpty() )
-            {
+            if (!badModels.isEmpty()) {
                 String message = getMessage();
-                if ( StringUtils.isNotEmpty( message ) )
-                {
-                    newMsg.append( message );
+                if (StringUtils.isNotEmpty(message)) {
+                    newMsg.append(message);
                 }
 
-                throw new EnforcerRuleException( newMsg.toString() );
+                throw new EnforcerRuleException(newMsg.toString());
             }
 
-        }
-        catch ( ExpressionEvaluationException e )
-        {
-            throw new EnforcerRuleException( e.getLocalizedMessage() );
+        } catch (ExpressionEvaluationException e) {
+            throw new EnforcerRuleException(e.getLocalizedMessage());
         }
     }
 
     /**
-     * 
+     *
      * @param repos all repositories, never {@code null}
      * @param allowedRepos allowed repositories, never {@code null}
-     * @param allowSnapshots 
+     * @param allowSnapshots
      * @return List of banned repositoreis.
      */
-    private static List<String> findBannedRepositories( List<Repository> repos, List<String> allowedRepos,
-                                                        boolean allowSnapshots )
-    {
-        List<String> bannedRepos = new ArrayList<>( allowedRepos.size() );
-        for ( Repository r : repos )
-        {
-            if ( !allowedRepos.contains( r.getId() ) )
-            {
-                if ( !allowSnapshots || r.getReleases() == null || r.getReleases().isEnabled() )
-                {
+    private static List<String> findBannedRepositories(
+            List<Repository> repos, List<String> allowedRepos, boolean allowSnapshots) {
+        List<String> bannedRepos = new ArrayList<>(allowedRepos.size());
+        for (Repository r : repos) {
+            if (!allowedRepos.contains(r.getId())) {
+                if (!allowSnapshots
+                        || r.getReleases() == null
+                        || r.getReleases().isEnabled()) {
                     // if we are not allowing snapshots and this repo is enabled for releases
                     // it is banned.  We don't care whether it is enabled for snapshots
-                    // if you define a repo and don't enable it for anything, then we have nothing 
+                    // if you define a repo and don't enable it for anything, then we have nothing
                     // to worry about
-                    bannedRepos.add( r.getId() );
+                    bannedRepos.add(r.getId());
                 }
             }
         }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireOS.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireOS.java
index abc4c36..57644c7 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireOS.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireOS.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -20,15 +38,14 @@ package org.apache.maven.plugins.enforcer;
  */
 
 import java.util.Iterator;
-
 import org.apache.maven.enforcer.rule.api.EnforcerRule;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
 import org.apache.maven.model.Activation;
 import org.apache.maven.model.ActivationOS;
 import org.apache.maven.model.Profile;
-import org.apache.maven.plugin.logging.Log;
 import org.apache.maven.model.profile.activation.ProfileActivator;
+import org.apache.maven.plugin.logging.Log;
 import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
 import org.codehaus.plexus.util.Os;
 import org.codehaus.plexus.util.StringUtils;
@@ -39,9 +56,7 @@ import org.codehaus.plexus.util.StringUtils;
  *
  * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
  */
-public class RequireOS
-    extends AbstractStandardEnforcerRule
-{
+public class RequireOS extends AbstractStandardEnforcerRule {
     private ProfileActivator activator;
 
     /**
@@ -59,7 +74,7 @@ public class RequireOS
      * <li>z/os</li>
      * <li>os/400</li>
      * </ul>
-     * 
+     *
      * @see {@link #setFamily(String)}
      * @see {@link #getFamily()}
      */
@@ -75,7 +90,7 @@ public class RequireOS
 
     /**
      * The OS version desired.
-     * 
+     *
      * @see {@link #setVersion(String)}
      * @see {@link #getVersion()}
      */
@@ -83,7 +98,7 @@ public class RequireOS
 
     /**
      * The OS architecture desired.
-     * 
+     *
      * @see {@link #setArch(String)}
      * @see {@link #getArch()}
      */
@@ -91,7 +106,7 @@ public class RequireOS
 
     /**
      * Display detected OS information.
-     * 
+     *
      * @see {@link #setDisplay(boolean)}
      * @see {@link #isDisplay()}
      */
@@ -100,75 +115,57 @@ public class RequireOS
     /**
      * Instantiates a new RequireOS.
      */
-    public RequireOS()
-    {
+    public RequireOS() {}
 
-    }
-    
     // For testing
-    RequireOS( ProfileActivator activator ) 
-    {
+    RequireOS(ProfileActivator activator) {
         this.activator = activator;
     }
-    
 
     @Override
-    public void execute( EnforcerRuleHelper helper )
-        throws EnforcerRuleException
-    {
+    public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
 
-        displayOSInfo( helper.getLog(), display );
+        displayOSInfo(helper.getLog(), display);
 
-        if ( allParamsEmpty() )
-        {
-            throw new EnforcerRuleException( "All parameters can not be empty. "
-                + "You must pick at least one of (family, name, version, arch) "
-                + "or use -Denforcer.os.display=true to see the current OS information." );
-        }
-        
-        try
-        {
-            activator = helper.getComponent( ProfileActivator.class, "os" );
+        if (allParamsEmpty()) {
+            throw new EnforcerRuleException("All parameters can not be empty. "
+                    + "You must pick at least one of (family, name, version, arch) "
+                    + "or use -Denforcer.os.display=true to see the current OS information.");
         }
-        catch ( ComponentLookupException e )
-        {
-            throw new EnforcerRuleException( e.getMessage() );
+
+        try {
+            activator = helper.getComponent(ProfileActivator.class, "os");
+        } catch (ComponentLookupException e) {
+            throw new EnforcerRuleException(e.getMessage());
         }
 
-        if ( isValidFamily( this.family ) )
-        {
-            if ( !isAllowed() )
-            {
+        if (isValidFamily(this.family)) {
+            if (!isAllowed()) {
                 String message = getMessage();
-                if ( StringUtils.isEmpty( message ) )
-                {
-                    //@formatter:off
-                    message =
-                        ( "OS Arch: " 
-                            + Os.OS_ARCH + " Family: " 
-                            + Os.OS_FAMILY + " Name: " 
+                if (StringUtils.isEmpty(message)) {
+                    // @formatter:off
+                    message = ("OS Arch: "
+                            + Os.OS_ARCH + " Family: "
+                            + Os.OS_FAMILY + " Name: "
                             + Os.OS_NAME + " Version: "
-                            + Os.OS_VERSION + " is not allowed by" + ( arch != null ? " Arch=" + arch : "" )
-                            + ( family != null ? " Family=" + family : "" ) 
-                            + ( name != null ? " Name=" + name : "" ) 
-                            + ( version != null ? " Version=" + version : "" ) );
-                    //@formatter:on
+                            + Os.OS_VERSION + " is not allowed by" + (arch != null ? " Arch=" + arch : "")
+                            + (family != null ? " Family=" + family : "")
+                            + (name != null ? " Name=" + name : "")
+                            + (version != null ? " Version=" + version : ""));
+                    // @formatter:on
                 }
-                throw new EnforcerRuleException( message );
+                throw new EnforcerRuleException(message);
             }
-        }
-        else
-        {
+        } else {
             final int minimumBufferSize = 50;
-            StringBuilder buffer = new StringBuilder( minimumBufferSize );
+            StringBuilder buffer = new StringBuilder(minimumBufferSize);
             Iterator<?> iter = Os.getValidFamilies().iterator();
-            while ( iter.hasNext() )
-            {
-                buffer.append( iter.next() );
-                buffer.append( ", " );
+            while (iter.hasNext()) {
+                buffer.append(iter.next());
+                buffer.append(", ");
             }
-            String help = StringUtils.stripEnd( buffer.toString().trim(), "." );
-            throw new EnforcerRuleException( "Invalid Family type used. Valid family types are: " + help );
+            String help = StringUtils.stripEnd(buffer.toString().trim(), ".");
+            throw new EnforcerRuleException("Invalid Family type used. Valid family types are: " + help);
         }
     }
 
@@ -178,19 +175,14 @@ public class RequireOS
      * @param log the log
      * @param info the info
      */
-    public void displayOSInfo( Log log, boolean info )
-    {
-        String string =
-            "OS Info: Arch: " + Os.OS_ARCH + " Family: " + Os.OS_FAMILY + " Name: " + Os.OS_NAME + " Version: "
-                + Os.OS_VERSION;
-
-        if ( !info )
-        {
-            log.debug( string );
-        }
-        else
-        {
-            log.info( string );
+    public void displayOSInfo(Log log, boolean info) {
+        String string = "OS Info: Arch: " + Os.OS_ARCH + " Family: " + Os.OS_FAMILY + " Name: " + Os.OS_NAME
+                + " Version: " + Os.OS_VERSION;
+
+        if (!info) {
+            log.debug(string);
+        } else {
+            log.info(string);
         }
     }
 
@@ -200,9 +192,8 @@ public class RequireOS
      *
      * @return true if the version is allowed.
      */
-    public boolean isAllowed()
-    {
-        return activator.isActive( createProfile(), null, null );
+    public boolean isAllowed() {
+        return activator.isActive(createProfile(), null, null);
     }
 
     /**
@@ -210,10 +201,12 @@ public class RequireOS
      *
      * @return true if all parameters are empty.
      */
-    public boolean allParamsEmpty()
-    {
+    public boolean allParamsEmpty() {
         // CHECKSTYLE_OFF: LineLength
-        return ( StringUtils.isEmpty( family ) && StringUtils.isEmpty( arch ) && StringUtils.isEmpty( name ) && StringUtils.isEmpty( version ) );
+        return (StringUtils.isEmpty(family)
+                && StringUtils.isEmpty(arch)
+                && StringUtils.isEmpty(name)
+                && StringUtils.isEmpty(version));
         // CHECKSTYLE_ON: LineLength
     }
 
@@ -222,10 +215,9 @@ public class RequireOS
      *
      * @return a properly populated profile to be used for OS validation.
      */
-    private Profile createProfile()
-    {
+    private Profile createProfile() {
         Profile profile = new Profile();
-        profile.setActivation( createActivation() );
+        profile.setActivation(createActivation());
         return profile;
     }
 
@@ -234,11 +226,10 @@ public class RequireOS
      *
      * @return a properly populated Activation object.
      */
-    private Activation createActivation()
-    {
+    private Activation createActivation() {
         Activation activation = new Activation();
-        activation.setActiveByDefault( false );
-        activation.setOs( createOsBean() );
+        activation.setActiveByDefault(false);
+        activation.setOs(createOsBean());
         return activation;
     }
 
@@ -247,14 +238,13 @@ public class RequireOS
      *
      * @return a properly populated ActivationOS object.
      */
-    private ActivationOS createOsBean()
-    {
+    private ActivationOS createOsBean() {
         ActivationOS os = new ActivationOS();
 
-        os.setArch( arch );
-        os.setFamily( family );
-        os.setName( name );
-        os.setVersion( version );
+        os.setArch(arch);
+        os.setFamily(family);
+        os.setName(name);
+        os.setVersion(version);
 
         return os;
     }
@@ -278,13 +268,12 @@ public class RequireOS
      * @param theFamily the family to check.
      * @return true if one of the valid families.
      */
-    public boolean isValidFamily( String theFamily )
-    {
+    public boolean isValidFamily(String theFamily) {
 
         // in case they are checking !family
-        theFamily = StringUtils.stripStart( theFamily, "!" );
+        theFamily = StringUtils.stripStart(theFamily, "!");
 
-        return ( StringUtils.isEmpty( theFamily ) || Os.getValidFamilies().contains( theFamily ) );
+        return (StringUtils.isEmpty(theFamily) || Os.getValidFamilies().contains(theFamily));
     }
 
     /**
@@ -292,8 +281,7 @@ public class RequireOS
      *
      * @return the arch
      */
-    public String getArch()
-    {
+    public String getArch() {
         return this.arch;
     }
 
@@ -302,8 +290,7 @@ public class RequireOS
      *
      * @param theArch the arch to set
      */
-    public void setArch( String theArch )
-    {
+    public void setArch(String theArch) {
         this.arch = theArch;
     }
 
@@ -312,8 +299,7 @@ public class RequireOS
      *
      * @return the family
      */
-    public String getFamily()
-    {
+    public String getFamily() {
         return this.family;
     }
 
@@ -322,8 +308,7 @@ public class RequireOS
      *
      * @param theFamily the family to set
      */
-    public void setFamily( String theFamily )
-    {
+    public void setFamily(String theFamily) {
         this.family = theFamily;
     }
 
@@ -332,8 +317,7 @@ public class RequireOS
      *
      * @return the name
      */
-    public String getName()
-    {
+    public String getName() {
         return this.name;
     }
 
@@ -342,8 +326,7 @@ public class RequireOS
      *
      * @param theName the name to set
      */
-    public void setName( String theName )
-    {
+    public void setName(String theName) {
         this.name = theName;
     }
 
@@ -352,8 +335,7 @@ public class RequireOS
      *
      * @return the version
      */
-    public String getVersion()
-    {
+    public String getVersion() {
         return this.version;
     }
 
@@ -362,58 +344,48 @@ public class RequireOS
      *
      * @param theVersion the version to set
      */
-    public void setVersion( String theVersion )
-    {
+    public void setVersion(String theVersion) {
         this.version = theVersion;
     }
 
     /**
      * @param display The value for the display.
      */
-    public final void setDisplay( boolean display )
-    {
+    public final void setDisplay(boolean display) {
         this.display = display;
     }
 
-    public final boolean isDisplay()
-    {
+    public final boolean isDisplay() {
         return display;
     }
 
     @Override
-    public String getCacheId()
-    {
+    public String getCacheId() {
         // return the hashcodes of all the parameters
         StringBuilder b = new StringBuilder();
-        if ( StringUtils.isNotEmpty( version ) )
-        {
-            b.append( version.hashCode() );
+        if (StringUtils.isNotEmpty(version)) {
+            b.append(version.hashCode());
         }
-        if ( StringUtils.isNotEmpty( name ) )
-        {
-            b.append( name.hashCode() );
+        if (StringUtils.isNotEmpty(name)) {
+            b.append(name.hashCode());
         }
-        if ( StringUtils.isNotEmpty( arch ) )
-        {
-            b.append( arch.hashCode() );
+        if (StringUtils.isNotEmpty(arch)) {
+            b.append(arch.hashCode());
         }
-        if ( StringUtils.isNotEmpty( family ) )
-        {
-            b.append( family.hashCode() );
+        if (StringUtils.isNotEmpty(family)) {
+            b.append(family.hashCode());
         }
         return b.toString();
     }
 
     @Override
-    public boolean isCacheable()
-    {
+    public boolean isCacheable() {
         // the os is not going to change between projects in the same build.
         return true;
     }
 
     @Override
-    public boolean isResultValid( EnforcerRule theCachedRule )
-    {
+    public boolean isResultValid(EnforcerRule theCachedRule) {
         // i will always return the hash of the parameters as my id. If my parameters are the same, this
         // rule must always have the same result.
         return true;
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java
index c098348..c3efeff 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -28,7 +46,6 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-
 import org.apache.maven.BuildFailureException;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.factory.ArtifactFactory;
@@ -74,15 +91,13 @@ import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
  *
  * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
  */
-public class RequirePluginVersions
-    extends AbstractNonCacheableEnforcerRule
-{
+public class RequirePluginVersions extends AbstractNonCacheableEnforcerRule {
 
     private EnforcerRuleHelper helper;
 
     /**
      * Don't allow the LATEST identifier.
-     * 
+     *
      * @see {@link #setBanLatest(boolean)}
      * @see {@link #isBanLatest()}
      */
@@ -90,7 +105,7 @@ public class RequirePluginVersions
 
     /**
      * Don't allow the RELEASE identifier.
-     * 
+     *
      * @see {@link #setBanRelease(boolean)}
      * @see {@link #isBanRelease()}
      */
@@ -98,7 +113,7 @@ public class RequirePluginVersions
 
     /**
      * Don't allow snapshot plugins.
-     * 
+     *
      * @see {@link #setBanSnapshots(boolean)}
      * @see {@link #isBanSnapshots()}
      */
@@ -106,7 +121,7 @@ public class RequirePluginVersions
 
     /**
      * Don't allow timestamp snapshot plugins.
-     * 
+     *
      * @see {@link #setBanTimestamps(boolean)}
      * @see {@link #isBanTimestamps()}
      */
@@ -120,7 +135,7 @@ public class RequirePluginVersions
     /**
      * The comma separated list of phases that should be used to find lifecycle plugin bindings. The default value is
      * "clean,deploy,site".
-     * 
+     *
      * @see {@link #setPhases(String)}
      * @see {@link #getPhases()}
      */
@@ -130,7 +145,7 @@ public class RequirePluginVersions
      * Additional plugins to enforce have versions. These are plugins that may not be in the poms but are used anyway,
      * like help, eclipse etc. <br>
      * The plugins should be specified in the form: <code>group:artifactId</code>.
-     * 
+     *
      * @see {@link #setAdditionalPlugins(List)}
      * @see {@link #getAdditionalPlugins()}
      */
@@ -139,7 +154,7 @@ public class RequirePluginVersions
     /**
      * Plugins to skip for version enforcement. The plugins should be specified in the form:
      * <code>group:artifactId</code>. NOTE: This is deprecated, use unCheckedPluginList instead.
-     * 
+     *
      * @see {@link #setUnCheckedPlugins(List)}
      * @see {@link #getUnCheckedPlugins()}
      */
@@ -148,7 +163,7 @@ public class RequirePluginVersions
     /**
      * Same as unCheckedPlugins but as a comma list to better support properties. Sample form:
      * <code>group:artifactId,group2:artifactId2</code>
-     * 
+     *
      * @since 1.0-beta-1
      * @see {@link #setUnCheckedPlugins(List)}
      * @see {@link #getUnCheckedPlugins()}
@@ -185,172 +200,139 @@ public class RequirePluginVersions
     private RuntimeInformation runtimeInformation;
 
     @Override
-    public void execute( EnforcerRuleHelper helper )
-        throws EnforcerRuleException
-    {
+    public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
         this.log = helper.getLog();
         this.helper = helper;
 
         MavenProject project;
-        try
-        {
+        try {
             // get the various expressions out of the helper.
 
-            project = (MavenProject) helper.evaluate( "${project}" );
+            project = (MavenProject) helper.evaluate("${project}");
 
-            runtimeInformation = helper.getComponent( RuntimeInformation.class );
+            runtimeInformation = helper.getComponent(RuntimeInformation.class);
 
-            DefaultLifecycles defaultLifeCycles = helper.getComponent( DefaultLifecycles.class );
+            DefaultLifecycles defaultLifeCycles = helper.getComponent(DefaultLifecycles.class);
             lifecycles = defaultLifeCycles.getLifeCycles();
 
-            session = (MavenSession) helper.evaluate( "${session}" );
-            pluginManager = helper.getComponent( PluginManager.class );
-            factory = helper.getComponent( ArtifactFactory.class );
-            resolver = helper.getComponent( ArtifactResolver.class );
-            local = (ArtifactRepository) helper.evaluate( "${localRepository}" );
+            session = (MavenSession) helper.evaluate("${session}");
+            pluginManager = helper.getComponent(PluginManager.class);
+            factory = helper.getComponent(ArtifactFactory.class);
+            resolver = helper.getComponent(ArtifactResolver.class);
+            local = (ArtifactRepository) helper.evaluate("${localRepository}");
 
-            utils = new EnforcerRuleUtils( helper );
+            utils = new EnforcerRuleUtils(helper);
 
             // get all the plugins that are bound to the specified lifecycles
-            Set<Plugin> allPlugins = getBoundPlugins( project, phases );
+            Set<Plugin> allPlugins = getBoundPlugins(project, phases);
 
             // insert any additional plugins specified by the user.
-            allPlugins = addAdditionalPlugins( allPlugins, additionalPlugins );
-            allPlugins.addAll( getProfilePlugins( project ) );
+            allPlugins = addAdditionalPlugins(allPlugins, additionalPlugins);
+            allPlugins.addAll(getProfilePlugins(project));
 
             // pull out any we should skip
             allPlugins =
-                removeUncheckedPlugins( combineUncheckedPlugins( unCheckedPlugins, unCheckedPluginList ), allPlugins );
+                    removeUncheckedPlugins(combineUncheckedPlugins(unCheckedPlugins, unCheckedPluginList), allPlugins);
 
             // there's nothing to do here
-            if ( allPlugins.isEmpty() )
-            {
-                log.info( "No plugin bindings found." );
+            if (allPlugins.isEmpty()) {
+                log.info("No plugin bindings found.");
                 return;
-            }
-            else
-            {
-                log.debug( "All Plugins in use: " + allPlugins );
+            } else {
+                log.debug("All Plugins in use: " + allPlugins);
             }
 
             // get all the plugins that are mentioned in the pom (and parents)
-            List<PluginWrapper> pluginWrappers = getAllPluginEntries( project );
+            List<PluginWrapper> pluginWrappers = getAllPluginEntries(project);
 
-            for ( PluginWrapper pluginWrapper : pluginWrappers )
-            {
-                log.debug( "pluginWrappers: " + pluginWrapper.getGroupId() + ":" + pluginWrapper.getArtifactId() + ":"
-                    + pluginWrapper.getVersion() + " source: " + pluginWrapper.getSource() );
+            for (PluginWrapper pluginWrapper : pluginWrappers) {
+                log.debug("pluginWrappers: " + pluginWrapper.getGroupId() + ":" + pluginWrapper.getArtifactId() + ":"
+                        + pluginWrapper.getVersion() + " source: " + pluginWrapper.getSource());
             }
             // now look for the versions that aren't valid and add to a list.
             List<Plugin> failures = new ArrayList<Plugin>();
 
-            for ( Plugin plugin : allPlugins )
-            {
-                if ( !hasValidVersionSpecified( helper, plugin, pluginWrappers ) )
-                {
-                    failures.add( plugin );
+            for (Plugin plugin : allPlugins) {
+                if (!hasValidVersionSpecified(helper, plugin, pluginWrappers)) {
+                    failures.add(plugin);
                 }
             }
 
             // if anything was found, log it then append the optional message.
-            if ( !failures.isEmpty() )
-            {
-                handleMessagesToTheUser( project, failures );
+            if (!failures.isEmpty()) {
+                handleMessagesToTheUser(project, failures);
             }
-        }
-        catch ( ExpressionEvaluationException e )
-        {
-            throw new EnforcerRuleException( "Unable to Evaluate an Expression:" + e.getLocalizedMessage() );
-        }
-        catch ( ComponentLookupException e )
-        {
-            throw new EnforcerRuleException( "Unable to lookup a component:" + e.getLocalizedMessage() );
-        }
-        catch ( Exception e )
-        {
-            throw new EnforcerRuleException( e.getLocalizedMessage(), e );
+        } catch (ExpressionEvaluationException e) {
+            throw new EnforcerRuleException("Unable to Evaluate an Expression:" + e.getLocalizedMessage());
+        } catch (ComponentLookupException e) {
+            throw new EnforcerRuleException("Unable to lookup a component:" + e.getLocalizedMessage());
+        } catch (Exception e) {
+            throw new EnforcerRuleException(e.getLocalizedMessage(), e);
         }
     }
 
-    private void handleMessagesToTheUser( MavenProject project, List<Plugin> failures )
-        throws EnforcerRuleException
-    {
+    private void handleMessagesToTheUser(MavenProject project, List<Plugin> failures) throws EnforcerRuleException {
         StringBuilder newMsg = new StringBuilder();
-        newMsg.append( "Some plugins are missing valid versions or depend on Maven "
-            + runtimeInformation.getMavenVersion() + " defaults:" );
-        handleBanMessages( newMsg );
-        newMsg.append( "\n" );
-        for ( Plugin plugin : failures )
-        {
-            newMsg.append( plugin.getGroupId() );
-            newMsg.append( ":" );
-            newMsg.append( plugin.getArtifactId() );
-
-            try
-            {
-                newMsg.append( ". \tThe version currently in use is " );
-
-                Plugin currentPlugin = findCurrentPlugin( plugin, project );
-
-                if ( currentPlugin == null )
-                {
-                    newMsg.append( "unknown" );
-                }
-                else
-                {
-                    newMsg.append( currentPlugin.getVersion() );
-
-                    if ( PluginWrapper.isVersionFromDefaultLifecycleBindings( currentPlugin ).orElse( false ) )
-                    {
-                        newMsg.append( " via default lifecycle bindings" );
-                    }
-                    else 
-                    {
-                        String msg = PluginWrapper.isVersionFromSuperpom( currentPlugin )
-                                        .filter( b -> b )
-                                        .map( t -> " via super POM" )
-                                        // for Maven 3.6.0 or before (MNG-6593 / MNG-6600)
-                                        .orElse( " via super POM or default lifecycle bindings" );
-                        newMsg.append( msg );
+        newMsg.append("Some plugins are missing valid versions or depend on Maven "
+                + runtimeInformation.getMavenVersion() + " defaults:");
+        handleBanMessages(newMsg);
+        newMsg.append("\n");
+        for (Plugin plugin : failures) {
+            newMsg.append(plugin.getGroupId());
+            newMsg.append(":");
+            newMsg.append(plugin.getArtifactId());
+
+            try {
+                newMsg.append(". \tThe version currently in use is ");
+
+                Plugin currentPlugin = findCurrentPlugin(plugin, project);
+
+                if (currentPlugin == null) {
+                    newMsg.append("unknown");
+                } else {
+                    newMsg.append(currentPlugin.getVersion());
+
+                    if (PluginWrapper.isVersionFromDefaultLifecycleBindings(currentPlugin)
+                            .orElse(false)) {
+                        newMsg.append(" via default lifecycle bindings");
+                    } else {
+                        String msg = PluginWrapper.isVersionFromSuperpom(currentPlugin)
+                                .filter(b -> b)
+                                .map(t -> " via super POM")
+                                // for Maven 3.6.0 or before (MNG-6593 / MNG-6600)
+                                .orElse(" via super POM or default lifecycle bindings");
+                        newMsg.append(msg);
                     }
                 }
-            }
-            catch ( Exception e )
-            {
+            } catch (Exception e) {
                 // lots can go wrong here. Don't allow any issues trying to
                 // determine the issue stop me
-                log.debug( "Exception while determining plugin Version.", e );
-                newMsg.append( ". Unable to determine the plugin version." );
+                log.debug("Exception while determining plugin Version.", e);
+                newMsg.append(". Unable to determine the plugin version.");
             }
-            newMsg.append( "\n" );
+            newMsg.append("\n");
         }
         String message = getMessage();
-        if ( StringUtils.isNotEmpty( message ) )
-        {
-            newMsg.append( message );
+        if (StringUtils.isNotEmpty(message)) {
+            newMsg.append(message);
         }
 
-        throw new EnforcerRuleException( newMsg.toString() );
+        throw new EnforcerRuleException(newMsg.toString());
     }
 
-    private void handleBanMessages( StringBuilder newMsg )
-    {
-        if ( banLatest || banRelease || banSnapshots || banTimestamps )
-        {
-            newMsg.append( " (" );
-            if ( banLatest )
-            {
-                newMsg.append( "LATEST " );
+    private void handleBanMessages(StringBuilder newMsg) {
+        if (banLatest || banRelease || banSnapshots || banTimestamps) {
+            newMsg.append(" (");
+            if (banLatest) {
+                newMsg.append("LATEST ");
             }
-            if ( banRelease )
-            {
-                newMsg.append( "RELEASE " );
+            if (banRelease) {
+                newMsg.append("RELEASE ");
             }
-            if ( banSnapshots || banTimestamps )
-            {
-                newMsg.append( "SNAPSHOT " );
+            if (banSnapshots || banTimestamps) {
+                newMsg.append("SNAPSHOT ");
             }
-            newMsg.append( "are not allowed)" );
+            newMsg.append("are not allowed)");
         }
     }
 
@@ -362,15 +344,12 @@ public class RequirePluginVersions
      * @throws MojoExecutionException
      * @return The plugins which have been removed.
      */
-    public Set<Plugin> removeUncheckedPlugins( Collection<String> uncheckedPlugins, Set<Plugin> plugins )
-        throws MojoExecutionException
-    {
-        if ( uncheckedPlugins != null && !uncheckedPlugins.isEmpty() )
-        {
-            for ( String pluginKey : uncheckedPlugins )
-            {
-                Plugin plugin = parsePluginString( pluginKey, "UncheckedPlugins" );
-                plugins.remove( plugin );
+    public Set<Plugin> removeUncheckedPlugins(Collection<String> uncheckedPlugins, Set<Plugin> plugins)
+            throws MojoExecutionException {
+        if (uncheckedPlugins != null && !uncheckedPlugins.isEmpty()) {
+            for (String pluginKey : uncheckedPlugins) {
+                Plugin plugin = parsePluginString(pluginKey, "UncheckedPlugins");
+                plugins.remove(plugin);
             }
         }
         return plugins;
@@ -378,30 +357,25 @@ public class RequirePluginVersions
 
     /**
      * Combines the old Collection with the new comma separated list.
-     * 
+     *
      * @param uncheckedPlugins
      * @param uncheckedPluginsList
      * @return List of unchecked plugins.
      */
     // CHECKSTYLE_OFF: LineLength
-    public Collection<String> combineUncheckedPlugins( Collection<String> uncheckedPlugins,
-                                                       String uncheckedPluginsList )
-    // CHECKSTYLE_ON: LineLength
-    {
+    public Collection<String> combineUncheckedPlugins(Collection<String> uncheckedPlugins, String uncheckedPluginsList)
+                // CHECKSTYLE_ON: LineLength
+            {
         // if the comma list is empty, then there's nothing to do here.
-        if ( StringUtils.isNotEmpty( uncheckedPluginsList ) )
-        {
+        if (StringUtils.isNotEmpty(uncheckedPluginsList)) {
             // make sure there is a collection to add to.
-            if ( uncheckedPlugins == null )
-            {
+            if (uncheckedPlugins == null) {
                 uncheckedPlugins = new HashSet<String>();
-            }
-            else if ( !uncheckedPlugins.isEmpty() && log != null )
-            {
-                log.warn( "The parameter 'unCheckedPlugins' is deprecated. Use 'unCheckedPluginList' instead" );
+            } else if (!uncheckedPlugins.isEmpty() && log != null) {
+                log.warn("The parameter 'unCheckedPlugins' is deprecated. Use 'unCheckedPluginList' instead");
             }
 
-            uncheckedPlugins.addAll( Arrays.asList( uncheckedPluginsList.split( "," ) ) );
+            uncheckedPlugins.addAll(Arrays.asList(uncheckedPluginsList.split(",")));
         }
         return uncheckedPlugins;
     }
@@ -414,23 +388,17 @@ public class RequirePluginVersions
      * @return the sets the
      * @throws MojoExecutionException the mojo execution exception
      */
-    public Set<Plugin> addAdditionalPlugins( Set<Plugin> existing, List<String> additional )
-        throws MojoExecutionException
-    {
-        if ( additional != null )
-        {
-            for ( String pluginString : additional )
-            {
-                Plugin plugin = parsePluginString( pluginString, "AdditionalPlugins" );
+    public Set<Plugin> addAdditionalPlugins(Set<Plugin> existing, List<String> additional)
+            throws MojoExecutionException {
+        if (additional != null) {
+            for (String pluginString : additional) {
+                Plugin plugin = parsePluginString(pluginString, "AdditionalPlugins");
 
-                if ( existing == null )
-                {
+                if (existing == null) {
                     existing = new HashSet<>();
-                    existing.add( plugin );
-                }
-                else if ( !existing.contains( plugin ) )
-                {
-                    existing.add( plugin );
+                    existing.add(plugin);
+                } else if (!existing.contains(plugin)) {
+                    existing.add(plugin);
                 }
             }
         }
@@ -445,30 +413,21 @@ public class RequirePluginVersions
      * @throws MojoExecutionException
      * @return the plugin
      */
-    protected Plugin parsePluginString( String pluginString, String field )
-        throws MojoExecutionException
-    {
-        if ( pluginString != null )
-        {
-            String[] pluginStrings = pluginString.split( ":" );
-            if ( pluginStrings.length == 2 )
-            {
+    protected Plugin parsePluginString(String pluginString, String field) throws MojoExecutionException {
+        if (pluginString != null) {
+            String[] pluginStrings = pluginString.split(":");
+            if (pluginStrings.length == 2) {
                 Plugin plugin = new Plugin();
-                plugin.setGroupId( StringUtils.strip( pluginStrings[0] ) );
-                plugin.setArtifactId( StringUtils.strip( pluginStrings[1] ) );
+                plugin.setGroupId(StringUtils.strip(pluginStrings[0]));
+                plugin.setArtifactId(StringUtils.strip(pluginStrings[1]));
 
                 return plugin;
+            } else {
+                throw new MojoExecutionException("Invalid " + field + " string: " + pluginString);
             }
-            else
-            {
-                throw new MojoExecutionException( "Invalid " + field + " string: " + pluginString );
-            }
-        }
-        else
-        {
-            throw new MojoExecutionException( "Invalid " + field + " string: " + pluginString );
+        } else {
+            throw new MojoExecutionException("Invalid " + field + " string: " + pluginString);
         }
-
     }
 
     /**
@@ -477,21 +436,16 @@ public class RequirePluginVersions
      * @param project the project
      * @return the profile plugins
      */
-    public Set<Plugin> getProfilePlugins( MavenProject project )
-    {
+    public Set<Plugin> getProfilePlugins(MavenProject project) {
         Set<Plugin> result = new HashSet<>();
         List<Profile> profiles = project.getActiveProfiles();
-        if ( profiles != null && !profiles.isEmpty() )
-        {
-            for ( Profile p : profiles )
-            {
+        if (profiles != null && !profiles.isEmpty()) {
+            for (Profile p : profiles) {
                 BuildBase b = p.getBuild();
-                if ( b != null )
-                {
+                if (b != null) {
                     List<Plugin> plugins = b.getPlugins();
-                    if ( plugins != null )
-                    {
-                        result.addAll( plugins );
+                    if (plugins != null) {
+                        result.addAll(plugins);
                     }
                 }
             }
@@ -506,23 +460,18 @@ public class RequirePluginVersions
      * @param project project to search
      * @return matching plugin, <code>null</code> if not found.
      */
-    protected Plugin findCurrentPlugin( Plugin plugin, MavenProject project )
-    {
+    protected Plugin findCurrentPlugin(Plugin plugin, MavenProject project) {
         Plugin found = null;
-        try
-        {
+        try {
             Model model = project.getModel();
             Map<String, Plugin> plugins = model.getBuild().getPluginsAsMap();
-            found = plugins.get( plugin.getKey() );
-        }
-        catch ( NullPointerException e )
-        {
+            found = plugins.get(plugin.getKey());
+        } catch (NullPointerException e) {
             // nothing to do here
         }
 
-        if ( found == null )
-        {
-            found = resolvePlugin( plugin, project );
+        if (found == null) {
+            found = resolvePlugin(plugin, project);
         }
 
         return found;
@@ -535,20 +484,16 @@ public class RequirePluginVersions
      * @param project the project
      * @return the plugin
      */
-    protected Plugin resolvePlugin( Plugin plugin, MavenProject project )
-    {
+    protected Plugin resolvePlugin(Plugin plugin, MavenProject project) {
 
         List<ArtifactRepository> pluginRepositories = project.getPluginArtifactRepositories();
-        Artifact artifact = factory.createPluginArtifact( plugin.getGroupId(), plugin.getArtifactId(),
-                                                          VersionRange.createFromVersion( "LATEST" ) );
+        Artifact artifact = factory.createPluginArtifact(
+                plugin.getGroupId(), plugin.getArtifactId(), VersionRange.createFromVersion("LATEST"));
 
-        try
-        {
-            this.resolver.resolve( artifact, pluginRepositories, this.local );
-            plugin.setVersion( artifact.getVersion() );
-        }
-        catch ( ArtifactResolutionException | ArtifactNotFoundException e )
-        {
+        try {
+            this.resolver.resolve(artifact, pluginRepositories, this.local);
+            plugin.setVersion(artifact.getVersion());
+        } catch (ArtifactResolutionException | ArtifactNotFoundException e) {
             // What does this mean?
         }
 
@@ -566,28 +511,21 @@ public class RequirePluginVersions
      * @throws LifecycleExecutionException the lifecycle execution exception
      * @throws IllegalAccessException the illegal access exception
      */
-    protected Set<Plugin> getBoundPlugins( MavenProject project, String thePhases )
-        throws PluginNotFoundException, LifecycleExecutionException, IllegalAccessException
-    {
+    protected Set<Plugin> getBoundPlugins(MavenProject project, String thePhases)
+            throws PluginNotFoundException, LifecycleExecutionException, IllegalAccessException {
 
         Set<Plugin> allPlugins = new HashSet<>();
 
         // lookup the bindings for all the passed in phases
-        String[] lifecyclePhases = thePhases.split( "," );
-        for ( int i = 0; i < lifecyclePhases.length; i++ )
-        {
+        String[] lifecyclePhases = thePhases.split(",");
+        for (int i = 0; i < lifecyclePhases.length; i++) {
             String lifecyclePhase = lifecyclePhases[i];
-            if ( StringUtils.isNotEmpty( lifecyclePhase ) )
-            {
-                try
-                {
-                    Lifecycle lifecycle = getLifecycleForPhase( lifecyclePhase );
-                    log.debug( "getBoundPlugins(): " + project.getId() + " " + lifecyclePhase + " "
-                        + lifecycle.getId() );
-                    allPlugins.addAll( getAllPlugins( project, lifecycle ) );
-                }
-                catch ( BuildFailureException e )
-                {
+            if (StringUtils.isNotEmpty(lifecyclePhase)) {
+                try {
+                    Lifecycle lifecycle = getLifecycleForPhase(lifecyclePhase);
+                    log.debug("getBoundPlugins(): " + project.getId() + " " + lifecyclePhase + " " + lifecycle.getId());
+                    allPlugins.addAll(getAllPlugins(project, lifecycle));
+                } catch (BuildFailureException e) {
                     // i'm going to swallow this because the
                     // user may have declared a phase that
                     // doesn't exist for every module.
@@ -606,43 +544,33 @@ public class RequirePluginVersions
      * @param pluginWrappers the plugins
      * @return true, if successful
      */
-    protected boolean hasValidVersionSpecified( EnforcerRuleHelper helper, Plugin source,
-                                                List<PluginWrapper> pluginWrappers )
-    {
+    protected boolean hasValidVersionSpecified(
+            EnforcerRuleHelper helper, Plugin source, List<PluginWrapper> pluginWrappers) {
         boolean found = false;
         boolean status = false;
-        for ( PluginWrapper plugin : pluginWrappers )
-        {
+        for (PluginWrapper plugin : pluginWrappers) {
             // find the matching plugin entry
-            if ( isMatchingPlugin( source, plugin ) )
-            {
+            if (isMatchingPlugin(source, plugin)) {
                 found = true;
                 // found the entry. now see if the version is specified
                 String version = plugin.getVersion();
-                try
-                {
-                    version = (String) helper.evaluate( version );
-                }
-                catch ( ExpressionEvaluationException e )
-                {
+                try {
+                    version = (String) helper.evaluate(version);
+                } catch (ExpressionEvaluationException e) {
                     return false;
                 }
 
-                if ( isValidVersion( version ) )
-                {
-                    helper.getLog().debug( "checking for notEmpty and notIsWhitespace(): " + version );
-                    if ( banRelease && version.equals( "RELEASE" ) )
-                    {
+                if (isValidVersion(version)) {
+                    helper.getLog().debug("checking for notEmpty and notIsWhitespace(): " + version);
+                    if (banRelease && version.equals("RELEASE")) {
                         return false;
                     }
 
-                    if ( banLatest && version.equals( "LATEST" ) )
-                    {
+                    if (banLatest && version.equals("LATEST")) {
                         return false;
                     }
 
-                    if ( banSnapshots && isSnapshot( version ) )
-                    {
+                    if (banSnapshots && isSnapshot(version)) {
                         return false;
                     }
                     // the version was specified and not
@@ -651,30 +579,26 @@ public class RequirePluginVersions
 
                     status = true;
 
-                    if ( !banRelease && !banLatest && !banSnapshots )
-                    {
+                    if (!banRelease && !banLatest && !banSnapshots) {
                         // no need to keep looking
                         break;
                     }
                 }
             }
         }
-        if ( !found )
-        {
-            helper.getLog().debug( "plugin " + source.getGroupId() + ":" + source.getArtifactId() + " not found" );
+        if (!found) {
+            helper.getLog().debug("plugin " + source.getGroupId() + ":" + source.getArtifactId() + " not found");
         }
         return status;
     }
 
-    private boolean isValidVersion( String version )
-    {
-        return StringUtils.isNotEmpty( version ) && !StringUtils.isWhitespace( version );
+    private boolean isValidVersion(String version) {
+        return StringUtils.isNotEmpty(version) && !StringUtils.isWhitespace(version);
     }
 
-    private boolean isMatchingPlugin( Plugin source, PluginWrapper plugin )
-    {
-        return source.getArtifactId().equals( plugin.getArtifactId() )
-            && source.getGroupId().equals( plugin.getGroupId() );
+    private boolean isMatchingPlugin(Plugin source, PluginWrapper plugin) {
+        return source.getArtifactId().equals(plugin.getArtifactId())
+                && source.getGroupId().equals(plugin.getGroupId());
     }
 
     /**
@@ -683,16 +607,12 @@ public class RequirePluginVersions
      * @param baseVersion the base version
      * @return true, if is snapshot
      */
-    protected boolean isSnapshot( String baseVersion )
-    {
-        if ( banTimestamps )
-        {
-            return Artifact.VERSION_FILE_PATTERN.matcher( baseVersion ).matches()
-                || baseVersion.endsWith( Artifact.SNAPSHOT_VERSION );
-        }
-        else
-        {
-            return baseVersion.endsWith( Artifact.SNAPSHOT_VERSION );
+    protected boolean isSnapshot(String baseVersion) {
+        if (banTimestamps) {
+            return Artifact.VERSION_FILE_PATTERN.matcher(baseVersion).matches()
+                    || baseVersion.endsWith(Artifact.SNAPSHOT_VERSION);
+        } else {
+            return baseVersion.endsWith(Artifact.SNAPSHOT_VERSION);
         }
     }
 
@@ -708,40 +628,36 @@ public class RequirePluginVersions
      * @throws PluginNotFoundException the plugin not found exception
      * @throws LifecycleExecutionException the lifecycle execution exception
      */
-    private Set<Plugin> getAllPlugins( MavenProject project, Lifecycle lifecycle )
-        throws PluginNotFoundException, LifecycleExecutionException
+    private Set<Plugin> getAllPlugins(MavenProject project, Lifecycle lifecycle)
+            throws PluginNotFoundException, LifecycleExecutionException {
 
-    {
-        log.debug( "RequirePluginVersions.getAllPlugins:" );
+        log.debug("RequirePluginVersions.getAllPlugins:");
 
         Set<Plugin> plugins = new HashSet<>();
         // first, bind those associated with the packaging
-        Map<String, String> mappings = findMappingsForLifecycle( project, lifecycle );
+        Map<String, String> mappings = findMappingsForLifecycle(project, lifecycle);
 
-        for ( Map.Entry<String, String> entry : mappings.entrySet() )
-        {
-            log.debug( "  lifecycleMapping = " + entry.getKey() );
+        for (Map.Entry<String, String> entry : mappings.entrySet()) {
+            log.debug("  lifecycleMapping = " + entry.getKey());
             String pluginsForLifecycle = (String) entry.getValue();
-            log.debug( "  plugins = " + pluginsForLifecycle );
-            if ( StringUtils.isNotEmpty( pluginsForLifecycle ) )
-            {
-                String pluginList[] = pluginsForLifecycle.split( "," );
-                for ( String plugin : pluginList )
-                {
-                    plugin = StringUtils.strip( plugin );
-                    log.debug( "    plugin = " + plugin );
-                    String tokens[] = plugin.split( ":" );
-                    log.debug( "    GAV = " + Arrays.asList( tokens ) );
+            log.debug("  plugins = " + pluginsForLifecycle);
+            if (StringUtils.isNotEmpty(pluginsForLifecycle)) {
+                String pluginList[] = pluginsForLifecycle.split(",");
+                for (String plugin : pluginList) {
+                    plugin = StringUtils.strip(plugin);
+                    log.debug("    plugin = " + plugin);
+                    String tokens[] = plugin.split(":");
+                    log.debug("    GAV = " + Arrays.asList(tokens));
 
                     Plugin p = new Plugin();
-                    p.setGroupId( tokens[0] );
-                    p.setArtifactId( tokens[1] );
-                    plugins.add( p );
+                    p.setGroupId(tokens[0]);
+                    p.setArtifactId(tokens[1]);
+                    plugins.add(p);
                 }
             }
         }
 
-        plugins.addAll( project.getBuildPlugins() );
+        plugins.addAll(project.getBuildPlugins());
 
         return plugins;
     }
@@ -756,29 +672,21 @@ public class RequirePluginVersions
      * @return the phase to lifecycle map
      * @throws LifecycleExecutionException the lifecycle execution exception
      */
-    public Map<String, Lifecycle> getPhaseToLifecycleMap()
-        throws LifecycleExecutionException
-    {
-        if ( phaseToLifecycleMap == null )
-        {
+    public Map<String, Lifecycle> getPhaseToLifecycleMap() throws LifecycleExecutionException {
+        if (phaseToLifecycleMap == null) {
             phaseToLifecycleMap = new HashMap<>();
 
-            for ( Lifecycle lifecycle : lifecycles )
-            {
+            for (Lifecycle lifecycle : lifecycles) {
                 List<String> phases = lifecycle.getPhases();
-                for ( String phase : phases )
-                {
-                    log.debug( "getPhaseToLifecycleMap(): phase: " + phase );
-                    if ( phaseToLifecycleMap.containsKey( phase ) )
-                    {
-                        Lifecycle prevLifecycle = (Lifecycle) phaseToLifecycleMap.get( phase );
-                        throw new LifecycleExecutionException( "Phase '" + phase
-                            + "' is defined in more than one lifecycle: '" + lifecycle.getId() + "' and '"
-                            + prevLifecycle.getId() + "'" );
-                    }
-                    else
-                    {
-                        phaseToLifecycleMap.put( phase, lifecycle );
+                for (String phase : phases) {
+                    log.debug("getPhaseToLifecycleMap(): phase: " + phase);
+                    if (phaseToLifecycleMap.containsKey(phase)) {
+                        Lifecycle prevLifecycle = (Lifecycle) phaseToLifecycleMap.get(phase);
+                        throw new LifecycleExecutionException("Phase '" + phase
+                                + "' is defined in more than one lifecycle: '" + lifecycle.getId() + "' and '"
+                                + prevLifecycle.getId() + "'");
+                    } else {
+                        phaseToLifecycleMap.put(phase, lifecycle);
                     }
                 }
             }
@@ -794,14 +702,11 @@ public class RequirePluginVersions
      * @throws BuildFailureException the build failure exception
      * @throws LifecycleExecutionException the lifecycle execution exception
      */
-    private Lifecycle getLifecycleForPhase( String phase )
-        throws BuildFailureException, LifecycleExecutionException
-    {
-        Lifecycle lifecycle = getPhaseToLifecycleMap().get( phase );
-
-        if ( lifecycle == null )
-        {
-            throw new BuildFailureException( "Unable to find lifecycle for phase '" + phase + "'" );
+    private Lifecycle getLifecycleForPhase(String phase) throws BuildFailureException, LifecycleExecutionException {
+        Lifecycle lifecycle = getPhaseToLifecycleMap().get(phase);
+
+        if (lifecycle == null) {
+            throw new BuildFailureException("Unable to find lifecycle for phase '" + phase + "'");
         }
         return lifecycle;
     }
@@ -815,47 +720,36 @@ public class RequirePluginVersions
      * @throws LifecycleExecutionException the lifecycle execution exception
      * @throws PluginNotFoundException the plugin not found exception
      */
-    private Map<String, String> findMappingsForLifecycle( MavenProject project, Lifecycle lifecycle )
-        throws LifecycleExecutionException, PluginNotFoundException
-    {
+    private Map<String, String> findMappingsForLifecycle(MavenProject project, Lifecycle lifecycle)
+            throws LifecycleExecutionException, PluginNotFoundException {
         String packaging = project.getPackaging();
         Map<String, String> mappings = null;
 
-        LifecycleMapping m = (LifecycleMapping) findExtension( project, LifecycleMapping.ROLE, packaging,
-                                                               session.getSettings(), session.getLocalRepository() );
-        if ( m != null )
-        {
-            mappings = m.getPhases( lifecycle.getId() );
+        LifecycleMapping m = (LifecycleMapping) findExtension(
+                project, LifecycleMapping.ROLE, packaging, session.getSettings(), session.getLocalRepository());
+        if (m != null) {
+            mappings = m.getPhases(lifecycle.getId());
         }
 
         Map<String, String> defaultMappings = lifecycle.getDefaultPhases();
 
-        if ( mappings == null )
-        {
-            try
-            {
-                m = helper.getComponent( LifecycleMapping.class, packaging );
-                mappings = m.getPhases( lifecycle.getId() );
-            }
-            catch ( ComponentLookupException e )
-            {
-                if ( defaultMappings == null )
-                {
-                    throw new LifecycleExecutionException( "Cannot find lifecycle mapping for packaging: \'" + packaging
-                        + "\'.", e );
+        if (mappings == null) {
+            try {
+                m = helper.getComponent(LifecycleMapping.class, packaging);
+                mappings = m.getPhases(lifecycle.getId());
+            } catch (ComponentLookupException e) {
+                if (defaultMappings == null) {
+                    throw new LifecycleExecutionException(
+                            "Cannot find lifecycle mapping for packaging: \'" + packaging + "\'.", e);
                 }
             }
         }
 
-        if ( mappings == null )
-        {
-            if ( defaultMappings == null )
-            {
-                throw new LifecycleExecutionException( "Cannot find lifecycle mapping for packaging: \'" + packaging
-                    + "\', and there is no default" );
-            }
-            else
-            {
+        if (mappings == null) {
+            if (defaultMappings == null) {
+                throw new LifecycleExecutionException(
+                        "Cannot find lifecycle mapping for packaging: \'" + packaging + "\', and there is no default");
+            } else {
                 mappings = defaultMappings;
             }
         }
@@ -875,40 +769,31 @@ public class RequirePluginVersions
      * @throws LifecycleExecutionException the lifecycle execution exception
      * @throws PluginNotFoundException the plugin not found exception
      */
-    private Object findExtension( MavenProject project, String role, String roleHint, Settings settings,
-                                  ArtifactRepository localRepository )
-        throws LifecycleExecutionException, PluginNotFoundException
-    {
+    private Object findExtension(
+            MavenProject project, String role, String roleHint, Settings settings, ArtifactRepository localRepository)
+            throws LifecycleExecutionException, PluginNotFoundException {
         Object pluginComponent = null;
 
         List<Plugin> buildPlugins = project.getBuildPlugins();
-        for ( Plugin plugin : buildPlugins )
-        {
-            if ( plugin.isExtensions() )
-            {
-                verifyPlugin( plugin, project, settings, localRepository );
+        for (Plugin plugin : buildPlugins) {
+            if (plugin.isExtensions()) {
+                verifyPlugin(plugin, project, settings, localRepository);
 
                 // TODO: if moved to the plugin manager we
                 // already have the descriptor from above
                 // and so do can lookup the container
                 // directly
-                try
-                {
-                    pluginComponent = pluginManager.getPluginComponent( plugin, role, roleHint );
+                try {
+                    pluginComponent = pluginManager.getPluginComponent(plugin, role, roleHint);
 
-                    if ( pluginComponent != null )
-                    {
+                    if (pluginComponent != null) {
                         break;
                     }
-                }
-                catch ( ComponentLookupException e )
-                {
-                    log.debug( "Unable to find the lifecycle component in the extension", e );
-                }
-                catch ( PluginManagerException e )
-                {
-                    throw new LifecycleExecutionException( "Error getting extensions from the plugin '"
-                        + plugin.getKey() + "': " + e.getMessage(), e );
+                } catch (ComponentLookupException e) {
+                    log.debug("Unable to find the lifecycle component in the extension", e);
+                } catch (PluginManagerException e) {
+                    throw new LifecycleExecutionException(
+                            "Error getting extensions from the plugin '" + plugin.getKey() + "': " + e.getMessage(), e);
                 }
             }
         }
@@ -926,24 +811,23 @@ public class RequirePluginVersions
      * @throws LifecycleExecutionException the lifecycle execution exception
      * @throws PluginNotFoundException the plugin not found exception
      */
-    private PluginDescriptor verifyPlugin( Plugin plugin, MavenProject project, Settings settings,
-                                           ArtifactRepository localRepository )
-        throws LifecycleExecutionException, PluginNotFoundException
-    {
+    private PluginDescriptor verifyPlugin(
+            Plugin plugin, MavenProject project, Settings settings, ArtifactRepository localRepository)
+            throws LifecycleExecutionException, PluginNotFoundException {
         PluginDescriptor pluginDescriptor;
-        try
-        {
-            pluginDescriptor = pluginManager.verifyPlugin( plugin, project, settings, localRepository );
-        }
-        catch ( PluginManagerException e )
-        {
-            throw new LifecycleExecutionException( "Internal error in the plugin manager getting plugin '"
-                + plugin.getKey() + "': " + e.getMessage(), e );
-        }
-        catch ( PluginVersionResolutionException | InvalidVersionSpecificationException | InvalidPluginException
-            | ArtifactNotFoundException | ArtifactResolutionException | PluginVersionNotFoundException e )
-        {
-            throw new LifecycleExecutionException( e.getMessage(), e );
+        try {
+            pluginDescriptor = pluginManager.verifyPlugin(plugin, project, settings, localRepository);
+        } catch (PluginManagerException e) {
+            throw new LifecycleExecutionException(
+                    "Internal error in the plugin manager getting plugin '" + plugin.getKey() + "': " + e.getMessage(),
+                    e);
+        } catch (PluginVersionResolutionException
+                | InvalidVersionSpecificationException
+                | InvalidPluginException
+                | ArtifactNotFoundException
+                | ArtifactResolutionException
+                | PluginVersionNotFoundException e) {
+            throw new LifecycleExecutionException(e.getMessage(), e);
         }
         return pluginDescriptor;
     }
@@ -959,111 +843,81 @@ public class RequirePluginVersions
      * @throws IOException Signals that an I/O exception has occurred.
      * @throws XmlPullParserException the xml pull parser exception
      */
-    protected List<PluginWrapper> getAllPluginEntries( MavenProject project )
-        throws ArtifactResolutionException, ArtifactNotFoundException, IOException, XmlPullParserException
-    {
+    protected List<PluginWrapper> getAllPluginEntries(MavenProject project)
+            throws ArtifactResolutionException, ArtifactNotFoundException, IOException, XmlPullParserException {
         List<PluginWrapper> plugins = new ArrayList<>();
         // now find all the plugin entries, either in
         // build.plugins or build.pluginManagement.plugins, profiles.plugins and reporting
 
-        getPlugins( plugins, project.getModel() );
-        getReportingPlugins( plugins, project.getModel() );
-        getPluginManagementPlugins( plugins, project.getModel() );
-        addPluginsInProfiles( plugins, project.getModel() );
+        getPlugins(plugins, project.getModel());
+        getReportingPlugins(plugins, project.getModel());
+        getPluginManagementPlugins(plugins, project.getModel());
+        addPluginsInProfiles(plugins, project.getModel());
 
         return plugins;
     }
 
-
-    private void addPluginsInProfiles( List<PluginWrapper> plugins, Model model )
-    {
+    private void addPluginsInProfiles(List<PluginWrapper> plugins, Model model) {
         List<Profile> profiles = model.getProfiles();
-        for ( Profile profile : profiles )
-        {
-            getProfilePlugins( plugins, model, profile );
-            getProfileReportingPlugins( plugins, model, profile );
-            getProfilePluginManagementPlugins( plugins, model, profile );
+        for (Profile profile : profiles) {
+            getProfilePlugins(plugins, model, profile);
+            getProfileReportingPlugins(plugins, model, profile);
+            getProfilePluginManagementPlugins(plugins, model, profile);
         }
     }
 
-    private void getProfilePluginManagementPlugins( List<PluginWrapper> plugins, Model model, Profile profile )
-    {
-        try
-        {
+    private void getProfilePluginManagementPlugins(List<PluginWrapper> plugins, Model model, Profile profile) {
+        try {
             List<Plugin> modelPlugins = profile.getBuild().getPluginManagement().getPlugins();
-            plugins.addAll( PluginWrapper.addAll( utils.resolvePlugins( modelPlugins ), banMavenDefaults ) );
-        }
-        catch ( NullPointerException e )
-        {
+            plugins.addAll(PluginWrapper.addAll(utils.resolvePlugins(modelPlugins), banMavenDefaults));
+        } catch (NullPointerException e) {
             // guess there are no plugins here.
         }
     }
 
-    private void getProfileReportingPlugins( List<PluginWrapper> plugins, Model model, Profile profile )
-    {
-        try
-        {
+    private void getProfileReportingPlugins(List<PluginWrapper> plugins, Model model, Profile profile) {
+        try {
             List<ReportPlugin> modelReportPlugins = profile.getReporting().getPlugins();
             // add the reporting plugins
-            plugins.addAll( PluginWrapper.addAll( utils.resolveReportPlugins( modelReportPlugins ),
-                                                  banMavenDefaults ) );
-        }
-        catch ( NullPointerException e )
-        {
+            plugins.addAll(PluginWrapper.addAll(utils.resolveReportPlugins(modelReportPlugins), banMavenDefaults));
+        } catch (NullPointerException e) {
             // guess there are no plugins here.
         }
     }
 
-    private void getProfilePlugins( List<PluginWrapper> plugins, Model model, Profile profile )
-    {
-        try
-        {
+    private void getProfilePlugins(List<PluginWrapper> plugins, Model model, Profile profile) {
+        try {
             List<Plugin> modelPlugins = profile.getBuild().getPlugins();
-            plugins.addAll( PluginWrapper.addAll( utils.resolvePlugins( modelPlugins ), banMavenDefaults ) );
-        }
-        catch ( NullPointerException e )
-        {
+            plugins.addAll(PluginWrapper.addAll(utils.resolvePlugins(modelPlugins), banMavenDefaults));
+        } catch (NullPointerException e) {
             // guess there are no plugins here.
         }
     }
 
-    private void getPlugins( List<PluginWrapper> plugins, Model model )
-    {
-        try
-        {
+    private void getPlugins(List<PluginWrapper> plugins, Model model) {
+        try {
             List<Plugin> modelPlugins = model.getBuild().getPlugins();
-            plugins.addAll( PluginWrapper.addAll( utils.resolvePlugins( modelPlugins ), banMavenDefaults ) );
-        }
-        catch ( NullPointerException e )
-        {
+            plugins.addAll(PluginWrapper.addAll(utils.resolvePlugins(modelPlugins), banMavenDefaults));
+        } catch (NullPointerException e) {
             // guess there are no plugins here.
         }
     }
 
-    private void getPluginManagementPlugins( List<PluginWrapper> plugins, Model model )
-    {
-        try
-        {
+    private void getPluginManagementPlugins(List<PluginWrapper> plugins, Model model) {
+        try {
             List<Plugin> modelPlugins = model.getBuild().getPluginManagement().getPlugins();
-            plugins.addAll( PluginWrapper.addAll( utils.resolvePlugins( modelPlugins ), banMavenDefaults ) );
-        }
-        catch ( NullPointerException e )
-        {
+            plugins.addAll(PluginWrapper.addAll(utils.resolvePlugins(modelPlugins), banMavenDefaults));
+        } catch (NullPointerException e) {
             // guess there are no plugins here.
         }
     }
 
-    private void getReportingPlugins( List<PluginWrapper> plugins, Model model )
-    {
-        try
-        {
+    private void getReportingPlugins(List<PluginWrapper> plugins, Model model) {
+        try {
             List<ReportPlugin> modelReportPlugins = model.getReporting().getPlugins();
             // add the reporting plugins
-            plugins.addAll( PluginWrapper.addAll( utils.resolveReportPlugins( modelReportPlugins ),
-                                                  banMavenDefaults ) );
-        }
-        catch ( NullPointerException e )
-        {
+            plugins.addAll(PluginWrapper.addAll(utils.resolveReportPlugins(modelReportPlugins), banMavenDefaults));
+        } catch (NullPointerException e) {
             // guess there are no plugins here.
         }
     }
@@ -1073,8 +927,7 @@ public class RequirePluginVersions
      *
      * @return the banLatest
      */
-    protected boolean isBanLatest()
-    {
+    protected boolean isBanLatest() {
         return this.banLatest;
     }
 
@@ -1083,8 +936,7 @@ public class RequirePluginVersions
      *
      * @param theBanLatest the banLatest to set
      */
-    protected void setBanLatest( boolean theBanLatest )
-    {
+    protected void setBanLatest(boolean theBanLatest) {
         this.banLatest = theBanLatest;
     }
 
@@ -1093,8 +945,7 @@ public class RequirePluginVersions
      *
      * @return the banRelease
      */
-    protected boolean isBanRelease()
-    {
+    protected boolean isBanRelease() {
         return this.banRelease;
     }
 
@@ -1103,8 +954,7 @@ public class RequirePluginVersions
      *
      * @param theBanRelease the banRelease to set
      */
-    protected void setBanRelease( boolean theBanRelease )
-    {
+    protected void setBanRelease(boolean theBanRelease) {
         this.banRelease = theBanRelease;
     }
 
@@ -1113,8 +963,7 @@ public class RequirePluginVersions
      *
      * @return the utils
      */
-    protected EnforcerRuleUtils getUtils()
-    {
+    protected EnforcerRuleUtils getUtils() {
         return this.utils;
     }
 
@@ -1123,8 +972,7 @@ public class RequirePluginVersions
      *
      * @param theUtils the utils to set
      */
-    protected void setUtils( EnforcerRuleUtils theUtils )
-    {
+    protected void setUtils(EnforcerRuleUtils theUtils) {
         this.utils = theUtils;
     }
 
@@ -1133,8 +981,7 @@ public class RequirePluginVersions
      *
      * @return the banSnapshots
      */
-    public boolean isBanSnapshots()
-    {
+    public boolean isBanSnapshots() {
         return this.banSnapshots;
     }
 
@@ -1143,8 +990,7 @@ public class RequirePluginVersions
      *
      * @param theBanSnapshots the banSnapshots to set
      */
-    public void setBanSnapshots( boolean theBanSnapshots )
-    {
+    public void setBanSnapshots(boolean theBanSnapshots) {
         this.banSnapshots = theBanSnapshots;
     }
 
@@ -1153,8 +999,7 @@ public class RequirePluginVersions
      *
      * @return the banTimestamps
      */
-    public boolean isBanTimestamps()
-    {
+    public boolean isBanTimestamps() {
         return this.banTimestamps;
     }
 
@@ -1163,38 +1008,31 @@ public class RequirePluginVersions
      *
      * @param theBanTimestamps the banTimestamps to set
      */
-    public void setBanTimestamps( boolean theBanTimestamps )
-    {
+    public void setBanTimestamps(boolean theBanTimestamps) {
         this.banTimestamps = theBanTimestamps;
     }
 
-    public List<String> getUnCheckedPlugins()
-    {
+    public List<String> getUnCheckedPlugins() {
         return unCheckedPlugins;
     }
 
-    public void setUnCheckedPlugins( List<String> unCheckedPlugins )
-    {
+    public void setUnCheckedPlugins(List<String> unCheckedPlugins) {
         this.unCheckedPlugins = unCheckedPlugins;
     }
 
-    public final void setPhases( String phases )
-    {
+    public final void setPhases(String phases) {
         this.phases = phases;
     }
 
-    public final String getPhases()
-    {
+    public final String getPhases() {
         return phases;
     }
 
-    public final void setAdditionalPlugins( List<String> additionalPlugins )
-    {
+    public final void setAdditionalPlugins(List<String> additionalPlugins) {
         this.additionalPlugins = additionalPlugins;
     }
 
-    public final List<String> getAdditionalPlugins()
-    {
+    public final List<String> getAdditionalPlugins() {
         return additionalPlugins;
     }
 }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePrerequisite.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePrerequisite.java
index 725f2aa..5637ecb 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePrerequisite.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePrerequisite.java
@@ -1,132 +1,131 @@
-package org.apache.maven.plugins.enforcer;
-
-/*
- * 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.
- */
-
-import java.util.List;
-
-import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
-import org.apache.maven.artifact.versioning.VersionRange;
-import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
-import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
-import org.apache.maven.model.Prerequisites;
-import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException;
-
-/**
- * @author Robert Scholte
- * @since 1.3
- */
-public class RequirePrerequisite
-    extends AbstractNonCacheableEnforcerRule
-{
-    /**
-     * Only the projects with one of these packagings will be enforced to have the correct prerequisite.
-     * 
-     * @since 1.4
-     */
-    private List<String> packagings;
-
-    /**
-     * Can either be version or a range, e.g. {@code 2.2.1} or {@code [2.2.1,)}
-     */
-    private String mavenVersion;
-
-    /**
-     * Set the mavenVersion Can either be version or a range, e.g. {@code 2.2.1} or {@code [2.2.1,)}
-     * 
-     * @param mavenVersion the version or {@code null}
-     */
-    public void setMavenVersion( String mavenVersion )
-    {
-        this.mavenVersion = mavenVersion;
-    }
-
-    /**
-     * Only the projects with one of these packagings will be enforced to have the correct prerequisite.
-     * 
-     * @since 1.4
-     * @param packagings the list of packagings
-     */
-    public void setPackagings( List<String> packagings )
-    {
-        this.packagings = packagings;
-    }
-
-    @Override
-    public void execute( EnforcerRuleHelper helper )
-        throws EnforcerRuleException
-    {
-        try
-        {
-            MavenProject project = (MavenProject) helper.evaluate( "${project}" );
-
-            if ( "pom".equals( project.getPackaging() ) )
-            {
-                helper.getLog().debug( "Packaging is pom, skipping requirePrerequisite rule" );
-                return;
-            }
-
-            if ( packagings != null && !packagings.contains( project.getPackaging() ) )
-            {
-                // CHECKSTYLE_OFF: LineLength
-                helper.getLog().debug( "Packaging is " + project.getPackaging() + ", skipping requirePrerequisite rule" );
-                return;
-                // CHECKSTYLE_ON: LineLength
-            }
-
-            Prerequisites prerequisites = project.getPrerequisites();
-
-            if ( prerequisites == null )
-            {
-                throw new EnforcerRuleException( "Requires prerequisite not set" );
-            }
-
-            if ( mavenVersion != null )
-            {
-
-                VersionRange requiredVersionRange = VersionRange.createFromVersionSpec( mavenVersion );
-
-                if ( !requiredVersionRange.hasRestrictions() )
-                {
-                    requiredVersionRange = VersionRange.createFromVersionSpec( "[" + mavenVersion + ",)" );
-                }
-
-                VersionRange specifiedVersion = VersionRange.createFromVersionSpec( prerequisites.getMaven() );
-
-                VersionRange restrictedVersionRange = requiredVersionRange.restrict( specifiedVersion );
-
-                if ( restrictedVersionRange.getRecommendedVersion() == null )
-                {
-                    throw new EnforcerRuleException( "The specified Maven prerequisite( " + specifiedVersion
-                        + " ) doesn't match the required version: " + mavenVersion );
-                }
-            }
-        }
-        catch ( ExpressionEvaluationException e )
-        {
-            throw new EnforcerRuleException( e.getMessage(), e );
-        }
-        catch ( InvalidVersionSpecificationException e )
-        {
-            throw new EnforcerRuleException( e.getMessage(), e );
-        }
-    }
-
-}
+/*
+ * 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.
+ */
+package org.apache.maven.plugins.enforcer;
+
+/*
+ * 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.
+ */
+
+import java.util.List;
+import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
+import org.apache.maven.artifact.versioning.VersionRange;
+import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
+import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
+import org.apache.maven.model.Prerequisites;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException;
+
+/**
+ * @author Robert Scholte
+ * @since 1.3
+ */
+public class RequirePrerequisite extends AbstractNonCacheableEnforcerRule {
+    /**
+     * Only the projects with one of these packagings will be enforced to have the correct prerequisite.
+     *
+     * @since 1.4
+     */
+    private List<String> packagings;
+
+    /**
+     * Can either be version or a range, e.g. {@code 2.2.1} or {@code [2.2.1,)}
+     */
+    private String mavenVersion;
+
+    /**
+     * Set the mavenVersion Can either be version or a range, e.g. {@code 2.2.1} or {@code [2.2.1,)}
+     *
+     * @param mavenVersion the version or {@code null}
+     */
+    public void setMavenVersion(String mavenVersion) {
+        this.mavenVersion = mavenVersion;
+    }
+
+    /**
+     * Only the projects with one of these packagings will be enforced to have the correct prerequisite.
+     *
+     * @since 1.4
+     * @param packagings the list of packagings
+     */
+    public void setPackagings(List<String> packagings) {
+        this.packagings = packagings;
+    }
+
+    @Override
+    public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
+        try {
+            MavenProject project = (MavenProject) helper.evaluate("${project}");
+
+            if ("pom".equals(project.getPackaging())) {
+                helper.getLog().debug("Packaging is pom, skipping requirePrerequisite rule");
+                return;
+            }
+
+            if (packagings != null && !packagings.contains(project.getPackaging())) {
+                // CHECKSTYLE_OFF: LineLength
+                helper.getLog().debug("Packaging is " + project.getPackaging() + ", skipping requirePrerequisite rule");
+                return;
+                // CHECKSTYLE_ON: LineLength
+            }
+
+            Prerequisites prerequisites = project.getPrerequisites();
+
+            if (prerequisites == null) {
+                throw new EnforcerRuleException("Requires prerequisite not set");
+            }
+
+            if (mavenVersion != null) {
+
+                VersionRange requiredVersionRange = VersionRange.createFromVersionSpec(mavenVersion);
+
+                if (!requiredVersionRange.hasRestrictions()) {
+                    requiredVersionRange = VersionRange.createFromVersionSpec("[" + mavenVersion + ",)");
+                }
+
+                VersionRange specifiedVersion = VersionRange.createFromVersionSpec(prerequisites.getMaven());
+
+                VersionRange restrictedVersionRange = requiredVersionRange.restrict(specifiedVersion);
+
+                if (restrictedVersionRange.getRecommendedVersion() == null) {
+                    throw new EnforcerRuleException("The specified Maven prerequisite( " + specifiedVersion
+                            + " ) doesn't match the required version: " + mavenVersion);
+                }
+            }
+        } catch (ExpressionEvaluationException e) {
+            throw new EnforcerRuleException(e.getMessage(), e);
+        } catch (InvalidVersionSpecificationException e) {
+            throw new EnforcerRuleException(e.getMessage(), e);
+        }
+    }
+}
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireProfileIdsExist.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireProfileIdsExist.java
index e213b08..09d6fef 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireProfileIdsExist.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireProfileIdsExist.java
@@ -1,101 +1,104 @@
-package org.apache.maven.plugins.enforcer;
-
-/*
- * 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.
- */
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
-import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
-import org.apache.maven.execution.MavenSession;
-import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException;
-import org.codehaus.plexus.util.StringUtils;
-
-/**
- * Ensure that all profiles mentioned on the commandline do exist. 
- * 
- * @author Robert Scholte
- * @author Gabriel Belingueres
- */
-public class RequireProfileIdsExist extends AbstractNonCacheableEnforcerRule
-{
-    @Override
-    public void execute( EnforcerRuleHelper helper )
-        throws EnforcerRuleException
-    {
-        try
-        {
-            MavenSession session = (MavenSession) helper.evaluate( "${session}" );
-
-            List<String> profileIds = new ArrayList<>();
-            profileIds.addAll( session.getProjectBuildingRequest().getActiveProfileIds() );
-            profileIds.addAll( session.getProjectBuildingRequest().getInactiveProfileIds() );
-
-            for ( MavenProject project : session.getProjects() )
-            {
-                // iterate over all parents
-                MavenProject currentProject = project;
-                do
-                {
-                    for ( org.apache.maven.model.Profile profile : currentProject.getModel().getProfiles() )
-                    {
-                        profileIds.remove( profile.getId() );
-
-                        if ( profileIds.isEmpty() )
-                        {
-                            return;
-                        }
-                    }
-
-                    currentProject = currentProject.getParent();
-                }
-                while ( currentProject != null );
-            }
-
-            for ( org.apache.maven.settings.Profile profile : session.getSettings().getProfiles() )
-            {
-                profileIds.remove( profile.getId() );
-            }
-
-            if ( profileIds.isEmpty() )
-            {
-                return;
-            }
-
-            StringBuilder sb = new StringBuilder();
-            if ( profileIds.size() > 1 )
-            {
-                sb.append( "The requested profiles don't exist: " );
-            }
-            else
-            {
-                sb.append( "The requested profile doesn't exist: " );
-            }
-            sb.append( StringUtils.join( profileIds.iterator(), ", " ) );
-
-            throw new EnforcerRuleException( sb.toString() );
-        }
-        catch ( ExpressionEvaluationException e )
-        {
-            throw new EnforcerRuleException( e.getMessage() );
-        }
-    }
-}
+/*
+ * 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.
+ */
+package org.apache.maven.plugins.enforcer;
+
+/*
+ * 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.
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
+import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException;
+import org.codehaus.plexus.util.StringUtils;
+
+/**
+ * Ensure that all profiles mentioned on the commandline do exist.
+ *
+ * @author Robert Scholte
+ * @author Gabriel Belingueres
+ */
+public class RequireProfileIdsExist extends AbstractNonCacheableEnforcerRule {
+    @Override
+    public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
+        try {
+            MavenSession session = (MavenSession) helper.evaluate("${session}");
+
+            List<String> profileIds = new ArrayList<>();
+            profileIds.addAll(session.getProjectBuildingRequest().getActiveProfileIds());
+            profileIds.addAll(session.getProjectBuildingRequest().getInactiveProfileIds());
+
+            for (MavenProject project : session.getProjects()) {
+                // iterate over all parents
+                MavenProject currentProject = project;
+                do {
+                    for (org.apache.maven.model.Profile profile :
+                            currentProject.getModel().getProfiles()) {
+                        profileIds.remove(profile.getId());
+
+                        if (profileIds.isEmpty()) {
+                            return;
+                        }
+                    }
+
+                    currentProject = currentProject.getParent();
+                } while (currentProject != null);
+            }
+
+            for (org.apache.maven.settings.Profile profile :
+                    session.getSettings().getProfiles()) {
+                profileIds.remove(profile.getId());
+            }
+
+            if (profileIds.isEmpty()) {
+                return;
+            }
+
+            StringBuilder sb = new StringBuilder();
+            if (profileIds.size() > 1) {
+                sb.append("The requested profiles don't exist: ");
+            } else {
+                sb.append("The requested profile doesn't exist: ");
+            }
+            sb.append(StringUtils.join(profileIds.iterator(), ", "));
+
+            throw new EnforcerRuleException(sb.toString());
+        } catch (ExpressionEvaluationException e) {
+            throw new EnforcerRuleException(e.getMessage());
+        }
+    }
+}
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireProperty.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireProperty.java
index b915475..5623009 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireProperty.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireProperty.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -25,56 +43,45 @@ import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluatio
 
 /**
  * This rule checks that certain properties are set.
- * 
+ *
  * @author Paul Gier
  */
-public class RequireProperty
-    extends AbstractPropertyEnforcerRule
-{
+public class RequireProperty extends AbstractPropertyEnforcerRule {
 
     /**
      * Specify the required property.
-     * 
+     *
      * @see {@link #setProperty(String)}
      * @see {@link #getPropertyName()}
      */
     private String property = null;
 
-    public final void setProperty( String property )
-    {
+    public final void setProperty(String property) {
         this.property = property;
     }
 
     @Override
-    public Object resolveValue( EnforcerRuleHelper helper )
-        throws EnforcerRuleException
-    {
+    public Object resolveValue(EnforcerRuleHelper helper) throws EnforcerRuleException {
         Object propValue = null;
-        try
-        {
-            propValue = helper.evaluate( "${" + property + "}" );
-        }
-        catch ( ExpressionEvaluationException eee )
-        {
-            throw new EnforcerRuleException( "Unable to evaluate property: " + property, eee );
+        try {
+            propValue = helper.evaluate("${" + property + "}");
+        } catch (ExpressionEvaluationException eee) {
+            throw new EnforcerRuleException("Unable to evaluate property: " + property, eee);
         }
         return propValue;
     }
 
-    protected String resolveValue()
-    {
+    protected String resolveValue() {
         return null;
     }
 
     @Override
-    public String getPropertyName()
-    {
+    public String getPropertyName() {
         return property;
     }
 
     @Override
-    public String getName()
-    {
+    public String getName() {
         return "Property";
     }
 }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireReleaseDeps.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireReleaseDeps.java
index 783b9b3..2d4989c 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireReleaseDeps.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireReleaseDeps.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -24,7 +42,6 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Optional;
 import java.util.Set;
-
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
@@ -38,16 +55,14 @@ import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluatio
  *
  * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
  */
-public class RequireReleaseDeps
-    extends AbstractBanDependencies
-{
+public class RequireReleaseDeps extends AbstractBanDependencies {
 
     /**
      * Allows this rule to execute only when this project is a release.
      *
      * @see {@link #setOnlyWhenRelease(boolean)}
      * @see {@link #isOnlyWhenRelease()}
-
+     *
      */
     private boolean onlyWhenRelease = false;
 
@@ -60,9 +75,9 @@ public class RequireReleaseDeps
     private boolean failWhenParentIsSnapshot = true;
 
     /**
-     * Dependencies to ignore when checking for release versions.  For example, inter-module dependencies 
+     * Dependencies to ignore when checking for release versions.  For example, inter-module dependencies
      * can be excluded from the check and therefore allowed to contain snapshot versions.
-     * 
+     *
      * @see {@link #setExcludes(List)}
      * @see {@link #getExcludes()}
      */
@@ -71,7 +86,7 @@ public class RequireReleaseDeps
     /**
      * Dependencies to include when checking for release versions.  If any of the included dependencies
      * have snapshot versions, the rule will fail.
-     * 
+     *
      * @see {@link #setIncludes(List)}
      * @see {@link #getIncludes()}
      */
@@ -79,47 +94,37 @@ public class RequireReleaseDeps
 
     // Override parent to allow optional ignore of this rule.
     @Override
-    public void execute( EnforcerRuleHelper helper )
-        throws EnforcerRuleException
-    {
+    public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
         boolean callSuper;
         MavenProject project = null;
-        if ( onlyWhenRelease )
-        {
+        if (onlyWhenRelease) {
             // get the project
-            project = getProject( helper );
+            project = getProject(helper);
 
             // only call super if this project is a release
             callSuper = !project.getArtifact().isSnapshot();
-        }
-        else
-        {
+        } else {
             callSuper = true;
         }
 
-        if ( callSuper )
-        {
-            super.execute( helper );
-            if ( failWhenParentIsSnapshot )
-            {
-                if ( project == null )
-                {
-                    project = getProject( helper );
+        if (callSuper) {
+            super.execute(helper);
+            if (failWhenParentIsSnapshot) {
+                if (project == null) {
+                    project = getProject(helper);
                 }
 
                 Artifact parentArtifact = project.getParentArtifact();
 
-                if ( parentArtifact != null )
-                {
-                    Set<Artifact> artifacts = filterArtifacts( Collections.singleton( parentArtifact ) );
-                    parentArtifact = Optional.ofNullable( artifacts )
-                        .flatMap( s -> s.stream().findFirst() )
-                        .orElse( null );
+                if (parentArtifact != null) {
+                    Set<Artifact> artifacts = filterArtifacts(Collections.singleton(parentArtifact));
+                    parentArtifact = Optional.ofNullable(artifacts)
+                            .flatMap(s -> s.stream().findFirst())
+                            .orElse(null);
                 }
 
-                if ( parentArtifact != null && parentArtifact.isSnapshot() )
-                {
-                    throw new EnforcerRuleException( "Parent Cannot be a snapshot: " + parentArtifact.getId() );
+                if (parentArtifact != null && parentArtifact.isSnapshot()) {
+                    throw new EnforcerRuleException("Parent Cannot be a snapshot: " + parentArtifact.getId());
                 }
             }
         }
@@ -130,115 +135,90 @@ public class RequireReleaseDeps
      * @return The evaluated {@link MavenProject}.
      * @throws EnforcerRuleException
      */
-    private MavenProject getProject( EnforcerRuleHelper helper )
-        throws EnforcerRuleException
-    {
-        try
-        {
-            return (MavenProject) helper.evaluate( "${project}" );
-        }
-        catch ( ExpressionEvaluationException eee )
-        {
-            throw new EnforcerRuleException( "Unable to retrieve the MavenProject: ", eee );
+    private MavenProject getProject(EnforcerRuleHelper helper) throws EnforcerRuleException {
+        try {
+            return (MavenProject) helper.evaluate("${project}");
+        } catch (ExpressionEvaluationException eee) {
+            throw new EnforcerRuleException("Unable to retrieve the MavenProject: ", eee);
         }
     }
 
     @Override
-    protected Set<Artifact> checkDependencies( Set<Artifact> dependencies, Log log )
-        throws EnforcerRuleException
-    {
+    protected Set<Artifact> checkDependencies(Set<Artifact> dependencies, Log log) throws EnforcerRuleException {
         Set<Artifact> foundSnapshots = new HashSet<>();
 
-        Set<Artifact> filteredDependencies = filterArtifacts( dependencies );
+        Set<Artifact> filteredDependencies = filterArtifacts(dependencies);
 
-        if ( filteredDependencies != null )
-        {
-            for ( Artifact artifact : filteredDependencies )
-            {
-                if ( artifact.isSnapshot() )
-                {
-                    foundSnapshots.add( artifact );
+        if (filteredDependencies != null) {
+            for (Artifact artifact : filteredDependencies) {
+                if (artifact.isSnapshot()) {
+                    foundSnapshots.add(artifact);
                 }
             }
         }
         return foundSnapshots;
     }
-    
+
     /*
      * Filter the dependency artifacts according to the includes and excludes
      * If includes and excludes are both null, the original set is returned.
-     * 
+     *
      * @param dependencies the list of dependencies to filter
      * @return the resulting set of dependencies
      */
-    protected Set<Artifact> filterArtifacts( Set<Artifact> dependencies ) throws EnforcerRuleException 
-    {
-        if ( includes == null && excludes == null )
-        {
+    protected Set<Artifact> filterArtifacts(Set<Artifact> dependencies) throws EnforcerRuleException {
+        if (includes == null && excludes == null) {
             return dependencies;
         }
-        
+
         Set<Artifact> included;
-        if ( includes != null )
-        {
-            included = ArtifactUtils.checkDependencies( dependencies, includes ); 
-        }
-        else
-        {
-            included = new HashSet<>( dependencies );
+        if (includes != null) {
+            included = ArtifactUtils.checkDependencies(dependencies, includes);
+        } else {
+            included = new HashSet<>(dependencies);
         }
 
         // anything specifically included should be removed
         // from the ban list.
-        if ( included != null )
-        {
-            Set<Artifact> excluded = ArtifactUtils.checkDependencies( dependencies, excludes );
+        if (included != null) {
+            Set<Artifact> excluded = ArtifactUtils.checkDependencies(dependencies, excludes);
 
-            if ( excluded != null )
-            {
-                included.removeAll( excluded );
+            if (excluded != null) {
+                included.removeAll(excluded);
             }
         }
         return included;
     }
 
-    public final boolean isOnlyWhenRelease()
-    {
+    public final boolean isOnlyWhenRelease() {
         return onlyWhenRelease;
     }
 
-    public final void setOnlyWhenRelease( boolean onlyWhenRelease )
-    {
+    public final void setOnlyWhenRelease(boolean onlyWhenRelease) {
         this.onlyWhenRelease = onlyWhenRelease;
     }
 
-    public final boolean isFailWhenParentIsSnapshot()
-    {
+    public final boolean isFailWhenParentIsSnapshot() {
         return failWhenParentIsSnapshot;
     }
 
-    public final void setFailWhenParentIsSnapshot( boolean failWhenParentIsSnapshot )
-    {
+    public final void setFailWhenParentIsSnapshot(boolean failWhenParentIsSnapshot) {
         this.failWhenParentIsSnapshot = failWhenParentIsSnapshot;
     }
-    
-    public final void setExcludes( List<String> excludes )
-    {
+
+    public final void setExcludes(List<String> excludes) {
         this.excludes = excludes;
     }
-    
-    public final List<String> getExcludes()
-    {
+
+    public final List<String> getExcludes() {
         return excludes;
     }
-    
-    public void setIncludes( List<String> includes )
-    {
+
+    public void setIncludes(List<String> includes) {
         this.includes = includes;
     }
-    
-    public List<String> getIncludes()
-    {
+
+    public List<String> getIncludes() {
         return includes;
     }
 }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireReleaseVersion.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireReleaseVersion.java
index fd6c6fd..91d0b2b 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireReleaseVersion.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireReleaseVersion.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -30,47 +48,39 @@ import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluatio
  *
  * @author <a href="mailto:brianf@apache.org">Brian Fox</a>
  */
-public class RequireReleaseVersion
-    extends AbstractNonCacheableEnforcerRule
-{
+public class RequireReleaseVersion extends AbstractNonCacheableEnforcerRule {
 
     /**
      * Allows this rule to fail when the parent is defined as a snapshot.
      *
      * @parameter
-     * 
+     *
      * @see {@link #setFailWhenParentIsSnapshot(boolean)}
      * @see {@link #isFailWhenParentIsSnapshot()}
      */
     private boolean failWhenParentIsSnapshot = true;
 
     @Override
-    public void execute( EnforcerRuleHelper theHelper )
-        throws EnforcerRuleException
-    {
+    public void execute(EnforcerRuleHelper theHelper) throws EnforcerRuleException {
 
-        MavenProject project = getProject( theHelper );
+        MavenProject project = getProject(theHelper);
 
-        if ( project.getArtifact().isSnapshot() )
-        {
+        if (project.getArtifact().isSnapshot()) {
             String message = getMessage();
             StringBuilder buf = new StringBuilder();
-            if ( message != null )
-            {
-                buf.append( message ).append( System.lineSeparator() );
+            if (message != null) {
+                buf.append(message).append(System.lineSeparator());
             }
-            buf.append( "This project cannot be a snapshot:" ).append( project.getArtifact().getId() );
-            throw new EnforcerRuleException( buf.toString() );
+            buf.append("This project cannot be a snapshot:")
+                    .append(project.getArtifact().getId());
+            throw new EnforcerRuleException(buf.toString());
         }
-        if ( failWhenParentIsSnapshot )
-        {
+        if (failWhenParentIsSnapshot) {
             Artifact parentArtifact = project.getParentArtifact();
-            if ( parentArtifact != null && parentArtifact.isSnapshot() )
-            {
-                throw new EnforcerRuleException( "Parent Cannot be a snapshot: " + parentArtifact.getId() );
+            if (parentArtifact != null && parentArtifact.isSnapshot()) {
+                throw new EnforcerRuleException("Parent Cannot be a snapshot: " + parentArtifact.getId());
             }
         }
-
     }
 
     /**
@@ -78,26 +88,19 @@ public class RequireReleaseVersion
      * @return The evaluated {@link MavenProject}.
      * @throws EnforcerRuleException
      */
-    private MavenProject getProject( EnforcerRuleHelper helper )
-        throws EnforcerRuleException
-    {
-        try
-        {
-            return (MavenProject) helper.evaluate( "${project}" );
-        }
-        catch ( ExpressionEvaluationException eee )
-        {
-            throw new EnforcerRuleException( "Unable to retrieve the MavenProject: ", eee );
+    private MavenProject getProject(EnforcerRuleHelper helper) throws EnforcerRuleException {
+        try {
+            return (MavenProject) helper.evaluate("${project}");
+        } catch (ExpressionEvaluationException eee) {
+            throw new EnforcerRuleException("Unable to retrieve the MavenProject: ", eee);
         }
     }
 
-    public final boolean isFailWhenParentIsSnapshot()
-    {
+    public final boolean isFailWhenParentIsSnapshot() {
         return failWhenParentIsSnapshot;
     }
 
-    public final void setFailWhenParentIsSnapshot( boolean failWhenParentIsSnapshot )
-    {
+    public final void setFailWhenParentIsSnapshot(boolean failWhenParentIsSnapshot) {
         this.failWhenParentIsSnapshot = failWhenParentIsSnapshot;
     }
 }
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireSameVersions.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireSameVersions.java
index d50caba..c0b0f46 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireSameVersions.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireSameVersions.java
@@ -1,131 +1,133 @@
-package org.apache.maven.plugins.enforcer;
-
-/*
- * 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.
- */
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.regex.Pattern;
-
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
-import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
-import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException;
-
-/**
- * @author Robert Scholte
- * @since 1.3
- */
-public class RequireSameVersions
-    extends AbstractNonCacheableEnforcerRule
-{
-    private boolean uniqueVersions;
-
-    private Set<String> dependencies = new HashSet<>();
-
-    private Set<String> plugins = new HashSet<>();
-
-    private Set<String> buildPlugins = new HashSet<>();
-
-    private Set<String> reportPlugins = new HashSet<>();
-
-    @Override
-    public void execute( EnforcerRuleHelper helper )
-        throws EnforcerRuleException
-    {
-        // get the project
-        MavenProject project;
-        try
-        {
-            project = (MavenProject) helper.evaluate( "${project}" );
-        }
-        catch ( ExpressionEvaluationException eee )
-        {
-            throw new EnforcerRuleException( "Unable to retrieve the MavenProject: ", eee );
-        }
-
-        // consider including profile based artifacts
-        Map<String, List<String>> versionMembers = new LinkedHashMap<>();
-
-        Set<String> buildPluginSet = new HashSet<>( buildPlugins );
-        buildPluginSet.addAll( plugins );
-        Set<String> reportPluginSet = new HashSet<>( reportPlugins );
-        reportPluginSet.addAll( plugins );
-
-        // CHECKSTYLE_OFF: LineLength
-        versionMembers.putAll( collectVersionMembers( project.getArtifacts(), dependencies, " (dependency)" ) );
-        versionMembers.putAll( collectVersionMembers( project.getPluginArtifacts(), buildPlugins, " (buildPlugin)" ) );
-        versionMembers.putAll( collectVersionMembers( project.getReportArtifacts(), reportPlugins, " (reportPlugin)" ) );
-        // CHECKSTYLE_ON: LineLength
-
-        if ( versionMembers.size() > 1 )
-        {
-            StringBuilder builder = new StringBuilder( "Found entries with different versions"
-                + System.lineSeparator() );
-            for ( Map.Entry<String, List<String>> entry : versionMembers.entrySet() )
-            {
-                builder.append( "Entries with version " ).append( entry.getKey() ).append( System.lineSeparator() );
-                for ( String conflictId : entry.getValue() )
-                {
-                    builder.append( "- " ).append( conflictId ).append( System.lineSeparator() );
-                }
-            }
-            throw new EnforcerRuleException( builder.toString() );
-        }
-    }
-
-    private Map<String, List<String>> collectVersionMembers( Set<Artifact> artifacts, Collection<String> patterns,
-                                                             String source )
-    {
-        Map<String, List<String>> versionMembers = new LinkedHashMap<>();
-
-        List<Pattern> regExs = new ArrayList<>();
-        for ( String pattern : patterns )
-        {
-            String regex = pattern.replace( ".", "\\." ).replace( "*", ".*" ).replace( ":", "\\:" ).replace( '?', '.' );
-
-            // pattern is groupId[:artifactId[:type[:classifier]]]
-            regExs.add( Pattern.compile( regex + "(\\:.+)?" ) );
-        }
-
-        for ( Artifact artifact : artifacts )
-        {
-            for ( Pattern regEx : regExs )
-            {
-                if ( regEx.matcher( artifact.getDependencyConflictId() ).matches() )
-                {
-                    String version = uniqueVersions ? artifact.getVersion() : artifact.getBaseVersion();
-                    if ( !versionMembers.containsKey( version ) )
-                    {
-                        versionMembers.put( version, new ArrayList<String>() );
-                    }
-                    versionMembers.get( version ).add( artifact.getDependencyConflictId() + source );
-                }
-            }
-        }
-        return versionMembers;
-    }
-
-}
+/*
+ * 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.
+ */
+package org.apache.maven.plugins.enforcer;
+
+/*
+ * 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.
+ */
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Pattern;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
+import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException;
+
+/**
+ * @author Robert Scholte
+ * @since 1.3
+ */
+public class RequireSameVersions extends AbstractNonCacheableEnforcerRule {
+    private boolean uniqueVersions;
+
+    private Set<String> dependencies = new HashSet<>();
+
+    private Set<String> plugins = new HashSet<>();
+
+    private Set<String> buildPlugins = new HashSet<>();
+
+    private Set<String> reportPlugins = new HashSet<>();
+
+    @Override
+    public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
+        // get the project
+        MavenProject project;
+        try {
+            project = (MavenProject) helper.evaluate("${project}");
+        } catch (ExpressionEvaluationException eee) {
+            throw new EnforcerRuleException("Unable to retrieve the MavenProject: ", eee);
+        }
+
+        // consider including profile based artifacts
+        Map<String, List<String>> versionMembers = new LinkedHashMap<>();
+
+        Set<String> buildPluginSet = new HashSet<>(buildPlugins);
+        buildPluginSet.addAll(plugins);
+        Set<String> reportPluginSet = new HashSet<>(reportPlugins);
+        reportPluginSet.addAll(plugins);
+
+        // CHECKSTYLE_OFF: LineLength
+        versionMembers.putAll(collectVersionMembers(project.getArtifacts(), dependencies, " (dependency)"));
+        versionMembers.putAll(collectVersionMembers(project.getPluginArtifacts(), buildPlugins, " (buildPlugin)"));
+        versionMembers.putAll(collectVersionMembers(project.getReportArtifacts(), reportPlugins, " (reportPlugin)"));
+        // CHECKSTYLE_ON: LineLength
+
+        if (versionMembers.size() > 1) {
+            StringBuilder builder = new StringBuilder("Found entries with different versions" + System.lineSeparator());
+            for (Map.Entry<String, List<String>> entry : versionMembers.entrySet()) {
+                builder.append("Entries with version ").append(entry.getKey()).append(System.lineSeparator());
+                for (String conflictId : entry.getValue()) {
+                    builder.append("- ").append(conflictId).append(System.lineSeparator());
+                }
+            }
+            throw new EnforcerRuleException(builder.toString());
+        }
+    }
+
+    private Map<String, List<String>> collectVersionMembers(
+            Set<Artifact> artifacts, Collection<String> patterns, String source) {
+        Map<String, List<String>> versionMembers = new LinkedHashMap<>();
+
+        List<Pattern> regExs = new ArrayList<>();
+        for (String pattern : patterns) {
+            String regex = pattern.replace(".", "\\.")
+                    .replace("*", ".*")
+                    .replace(":", "\\:")
+                    .replace('?', '.');
+
+            // pattern is groupId[:artifactId[:type[:classifier]]]
+            regExs.add(Pattern.compile(regex + "(\\:.+)?"));
+        }
+
+        for (Artifact artifact : artifacts) {
+            for (Pattern regEx : regExs) {
+                if (regEx.matcher(artifact.getDependencyConflictId()).matches()) {
+                    String version = uniqueVersions ? artifact.getVersion() : artifact.getBaseVersion();
+                    if (!versionMembers.containsKey(version)) {
+                        versionMembers.put(version, new ArrayList<String>());
+                    }
+                    versionMembers.get(version).add(artifact.getDependencyConflictId() + source);
+                }
+            }
+        }
+        return versionMembers;
+    }
+}
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireSnapshotVersion.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireSnapshotVersion.java
index a631d2a..bdbd651 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireSnapshotVersion.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireSnapshotVersion.java
@@ -1,3 +1,21 @@
+/*
+ * 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.
+ */
 package org.apache.maven.plugins.enforcer;
 
 /*
@@ -28,9 +46,7 @@ import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluatio
 /**
  * This rule checks that the current project is not a release.
  */
-public class RequireSnapshotVersion
-    extends AbstractNonCacheableEnforcerRule
-{
+public class RequireSnapshotVersion extends AbstractNonCacheableEnforcerRule {
 
     /**
      * Allows this rule to fail when the parent is defined as a release.
@@ -38,58 +54,43 @@ public class RequireSnapshotVersion
     private boolean failWhenParentIsRelease = true;
 
     @Override
-    public void execute( EnforcerRuleHelper helper )
-        throws EnforcerRuleException
-    {
+    public void execute(EnforcerRuleHelper helper) throws EnforcerRuleException {
 
-        MavenProject project = getProject( false, helper );
+        MavenProject project = getProject(false, helper);
         Artifact artifact = project.getArtifact();
 
-        if ( !artifact.isSnapshot() )
-        {
+        if (!artifact.isSnapshot()) {
             String message = getMessage();
             StringBuilder sb = new StringBuilder();
-            if ( message != null )
-            {
-                sb.append( message ).append( System.lineSeparator() );
+            if (message != null) {
+                sb.append(message).append(System.lineSeparator());
             }
-            sb.append( "This project cannot be a release:" ).append( artifact.getId() );
-            throw new EnforcerRuleException( sb.toString() );
+            sb.append("This project cannot be a release:").append(artifact.getId());
+            throw new EnforcerRuleException(sb.toString());
         }
-        if ( failWhenParentIsRelease && project.hasParent() )
-        {
+        if (failWhenParentIsRelease && project.hasParent()) {
             // project.getParentArtifact() does not work here if a "CI Friendly Version" is used (e.g. ${revision})
-            Artifact parentArtifact = getProject( true, helper ).getArtifact();
-            if ( parentArtifact != null && !parentArtifact.isSnapshot() )
... 13884 lines suppressed ...