maven-wrapper.properties is ignored?
IntelliJ Idea CE 2021.2:
My Maven setup looks like this in the preferences:

My project does have a maven-wrapper.properties:

which contains:
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
However, when running any maven target, I get the error: "03:57 Error running 'demo [clean,install]': No valid Maven installation found. Either set the home directory in the configuration dialog or set the M2_HOME environment variable on your system."
Now don't get me wrong, I know ways to get around this, but since my setup seems sound, the should work. Why does it not?
Please sign in to leave a comment.
After looking into the logs, here is the stack trace:
And that createExecutionException is called because MavenUtil#resolveMavenHomeDirectory did not succeed, and indeed (https://github.com/JetBrains/intellij-community/blob/master/plugins/maven/src/main/java/org/jetbrains/idea/maven/utils/MavenUtil.java) it does not seem to be looking at any point for any wrapper.
Also when I do try to define a Maven path in the settings to replace the Bundled maven (mine is more recent), when I browse for the directory, and pick it, I get a spinner that never finishes and Intellij just freezes to the point I must violently shut it down.
So if I summarise, the Maven wrapper works for all the importing stuff and all, but when trying to invoke maven from the Maven pan or the "Run anything" window, it does not, and I cannot even override with my own Maven, so the only way I see to use Maven in those, is the Bundled one.
And that is fine, but I should be able to override that, especially since it looks like I can, but I cannot.
Seems to be a known issue: https://youtrack.jetbrains.com/issue/IDEA-258757