gnodet-bot commented on code in PR #455:
URL: 
https://github.com/apache/maven-install-plugin/pull/455#discussion_r4087631200


##########
src/it/MINSTALL-205/setup.groovy:
##########
@@ -0,0 +1,29 @@
+/*
+ * 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.*;
+
+// Clean up artifacts installed by previous runs
+File group = new File( localRepositoryPath, 
"org/apache/maven/its/install/minstall205" );
+if ( group.exists() ) {
+    group.eachFileRecurse { it.delete() }
+    group.delete()

Review Comment:
   ⚠️ **Broken cleanup:** `eachFileRecurse { it.delete() }` visits *files only* 
— it does not recurse into subdirectories to delete them. After deleting the 
leaf JAR/POM files, the nested dirs (`external-module1/1.0/`, 
`external-module2/1.0/`, etc.) remain, and `group.delete()` will silently do 
nothing (non-empty directory). On a second IT run the leftover dirs won't 
affect correctness (the files are gone), but it leaves garbage in the local 
repo and diverges from every other `setup.groovy` in this project, all of which 
use `FileUtils.deleteDirectory()`.
   
   ```suggestion
       FileUtils.deleteDirectory( group )
   ```
   
   You'll need to add the import at the top (already present in most other IT 
setups):
   ```
   import org.codehaus.plexus.util.*;
   ```



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