[ 
https://issues.apache.org/jira/browse/MCLEAN-124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17896187#comment-17896187
 ] 

Peter De Maeyer commented on MCLEAN-124:
----------------------------------------

I created a PR for this, leveraging Java 7's new {{Files}} + {{Path}} API over 
the old {{File}} API.
I also added a JUnit test covering the new code (changed lines) for 100%.

Future improvements, out of scope for this issue:
* For this issue, I limited the use of the {{Files}} + {{Path}} API to this 
very specific bit of code. It would be an improvement to migrate _all_ the code 
away from the legacy {{File}} API to the new {{Files}} + {{Path}} API. Not just 
for the Clean plugin, but for all Maven plugins.
* Re-evaluate the need for the retries and especially the {{Thread.sleep}} in 
the {{Cleaner}} class. Expecting that those who introduced it would have 
written a test to illustrate the use case, I temporarily removed the 
{{Thread.sleep}} to see which test would fail, which would give me an 
indication of why the code needs to be there, but all tests just passed. So I'm 
still clueless why that hack was introduced in the first place.

> Provide more accurate reason when can not delete a resource
> -----------------------------------------------------------
>
>                 Key: MCLEAN-124
>                 URL: https://issues.apache.org/jira/browse/MCLEAN-124
>             Project: Maven Clean Plugin
>          Issue Type: Improvement
>            Reporter: Slawomir Jaranowski
>            Priority: Major
>
> Currently we have only in stack trace something like:
> {noformat}
> Caused by: java.io.IOException: Failed to delete 
> /Users/runner/work/maven-surefire/maven-surefire/surefire-its/target
>     at org.apache.maven.plugins.clean.Cleaner.delete (Cleaner.java:300)
>     at org.apache.maven.plugins.clean.Cleaner.delete (Cleaner.java:250)
>     at org.apache.maven.plugins.clean.Cleaner.delete (Cleaner.java:124)
> {noformat}
> It will be usable if we have reported a reason ... why can not be deleted



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to