Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wilx opened this issue Sep 15, 2022 · 5 comments
Closed

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

wilx opened this issue Sep 15, 2022 · 5 comments
Labels

Comments

@wilx
Copy link

wilx commented Sep 15, 2022

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.

@plamentotev
Copy link
Member

plamentotev commented Sep 17, 2022

@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.

@wilx
Copy link
Author

wilx commented Sep 17, 2022

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

@wilx
Copy link
Author

wilx commented Sep 17, 2022

@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.

gnodet added a commit to gnodet/plexus-io that referenced this issue Sep 19, 2022
@gnodet
Copy link
Member

gnodet commented Sep 19, 2022

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] ------------------------------------------------------------------------

@wilx
Copy link
Author

wilx commented Feb 24, 2023

Ping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants