Copilot commented on code in PR #639:
URL: https://github.com/apache/maven-war-plugin/pull/639#discussion_r3653185691


##########
src/main/java/org/apache/maven/plugins/war/packaging/OverlayPackagingTask.java:
##########
@@ -127,4 +134,76 @@ protected File getOverlayTempDirectory(WarPackagingContext 
context, Overlay over
         }
         return result;
     }
+
+    /**
+     * Removes jars from the overlay's {@code WEB-INF/lib} that conflict with 
the project's managed
+     * dependencies. When a project uses dependencyManagement to pin a 
version, any jar from the
+     * overlay with the same artifactId but a different version is removed, 
ensuring only the
+     * dependency-managed version ends up in {@code WEB-INF/lib}.
+     *

Review Comment:
   The JavaDoc states that only overlay JARs with the same artifactId but a 
*different version* are removed and that this is specifically about 
dependencyManagement. The implementation currently removes any overlay JAR 
whose artifactId matches a resolved runtime project dependency, regardless of 
version and regardless of whether it was managed. Either align the 
implementation with the JavaDoc/PR description, or adjust the JavaDoc to 
reflect what the code actually does.
   
   This issue also appears on line 174 of the same file.



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