ikxeno opened a new issue, #13655:
URL: https://github.com/apache/maven/issues/13655

   ### Affected version
   
   4.1.0-SNAPSHOT
   
   ### Bug description
   
   I found this while working on mvnval (#13648). If `~/.m2/settings.xml` 
defines `<localRepository>`, calling
     `ApiRunner.createSession(null, requestedRepo, 
ApiRunner.SecurityMode.NONE)` returns a session using the settings path. The
     supplied `requestedRepo` is ignored. 
    
     I reproduced this with an isolated `user.home` and without `maven-cli` 
implementation classes on the classpath. With no user
     settings file, the supplied path is used. This is separate from #13469. 
    
     `ApiRunner.newSession()` checks `settings.getLocalRepository()` before the 
argument. mvnval currently sets the repository on
     the returned session to work around this. 
    
     I would expect an explicit `localRepo` argument to take precedence. 
Settings should supply the path when the argument is null,
     with the default directory used when neither provides one. This matches 
the CLI's handling of `maven.repo.local` in
     `LookupInvoker.localRepositoryPath()`.
   
   I'll work on a fix.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to