Steven Schlansker opened MSHARED-581 and commented
I have a file shared between multiple projects via symlink:
-rw-r--r-- 1 steven staff 149 Mar 30 16:56 client/src/test/resources/simplelogger.properties
lrwxr-xr-x 1 steven staff 64 Oct 16 2014 integration-tests/jersey-client/src/test/resources/simplelogger.properties -> ../../../../../client/src/test/resources/simplelogger.properties
lrwxr-xr-x 1 steven staff 64 Oct 16 2014 integration-tests/resteasy-client/src/test/resources/simplelogger.properties -> ../../../../../client/src/test/resources/simplelogger.properties
This works fine from a clean build, but on an incremental build, it fails:
Caused by: org.apache.maven.plugin.MojoExecutionException: /Users/steven/ot-code/service-discovery/integration-tests/jersey-client/target/test-classes/simplelogger.properties
at org.apache.maven.plugins.resources.ResourcesMojo.execute(ResourcesMojo.java:348)
at org.apache.maven.plugins.resources.TestResourcesMojo.execute(TestResourcesMojo.java:75)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 20 more
Caused by: org.apache.maven.shared.filtering.MavenFilteringException: /Users/steven/ot-code/service-discovery/integration-tests/jersey-client/target/test-classes/simplelogger.properties
at org.apache.maven.shared.filtering.DefaultMavenFileFilter.copyFile(DefaultMavenFileFilter.java:128)
at org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering.filterResources(DefaultMavenResourcesFiltering.java:232)
at org.apache.maven.plugins.resources.ResourcesMojo.execute(ResourcesMojo.java:342)
... 23 more
Caused by: java.nio.file.FileAlreadyExistsException: /Users/steven/ot-code/service-discovery/integration-tests/jersey-client/target/test-classes/simplelogger.properties
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:88)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.createSymbolicLink(UnixFileSystemProvider.java:457)
at java.nio.file.Files.createSymbolicLink(Files.java:1043)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.shared.utils.io.Java7Support.createSymbolicLink(Java7Support.java:176)
at org.apache.maven.shared.utils.io.FileUtils.copyFile(FileUtils.java:821)
at org.apache.maven.shared.utils.io.FileUtils.copyFile(FileUtils.java:1939)
at org.apache.maven.shared.filtering.DefaultMavenFileFilter.copyFile(DefaultMavenFileFilter.java:121)
... 25 more
Perhaps FileUtils.copyFile should not attempt to copy over an existing symlink? It should leave it be if the target is the same, otherwise unlink it first.
Affects: maven-shared-utils-3.0.0, maven-filtering-3.1.1
Steven Schlansker opened MSHARED-581 and commented
I have a file shared between multiple projects via symlink:
This works fine from a clean build, but on an incremental build, it fails:
Perhaps
FileUtils.copyFileshould not attempt to copy over an existing symlink? It should leave it be if the target is the same, otherwise unlink it first.Affects: maven-shared-utils-3.0.0, maven-filtering-3.1.1