I'm using IntelliJ with both Maven plugins enabled. Where is maven installed on my computer though, and how do I find out which version IntelliJ uses?
4 Answers
You can find bundled maven version in Project Settings -> Build execution and deployment -> Build Tools -> Maven, under Maven home directory.
Go to File -> Settings and use the search bar to find maven settings.
There you can find the maven version (usually against the field "Maven home directory" ).
By default IntelliJ uses the Maven defined by your M2_HOME system variable although you can change this in the preferences.
To find where it is installed run this on the command line:
mvn -version
-
4Good to know. However, mvn returns "command not found" (osx). env shows no M2_HOME variable. Locate/find don't find a mvm or maven binary anywhere. Despite this, maven somehow works in IntelliJ. Sep 17, 2014 at 11:59
-
@DieParti By this you mean that you are running Maven goals like clean and install? The documentation says that you must have Maven installed on your computer.– MardozSep 17, 2014 at 12:18
-
Admittedly not, atm I'm using it for dependency management, but I suppose it's possible the IntelliJ plugin does this without actually using maven. Sep 17, 2014 at 12:30
-
Settings > Maven: there you can see the maven home directory, where mvn is installed. Sep 17, 2014 at 12:59
-
@DiePartei You're correct. Maven is for building, it doesn't itself make the artifacts visible to your IDE. Once you want to build your project you'll have to install Maven on your machine.– MardozSep 17, 2014 at 13:37
I'm also using IntelliJ with both Maven plugins enabled.
Check which version IntelliJ is currently using:
Open Project Settings and search 'Maven' or Go to Project Settings -> Build, execution, deployment -> Build Tools -> Maven
For Mac Users:
Open Preferences and search 'Maven' or Go to Preferences -> Build, execution, deployment -> Build Tools -> Maven
You can see both the current version that IntelliJ is using and the bundled maven version.
Check where maven is installed:
Use the following command in Terminal:
mvn -v or mvn -version
It shows you the installed version and location like below if mvn is installed, otherwise you'll get command not found error.
Apache Maven 3.6.2 (40f52333136460af0dc0d7232c0dc0bcf0d9e117; 2019-08-27T20:36:16+05:30)
Maven home: /Users/anbansal/apache-maven-3.6.2