bpfoster commented on code in PR #344:
URL: https://github.com/apache/maven-enforcer/pull/344#discussion_r1913555252


##########
maven-enforcer-plugin/src/it/projects/cli-banned-plugins/pom.xml:
##########
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+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.
+-->
+
+<project>
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.its.enforcer</groupId>
+  <artifactId>test</artifactId>
+  <version>1.0</version>
+
+  <description>
+  </description>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>build-helper-maven-plugin</artifactId>
+        <version>3.6.0</version>
+        <executions>
+          <execution>
+            <id>local-ip</id>
+            <goals>
+              <goal>local-ip</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-enforcer-plugin</artifactId>
+        <version>@project.version@</version>
+        <executions>
+          <execution>
+            <id>test</id>
+            <goals>
+              <goal>enforce</goal>
+            </goals>

Review Comment:
   Thanks for the review, and good suggestion.  This highlighted some issues 
with the integration test as I had it.
   
   MENFORCER-516 specifically targets executing the enforcer via `mvn 
enforcer:enforce` so I have updated the invoker to run as such.
   In this case, the configuration inside an `execution` is not attached unless 
you specify the execution id (`mvn enforcer:enforce@test`), so the 
configuration must be moved up from the execution-level to the plugin-level.  
While this makes sense, it could be a little bit confusing.  Should I add some 
verbiage to the `rules` javadoc in `EnforceMojo` to try and explain this?
   
   | command | Configuration at plugin | Configuration at execution |
   | --- | --- | --- |
   | `mvn enforcer:enforce -Drules=SomeRule` | Configuration applied 
:heavy_check_mark:  | Configuration ignored :x:  |
   | `mvn enforcer:enforce@execution-ID -Drules=SomeRule` | Configuration 
applied :heavy_check_mark:  | Configuration applied :heavy_check_mark: |



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to