Resource plugin's handling of symbolic links changed in 3.0.x, broke existing behavior
Status:
Assignee:
Priority:
Resolution:
Reopened
Unassigned
Minor
Unresolved
Description
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
Comments
33 older comments
Frank Leja
Added 05/Apr/24 12:47
I had exactly the same problem and expect a configuration to steer the behaviour at least in the same manner as in v2.x (mean resolving the file, instead of just copy the link itself, what is useless).
I used the symlink of the share library (ABC_api.so) pointing to the current version of this library (ABC_api.so.2.2.0.3).
My workaround is to include the symlink target file in the resource plugin config, skipping the link and its benefits completely.
I had exactly the same problem and expect a configuration to steer the behaviour at least in the same manner as in v2.x (mean resolving the file, instead of just copy the link itself, what is useless).
I used the symlink of the share library (ABC_api.so) pointing to the current version of this library (ABC_api.so.2.2.0.3).
My workaround is to include the symlink target file in the resource plugin config, skipping the link and its benefits completely.