[MENFORCER-320] - RequireProfileIdsExist check fails if no profiles have been specified
authorAlex Shesterov <alex.shesterov@gmail.com>
Fri, 5 Oct 2018 13:29:18 +0000 (15:29 +0200)
committerKarl Heinz Marbaise <khmarbaise@apache.org>
Sat, 6 Oct 2018 11:13:39 +0000 (13:13 +0200)
 - RequireProfileIdsExist check must not fail if there are no profiles
   in the pom.xml and no profiles have been specified in the command line
 - fix site: breadcrumbs on the "requireProfileIdsExist" page.

enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireProfileIdsExist.java
enforcer-rules/src/site/apt/requireProfileIdsExist.apt.vm

index 9a16546..770f644 100644 (file)
@@ -64,13 +64,13 @@ public class RequireProfileIdsExist extends AbstractNonCacheableEnforcerRule
             for ( org.apache.maven.settings.Profile profile : session.getSettings().getProfiles() )\r
             {\r
                 profileIds.remove( profile.getId() );\r
-                \r
-                if ( profileIds.isEmpty() )\r
-                {\r
-                    return;\r
-                }\r
             }\r
-            \r
+\r
+            if ( profileIds.isEmpty() )\r
+            {\r
+                return;\r
+            }\r
+\r
             StringBuilder sb = new StringBuilder();\r
             if ( profileIds.size() > 1 )\r
             {\r
index 8da72a4..49e84ac 100644 (file)
@@ -16,7 +16,7 @@
  ~~ under the License.\r
 \r
  -----\r
- Require Upper Bound Dependencies\r
+ Require Existence of Profiles Specified on the Commandline\r
  -----\r
  -----\r
  2017-09-25\r