[
https://issues.apache.org/jira/browse/MNG-6880?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17071279#comment-17071279
]
Michael Osipov commented on MNG-6880:
-------------------------------------
The code you are referencing is the wrong one.
The spots are:
https://github.com/AdoptOpenJDK/openjdk-jdk11u/blob/7b9323b12d3c362d88c9de35875c4f320c67b044/src/java.base/windows/native/libjava/java_props_md.c#L733-L737
and
https://github.com/AdoptOpenJDK/openjdk-jdk11u/blob/5f01925b80ed851b133ee26fbcb07026ac04149e/src/java.base/unix/native/libjava/java_props_md.c#L554-L562
I assume that getcwd is broken in your docker environment.
See:
https://www.google.com/search?client=firefox-b-e&ei=iV2CXqD2CIq_gQbYmLXYBg&q=%22getcwd%22+docker&oq=%22getcwd%22+docker&gs_lcp=CgZwc3ktYWIQAzIGCAAQBxAeMgYIABAHEB4yBggAEAgQHjIGCAAQCBAeMgYIABAIEB4yBggAEAgQHjIGCAAQCBAeMgUIABDNAjoGCAAQFhAeULYkWIwvYPswaABwAHgAgAFqiAH_ApIBAzIuMpgBAKABAaoBB2d3cy13aXo&sclient=psy-ab&ved=0ahUKEwjg3ve9i8PoAhWKX8AKHVhMDWsQ4dUDCAo&uact=5
> Maven creates `?/m2` dir in pwd if run in Docker image with custom UID
> ----------------------------------------------------------------------
>
> Key: MNG-6880
> URL: https://issues.apache.org/jira/browse/MNG-6880
> Project: Maven
> Issue Type: Bug
> Environment: Docker
> Reporter: Florian Wilhelm
> Priority: Major
>
> 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.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)