As the target is set to Java 1.6, I chose to work with Commandline to
create and remove the symlink.
Will need to move to java.nio.file.Files.createSymbolicLink() when
target moves to 1.7.
Link created as late as possible, removed as early as possible. Removing
/Application symlink with java code ignorant of links (e.g. by some other plugin)
could result in targeted contents being removed and thus be disastrous to the user.
maven-clean-plugin does check symlinks and not removing targeted
contents, however we can't guarantee for all the plugins the user might use.
Better safe and ugly than hated.
Changeset pertains to following issue: https://github.com/federkasten/appbundle-maven-plugin/issues/16
As the target is set to Java 1.6, I chose to work with Commandline to create and remove the symlink. Will need to move to java.nio.file.Files.createSymbolicLink() when target moves to 1.7.
Link created as late as possible, removed as early as possible. Removing /Application symlink with java code ignorant of links (e.g. by some other plugin) could result in targeted contents being removed and thus be disastrous to the user.
maven-clean-plugin does check symlinks and not removing targeted contents, however we can't guarantee for all the plugins the user might use. Better safe and ugly than hated.