Configuration parameter for deleting read-only files#250
Merged
desruisseaux merged 3 commits intoapache:masterfrom Jun 21, 2025
Merged
Configuration parameter for deleting read-only files#250desruisseaux merged 3 commits intoapache:masterfrom
desruisseaux merged 3 commits intoapache:masterfrom
Conversation
…arameter.
* Replace <code>...</code> by {@code ...}.
* Replace </br> by <p>...</p>
Also remove the sentence in `followSymlink` saying that "Not following symlinks requires more IO operations and heap memory,
regardless whether symlinks are actually present. So projects with a huge output directory that knowingly does not contain
symlinks can improve performance by setting this parameter to true." This implementation details may not be true anymore,
especially after migration to `FileVisitor` which handles symlinks itself.
Contributor
Author
Member
Contributor
Author
|
Right, #246 is filled against 3.x and indeed would be a separated PR. |
Comment on lines
+22
to
+25
| if (new File(basedir, "target").exists()) { | ||
| System.out.println("target should have been deleted."); | ||
| return false; | ||
| } |
Member
There was a problem hiding this comment.
With groovy it can be simplified as:
assert !new File(basedir, "target").exists() : 'target should have been deleted.'
slawekjaranowski
approved these changes
May 4, 2025
Member
|
It will be more difficult to beckport it to 3.x ... @desruisseaux can you try it ... |
Contributor
Author
|
I will try to port to 3.x tomorrow. It will be partially a different development because 4.0 is based on |
desruisseaux
added a commit
to Geomatys/maven-clean-plugin
that referenced
this pull request
May 14, 2025
Contributor
Author
|
Ported this pull request to the 3.x branch in #252. |
…stead of considering the delete operation as a failure. This is relevant only if some process is running in same time as `maven-clean-plugin` and that process is also deleting files.
slawekjaranowski
pushed a commit
that referenced
this pull request
May 27, 2025
Contributor
Author
|
The port of this pull request has been merged on the 3.x branch one month ago and seems to work. Therefore, I presume that we can merge on master as well. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a
forceconfiguration option for deleting read-only files and directories. This is required becausejava.nio.file.Files.deletedoes not remove the read-only attribute, contrarily tojava.io.File.delete. Note: the 3.4.0 version of the clean plugin, which was usingjava.io.File, may also not work anymore with read-only files starting with Java 25 if JDK-8355954 is fixed. Therefore, some action other than reverting commits is necessary.An open question is whether the plugin should delete read-only files by default, or only if the user requested it. The latter is more conservative and is the standard behaviour of Unix commands such as
rm. Furthermore, JDK-8355954 suggests that silent deletion of read-only files was an unintended bug rather than a feature.