When I try to use Maven from command line or Intellij, it points to a local repository c:\Users\username\subir.m2\repository instead of c:\Users\username.m2\repository . It happens only when I use another Java than the default Java 11.
I checked the settings.xml of maven, but it seems ok. I also added manually the default local repository without success.
On command line, I can force the repo using -Dmaven.repo.local
. In Intellij I don't know how to point to the correct repository. Settings under Maven -> Repositories are ok.
EDIT: as suggested by Anthony, in Settings -> Build, Execution, Deployment -> Build Tools -> Maven I simply clicked Override near User settings and Local repository, leaving the default values, and it worked.
Of course, on the command line it continues to point to the bad path. Is there not a way to change that, without using everytime -Dmaven.repo.local
?
CodePudding user response:
Normally, you can always override the local repository you wants to use following this path :
Preferences > Build, Execution, Deployment > Build Tools > Maven and then check "Override" to add your custom local repository