[ 
https://issues.apache.org/jira/browse/MNG-8311?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17889845#comment-17889845
 ] 

Tamas Cservenak commented on MNG-8311:
--------------------------------------

Right, user home, but not CWD, unless CWD == user home. That confused me when 
you said "uses CWD"

> empty but existing <localRepository/> in settings.xml defaulting to current 
> working directory
> ---------------------------------------------------------------------------------------------
>
>                 Key: MNG-8311
>                 URL: https://issues.apache.org/jira/browse/MNG-8311
>             Project: Maven
>          Issue Type: Bug
>          Components: Core, Settings
>    Affects Versions: 4.0.0-beta-4
>         Environment:  Apache Maven 4.0.0-beta-4 
> (697c543b4e3bbec1b99e9d4d1ee8e0302e748f09)
> Maven home: 
> /home/runner/work/maven-repro/maven-repro/apache-maven-4.0.0-beta-4
> Java version: 21.0.4, vendor: Eclipse Adoptium, runtime: 
> /usr/lib/jvm/temurin-21-jdk-amd64
> Default locale: en, platform encoding: UTF-8
> OS name: "linux", version: "6.5.0-1025-azure", arch: "amd64", family: "unix"
>            Reporter: Daniel Schmid
>            Priority: Major
>         Attachments: job_logs_mvn3.txt, job_logs_mvn4.txt, 
> settings.template.xml
>
>
> If a ~/.m2/settings.xml with an empty <localRepository/> element exists in 
> Maven 4, it downloads dependencies to the current working directory as 
> opposed to ~/.m2/repository.
> Steps to reproduce:
>  * Create a settings.xml with the exact content from the [settings.xml in the 
> quick overview|https://maven.apache.org/settings.html#quick-overview]. The 
> important part is the empty <localRepository/>.
>  * Run mvn verify or similar
>  * Observe it downloading dependencies to the current repository as opposed 
> to ~/.m2/repository
> Full reproducer using GitHub Actions: 
> [https://github.com/danthe1st/maven-repro/tree/wrong-local-repo] 
> build log with Maven 4 (actual result): 
> [https://github.com/danthe1st/maven-repro/actions/runs/11343337296/job/31545681467]
> The output of mvn verify -X includes:
> {code:java}
> [DEBUG] Using local repository at /home/runner/work/maven-repro/maven-repro 
> {code}
> Files after mvn verify with Maven 4 (the maven.tar.gz and 
> apache-maven-4.0.0-beta-4 directories aren't created from mvn verify):
> {code:none}
> Run ls
> aopalliance
> apache-maven-4.0.0-beta-4
> com
> commons-codec
> commons-io
> javax
> maven.tar.gz
> net
> org
> pom.xml
> settings.template.xml
> src
> target
> {code}
> build log with Maven 3 (expected result): 
> [https://github.com/danthe1st/maven-repro/actions/runs/11343337296/job/31545681854]
> The output of mvn verify -X includes:
> {code:java}
> [DEBUG] Using local repository at /home/runner/.m2/repository {code}
> Files after mvn verify with Maven 3:
> {code:none}
> Run ls
> pom.xml
> settings.template.xml
> src
> target
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to