Intellij 2021.2 changed maven local repository
We use a maven settings.xml (in the default location of C:\Users\USER_NAME\.m2\settings.xml) that contains a modified localRepository:
<localRepository>${user.home}/.m2/repository-custom-name</localRepository>
In the IntelliJ Menu "File | Settings | Build, Execution, Deployment | Build Tools | Maven" I had no overrides specified for 'User settings file' or 'Local repository'.
The behavior prior to the 2021.2 Update was, that the localRepository from the settings.xml was used.
The new behavior is that even though no overrides are set, the "default" (greyed out) repository 'C:\Users\USER_NAME\.m2\repository' is used!
I fixed it by manually specifying the localRepository as an override in IntelliJ. IMHO if a localRepository is present in the settings.xml (that gets picked up) and no override is present in the IntelliJ-Settings, the localRepository of the settings.xml should win.
Please sign in to leave a comment.
Please file a bug at https://youtrack.jetbrains.com/newIssue?project=IDEA. Looks like a regression.
One more issue related to this topic
When overriding the repository location or the settings file location, it doesn't make it global for all projects, we had to go through every single project we had and change the settings so it doesn't re-download all dependencies again.
Mouamle Hasan - yep I had to do the same. It is a project specific setting (makes sense).
I filed a Bug: https://youtrack.jetbrains.com/issue/IDEA-274741
Also found https://youtrack.jetbrains.com/issue/IDEA-266750 which seems to be already included in 2021.2 and only affect maven 3.8.1+ though.. and still it happened for me for the first time with 2021.2..
Lets see what 2021.2.1 changes^^
Still the same Problem with "2021.2.1 (Ultimate Edition) Build #IU-212.5080.55, built on August 24, 2021".
Thank you for reporting. Though I cannot reproduce the issue: the location is changed for me when I change it only in default settings.xml file.
Could you please specify (in the https://youtrack.jetbrains.com/issue/IDEA-274741 issue) the Maven version you use in IDE settings (screenshot will be fine) and attach the settings.xml file and idea.log file after **Reload** action in Maven tool window? Thank you.
Can confirm it now works with 2021.3. Thanks.