maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Plamen Totev <>
Subject Plexus Archiver handling of symbolic links on Windows
Date Tue, 13 Jun 2017 05:25:34 GMT

There is discussion on Plexus Archiver about symbolic links and
Windows[1]. Currently if a file set is added to an archive and the OS
is Windows the symbolic links are followed. That is, instead of the
symbolic links, the resulting archive contains the files they point
to. For some time Java was not able to work with symbolic links on
Windows, but that is no longer the case. Windows supports symbolic
links since Vista and if you have the required permissions Java works
perfectly fine with the them.

There is proposal to change the default behavior of Plexus Archiver -
to make it consistent across the OSes and to not follow the symbolic
links when a file set is added to an archive. Then regardless of the
OS, the resulting archive will contain the symbolic links and not
copies of the files they point to.

I have two concerns about that.

The first one is the path separator. A symbolic links on Windows will
look something like `src\fileR.txt`. When the archive is extracted on
Linux the symbolic link will be broken. It will point to the
`src\fileR.txt` file (a perfectly valid name for a file on Linux) and
not to the `fileR.txt` file inside the `src` directory. So I think we
should normalize the paths on Windows. The link added should point to
`src/fileR.txt`. I think this will work both on Windows and Linux, but
I'm not 100% sure. Would be great if somebody with more experience on
the matter could confirm that.

My second concern is the effect that this change will have on Maven
plug-ins such as the Assembly plug-in. Imagine a project that creates
a distribution package and one of the directories contains some
symbolic links. With the current implementation if the package is
created on Windows, it will contains duplicated files. In many cases
that could be a desired behavior. By default you have to be admin user
to create symbolic links and many tools on Windows does not support
symbolic links. Including some (if not most) of the popular archivers.
If we change the Plexus Archiver default behavior we may broke
projects like this one. The resulting Windows package will contain
symbolic links but this may result in poor user experience as many
archive programs will no handle it properly. What do you think? Will
such a change in the Plexus Archive break projects or my concern is
undue? Probably the benefits of having consistent behavior on all OSes
are worth taking the risk?

What do you think? Do you have any other concerns related to the
support of symbolic links on Windows.

Plamen Totev

p.s. Microsoft is trying to improve the support for symbolic links.
The Windows 10 Creators update will contain some improvements that
will allow non-admin users to create symbolic links and Microsoft is
"working with the owners of open-source community tools such as Git
and npm so they know symlink improvements are coming and can make the
necessary changes to better support symlinks on Windows" [2].


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message