Uploaded image for project: 'Maven Shared Components'
  1. Maven Shared Components
  2. MSHARED-1004

Two (2) issues with symbolic links

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • maven-filtering-3.3.0
    • None
    • maven-filtering
    • None

    Description

      Two issues with (relative) symbolic links as resources (use attached file for reference and MWE:

       

      user@earhart:~/dev/test/my-app$ tree
      .
      ├── pom.xml
      ├── src
      │   ├── main
      │   │   ├── java
      │   │   │   └── com
      │   │   │       └── mycompany
      │   │   │           └── app
      │   │   │               └── App.java
      │   │   └── resources
      │   │       ├── B -> ../../../to_be_symlinked/B
      │   │       └── folder -> ../../../to_be_symlinked/folder
      │   └── test
      │       └── java
      │           └── com
      │               └── mycompany
      │                   └── app
      │                       └── AppTest.java
      └── to_be_symlinked
          ├── B
          └── folder
              └── A

       

       

       

      • Symlinks for directories copies the actual directory (folder/A) whereas symlinks for files copies the symlink (B). Note the difference between file A and B. B is pointing incorrectly since it is relative.
      user@earhart:~/dev/test/my-app/target/classes$ ls -l
      total 8
      lrwxrwxrwx 1 user user   26 dec 10 10:19 B -> ../../../to_be_symlinked/B
      drwxrwxr-x 3 user user 4096 dec 10 10:19 com
      drwxrwxr-x 2 user user 4096 dec 10 10:19 folder
      user@earhart:~/dev/test/my-app/target/classes$ ls -l folder/
      total 0
      -rw-rw-r-- 1 user user 0 dec 10 10:19 A
      • Resources are not overwritten (java.nio.file.FileAlreadyExistsException). To reproduce run "mvn compile" two (2x) times:
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources) on project my-app: copying /home/user/dev/test/my-app/src/main/resources/folder/A to /home/user/dev/test/my-app/target/classes/folder/A failed with FileAlreadyExistsException: /home/user/dev/test/my-app/target/classes/folder/A -

       

      Attachments

        1. my-app.tar.gz
          2 kB
          Jimisola Laursen
        2. my-app-wo-symlinks.tar.gz
          2 kB
          Jimisola Laursen

        Issue Links

          Activity

            People

              Unassigned Unassigned
              lfvjimisola Jimisola Laursen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 2h
                  2h
                  Remaining:
                  Remaining Estimate - 2h
                  2h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified