Maven home directory after reload overwritten

Answered

Hello,

I have a problem with my maven home directory.
Our Maven is located at "J:\software\apache-maven-3.6.3", I can also set and save it in the project at Settings -> Maven -> maven home directory.

But when I do a Maven reload all projects in IntelliJ, the home directory is overwritten with "C:/Users/<Username>/.m2/wrapper/dists/apache-maven-3.6.1-bin/18t1vjepdne9cv9t0hdcik0hp1/apache-maven-3.6.1".

I can't just delete this path either, because this is my company laptop and so it has already been delivered.

Can someone tell me why this is the case and how I can turn it off.

I hope someone can help me, because I cannot work like this :(

Have a nice day and stay healthy

 

0
2 comments

Do you have Maven wrapper configured for project (in this case there should be the .mvn/wrapper/ directory in your project root directory where the maven.properties file is located. See https://www.baeldung.com/maven-wrapper)? In this case IDE automatically switches to this Maven version for the project. If you do not want to use this Maven version, please delete maven.properties file. It should help.

Unfortunately it is not possible to change this behaviour at the moment if you have Maven wrapper configured for the project. Please vote and follow this request: https://youtrack.jetbrains.com/issue/IDEA-246851 We have plans to address this issue in near time.

0
Avatar
Permanently deleted user

Hello, Andrey,

thanks for the help, that was the problem...
After removing the .mvn folder everything worked as it should.
Pretty intransparent behaviour of IntelliJ at that point, if you don't know, you will search forever.

I upvoted your ticket.

Have a nice day and stay healthy

0

Please sign in to leave a comment.