GitHub user mkarg opened a pull request:
https://github.com/apache/maven-shared/pull/12
bug fix: silently fails overwriting symlinks
When A is an existing symlink to B, then createSymbolicLink(A,C) does
neither overwrite A->B by A->C (as expected in analogy to the behavior
of copy(A,C)) nor does it throw an exception nor does it return A->B to
indicate the failure, but it actually "silently fails", i. e. it returns
A->C!
This certainly is heavily problematic, unsymmetric to what
copy(File,File) and Files.createSymbolicLink(Path,Path) do, and
certainly unwanted and buggy behavior.
The solution is to delete any existing target before creating the
symlic, hence copying the behavior of copy(File,File).
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/headcrashing/maven-shared
bugfix-overwrite-symlink
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/maven-shared/pull/12.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #12
----
commit a74d7f612134097408096369c448a87845ca0d2f
Author: Markus KARG <[email protected]>
Date: 2016-06-14T22:23:58Z
bug fix: silently fails overwriting symlinks
When A is an existing symlink to B, then createSymbolicLink(A,C) does
neither overwrite A->B by A->C (as expected in analogy to the behavior
of copy(A,C)) nor does it throw an exception nor does it return A->B to
indicate the failure, but it actually "silently fails", i. e. it returns
A->C!
This certainly is heavily problematic, unsymmetric to what
copy(File,File) and Files.createSymbolicLink(Path,Path) do, and
certainly unwanted and buggy behavior.
The solution is to delete any existing target before creating the
symlic, hence copying the behavior of copy(File,File).
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]