You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Thorsten Glaser (JIRA)" <ji...@apache.org> on 2018/09/13 14:41:00 UTC

[jira] [Commented] (MRESOURCES-237) Resource plugin's handling of symbolic links changed in 3.0.x, broke existing behavior

    [ https://issues.apache.org/jira/browse/MRESOURCES-237?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16613582#comment-16613582 ] 

Thorsten Glaser commented on MRESOURCES-237:
--------------------------------------------

+1, I just lost about two hours debugging an application initialisation failure because a file was not copied to a JAR inside a WAR… turns out that an upgrade of maven-resources-plugin in the parent POM (from 2.6 to 3.0.2… I wonder if we should go to 3.1.0 even) broke this: the symlink (instead of its target, as before) is copied from {{src/main/resources/FOO}} to {{target/classes/FOO}} breaking relative link targets, and then it’s omitted from the JAR because it’s a broken symlink. (In my scenario, this does not affect tests, and the symlink is necessary, since it’s a multi-language project, with Java™, JavaScript, shell and other parts.)

Given MRESOURCES-212 “maven resource plugin does not preserve symlinks” I think that, while ① there _should_ be a +configuration option whether to copy symlinks as symlinks or to follow them+, ② this configuration option *MUST* +default to follow them+, to *not break pre-existing behaviour*.

Please fix this quickly. I think we’ll lower the version to 2.7 in the meantime, assuming that fixes it.

> Resource plugin's handling of symbolic links changed in 3.0.x, broke existing behavior
> --------------------------------------------------------------------------------------
>
>                 Key: MRESOURCES-237
>                 URL: https://issues.apache.org/jira/browse/MRESOURCES-237
>             Project: Maven Resources Plugin
>          Issue Type: Bug
>    Affects Versions: 3.0.0, 3.0.1, 3.0.2
>         Environment: Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T11:41:47-05:00)
> Java version: 1.8.0_121, vendor: Oracle Corporation
> Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.121-1.b14.fc25.x86_64/jre
> Default locale: en_US, platform encoding: UTF-8
> OS name: "linux", version: "4.9.11-200.fc25.x86_64", arch: "amd64", family: "unix"
>            Reporter: Brian D. Johnson
>            Priority: Minor
>
> It looks like the handling of symbolic links in the {{maven-resources-plugin}} has changed in version 3.0.x.  I'm submitting a JIRA because it breaks the previous behavior and I have not been able to find this documented anywhere as an intended change.
> *Use case:* Multi-module maven project.  We have a custom log4j2 configuration file we use during testing.  Instead of maintaining this file in multiple {{src/test/resources}} directories, we instead maintain a single copy of the file at the project's root level and create symbolic links from each module's {{src/test/resources}} directory to the file using relative paths.
> *2.7 Behavior:* the symlink was evaluated and the target file was copied to {{target/test-classes/}}.
> *3.0.x Behavior:* the symlink is copied to {{target/test-classes/}} verbatim.  The symlink's relative path results in the symlink pointing to the wrong file location.  The log4j2 configuration is not found.
> *Requested Change:* Either revert to the original 2.7 behavior, or document the change and provide a configuration parameter to allow the legacy behavior.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)