Skip to content

symlinks are being resolved into absolute path, MASSEMBLY-965 #89

Closed

Description

@wilx

Maven Assembly plugin has updated plexus-io and now symlinks are archived with absolute path. I have tracked this to the plexus-io update. See apache/maven-assembly-plugin@9377502#diff-9c5fb3d1b7e3b0f54bc5c4182965c4fe1f9023d449017cece3005d3f90e8e4d8.

Activity

  1. plamentotev commented on Sep 17, 2022

    @plamentotev

    @wilx thanks for reporting. Do you have test/example project that reproduces it? We have symlink test so I wonder why it didn't caught the issue.

  2. wilx commented on Sep 17, 2022

    @wilx
    ContributorAuthor

    Checkout https://github.com/wilx/MASSEMBLY-965. It has symlink in the resources directory. The project shows the ls -l of the link and then shows the tar tvf of the resulting TAR file. The TAR file contains the absolute path for the symlink instead of the relative path that is in the source:

    [INFO] --- exec-maven-plugin:3.1.0:exec (show-source) @ MASSEMBLY-965 ---
    lrwxrwxrwx 1 wilx wilx 11 zář 17 09:38 /home/wilx/MASSEMBLY-965/resources/subdir/file-alias.txt -> ../file.txt
    [INFO] 
    [INFO] --- maven-assembly-plugin:3.4.2:single (build-package) @ MASSEMBLY-965 ---
    [INFO] Reading assembly descriptor: src/assembly/dist.xml
    [INFO] Building tar: /home/wilx/MASSEMBLY-965/target/MASSEMBLY-965-1.0-SNAPSHOT-dist.tar
    [INFO] 
    [INFO] --- exec-maven-plugin:3.1.0:exec (show-assembly-produce) @ MASSEMBLY-965 ---
    drwxrwxr-x wilx/wilx         0 2022-09-17 09:38 subdir/
    lrwxrwxrwx wilx/wilx         0 2022-09-17 09:36 subdir/file-alias.txt -> /home/wilx/MASSEMBLY-965/./resources/subdir/../file.txt
    -rw-rw-r-- wilx/wilx        20 2022-09-17 09:36 file.txt
    
  3. wilx commented on Sep 17, 2022

    @wilx
    ContributorAuthor

    @wilx thanks for reporting. Do you have test/example project that reproduces it? We have symlink test so I wonder why it didn't caught the issue.

    As for the test, it only checks that the symlink reaches the target. That is true. But the value of the symlink is not checked.

  4. added a commit that references this issue on Sep 19, 2022
    ff416e3
  5. gnodet commented on Sep 19, 2022

    @gnodet
    Member

    Here's the output of the MASSEMBLY-965 build with the above PR:

    [INFO] Scanning for projects...
    [INFO] 
    [INFO] -------------------< com.github.wilx:MASSEMBLY-965 >--------------------
    [INFO] Building MASSEMBLY-965 1.0-SNAPSHOT
    [INFO] --------------------------------[ pom ]---------------------------------
    [INFO] 
    [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ MASSEMBLY-965 ---
    [INFO] Deleting /Users/gnodet/tmp/MASSEMBLY-965/target
    [INFO] 
    [INFO] --- exec-maven-plugin:3.1.0:exec (show-source) @ MASSEMBLY-965 ---
    lrwxr-xr-x  1 gnodet  staff  11 Sep 19 08:21 /Users/gnodet/tmp/MASSEMBLY-965/resources/subdir/file-alias.txt -> ../file.txt
    [INFO] 
    [INFO] --- maven-assembly-plugin:3.4.2:single (build-package) @ MASSEMBLY-965 ---
    [INFO] Reading assembly descriptor: src/assembly/dist.xml
    [INFO] Building tar: /Users/gnodet/tmp/MASSEMBLY-965/target/MASSEMBLY-965-1.0-SNAPSHOT-dist.tar
    [INFO] 
    [INFO] --- exec-maven-plugin:3.1.0:exec (show-assembly-produce) @ MASSEMBLY-965 ---
    drwxr-xr-x  0 gnodet staff       0 Sep 19 08:21 subdir/
    -rw-r--r--  0 gnodet staff      20 Sep 19 08:21 file.txt
    lrwxr-xr-x  0 gnodet staff       0 Sep 19 08:21 subdir/file-alias.txt -> ../file.txt
    [INFO] 
    [INFO] --- maven-install-plugin:2.4:install (default-install) @ MASSEMBLY-965 ---
    [INFO] Installing /Users/gnodet/tmp/MASSEMBLY-965/pom.xml to /Users/gnodet/.m2/repository/com/github/wilx/MASSEMBLY-965/1.0-SNAPSHOT/MASSEMBLY-965-1.0-SNAPSHOT.pom
    [INFO] Installing /Users/gnodet/tmp/MASSEMBLY-965/target/MASSEMBLY-965-1.0-SNAPSHOT-dist.tar to /Users/gnodet/.m2/repository/com/github/wilx/MASSEMBLY-965/1.0-SNAPSHOT/MASSEMBLY-965-1.0-SNAPSHOT-dist.tar
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time:  1.188 s
    [INFO] Finished at: 2022-09-19T08:44:06+02:00
    [INFO] ------------------------------------------------------------------------
    
  6. wilx commented on Feb 24, 2023

    @wilx
    ContributorAuthor

    Ping.

  7. added a commit that references this issue on Jul 16, 2024
    2d4c703
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions