tiagobento commented on code in PR #6687:
URL: 
https://github.com/apache/incubator-kie-drools/pull/6687#discussion_r3162698748


##########
drools-test-coverage/test-suite/pom.xml:
##########
@@ -180,6 +190,27 @@
     </dependency>
   </dependencies>
 
+  <build>
+    <plugins>
+      <!-- The tests in this module use generated KJARs stored under 
src/test/resources/kjar.
+           They are produced by the drools-test-coverage-jars setup/profile 
when missing, and
+           must be removed by clean to avoid reusing stale artifacts between 
builds. -->
+      <plugin>
+        <artifactId>maven-clean-plugin</artifactId>
+        <configuration>
+          <filesets>
+            <fileset>
+              <directory>src/test/resources/kjar</directory>
+              <includes>
+                <include>*.jar</include>
+              </includes>
+            </fileset>
+          </filesets>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>

Review Comment:
   Thanks for addressing that as well.



##########
drools-test-coverage/test-suite/pom.xml:
##########
@@ -47,6 +47,11 @@
         <type>pom</type>
         <version>${project.version}</version>
       </dependency>
+      <dependency>
+        <groupId>org.kie</groupId>
+        <artifactId>kie-maven-plugin</artifactId>
+        <version>${project.version}</version>
+      </dependency>

Review Comment:
   Do we really need this here? Isn't this modules managed in any BOM? 



##########
build-parent/pom.xml:
##########
@@ -1464,6 +1464,10 @@
                       <ignoreClass>org.xmlpull.v1.XmlPullParser</ignoreClass>
                       <!-- Bundled by both com.sun:tools and 
com.sun.xml.bind:jaxb-xjc. No easy way to exclude one of them. -->
                       <ignoreClass>org.relaxng.datatype.*</ignoreClass>
+                      <!-- Old Eclipse Aether classes bundled in 
maven-artifact-transfer that conflict with maven-resolver-util -->
+                      <!-- maven-artifact-transfer is deprecated but still 
used by kie-maven-plugin -->
+                      <ignoreClass>org.eclipse.aether.util.*</ignoreClass>
+                      <ignoreClass>org.eclipse.aether.artifact.*</ignoreClass>

Review Comment:
   I think I found a way to avoid this problem.
   
   If we add 
   
   ```
     <build>
       <plugins>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-surefire-plugin</artifactId>
           <dependencies>
             <dependency>
               <groupId>org.kie</groupId>
               <artifactId>kie-maven-plugin</artifactId>
               <version>${project.version}</version>
             </dependency>
           </dependencies>
         </plugin>
       </plugins>
     </build>
   ```
   
   to `drools-test-coverage/test-suite/pom.xml` instead of declaring it as a 
<scope>test</scope> dependency, the Maven reactor will understand that 
`org.kie:kie-maven-plugin` is a dependency of that plugin execution (which is 
true!), and the build order will be fixed.
   
   Doing it like that won't pollute the classpath during compilation, which 
will not trigger this enforcer rule.
   
   I did a quick test locally and it worked.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to