Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-6880

Maven creates `?/m2` dir in pwd if run in Docker image with custom UID

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • None
    • None
    • None
    • None
    • Docker

    Description

      Hi,

      I'm not sure if this is a bug, but I consider the result problematic. What happens is that if you run maven in a Docker container with a custom UID (1000 in our case), the value of the system property user.home is ? which leads to maven creating a m2 dir in the current working directory. We need to use uid 1000 to get proper permissions in Jenkins (on the host).

      I've created a reproducer here https://github.com/fwilhe/mvn-user-home-repro

      If you try to build the docker image, it will exit with code 1 if a ? directory was created. I would expect this directory not to be created, but rather use /tmp.

      Attachments

        Activity

          People

            Unassigned Unassigned
            fwilhe Florian Wilhelm
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: