michael-o commented on a change in pull request #6:
URL: https://github.com/apache/maven-clean-plugin/pull/6#discussion_r771452123
##########
File path: src/main/java/org/apache/maven/plugins/clean/Cleaner.java
##########
@@ -115,9 +135,102 @@ public void delete( File basedir, Selector selector,
boolean followSymlinks, boo
File file = followSymlinks ? basedir : basedir.getCanonicalFile();
+ if ( selector == null && !followSymlinks && fastDir != null )
+ {
+ // If anything wrong happens, we'll just use the usual deletion
mechanism
+ if ( fastDelete( file ) )
+ {
+ return;
+ }
+ }
+
delete( file, "", selector, followSymlinks, failOnError, retryOnError
);
}
+ private boolean fastDelete( File baseDir )
+ {
+ // Handle the case where we use
${maven.multiModuleProjectDirectory}/target/.clean for example
+ if ( fastDir.getAbsolutePath().startsWith( baseDir.getAbsolutePath() )
)
Review comment:
It will, since it will compare according to the semantics of the
underyling FS/OS. Case, separators, etc.
--
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]