M2_HOME
I'm using 9013.
I'm always having "Error running test-compile: No valid Maven installation found. Either set the home directory in the configuration dialog or set the M2_HOME environment variable on your system" when trying to run a maven configuration.
The thing is, $M2_HOME is defined on my system. I'm on OSX, don't know if other platform user have been luckier that me.
I'm wondering why the running configurations are not using the Default Maven Settings and Maven Settings from the Maven Projects tab??
It's be nice to fall back on that by default so that it'd be possible to share running configuration between different platform (by not having to specify a path to Maven home)
I've tried to define M2_HOME in IDEA Path Variable section, but can't use it internally for Maven Projects tab or runnig configuration. I get a "Error running test-compile: Specified Maven home directory (M2_HOME) does not exist"
Now, I can't delete this variable. When I start IDEA, it makes it compulsory to provide a value to go any further!! Since I can't use it, it'd be very nice to be able to get rid of it.
All in all, in the end, I have to provide a physical, platform dependant, path to each every configuration:
- Default Maven Settings
- Maven Settings (BTW, how do these interacts?)
- every single Maven configuration
cheers
Please sign in to leave a comment.
Any tip anyone?
I just don't understand why nothing seems to work as expected.
idea takes my m2_home variable and uses that in the dialogs, so no i have no issues.
at home on my mac, i dont have m2_home defines, and things work fine there as well. sometimes some maven plugins will require m2_home and yoir path to include m2_home/bin.
perhaps upgrade to 8.0.1 and see if its still an issue.
thanks Trevor, good to know it works for others.
I've had the problem for months, 8.0.1 is just the same for me. It happens that I need to share Configurations based on Maven accross different environments now.
I probably have introduced something wrong in my configuration that I can't get rid of.
Since IDEA won't recognize M2_HOME as an existing variable in my case, I figure there could be a conflict with the one in IDEA's Path Variables.
But even with both configured, I can't use M2_HOME in any dialog and have to write a value instead.
Could someone from Jetbrains tell me what causes IDEA to ask me to set a M2_HOME variable (it's conditional dialog at startup, I cna't start IDEA if I don't fill in the value) when I delete it from PATH_VARIABLE?
cheers
If you look at the contents of the .ipr/.iml file, you will see that the paths use M2_HOME there, even though in the settings dialogs you see the full path. And if you open a project which uses a path variable, IDEA should prompt you to add that path variable unless you already have it configured at Settings | Path Variables.
I had <option name="mavenHome" value="$M2_HOME$" /> in one of my Maven configurations.
Once deleted, I could remove successfully Path Variable M2_HOME.
So every thing is clean, no occurence of M2_HOME in my project. No Maven Home Directory in either Maven configuration, Default Maven Settings, Maven Settings (still can't figure out what is the difference bet. those two)
When I run any goal from the Maven Projects tab, I get a 'No valid Maven installation found. Either set the home directory in the configuration dialog or set the M2_HOME environment variable on your system'.
M2_HOME is defined on my system.
If I set the Maven Home Directory in either Default Maven Settings or Maven Settings then all Maven Projects goals work (but without using MAVEN_OPTS)
But wven then, none of my Maven configurations would work. Still the 'No valid Maven installation found. Either set the home directory in the configuration dialog or set the M2_HOME environment variable on your system'.
Is it possible to make IDEA recognize my system M2_HOME?
Would that solve all the "maven home directory" problems for all Maven Projects & running Configurations?
cheers,
nodje
Hi,
The Path Variables (event M2_HOME) have nothing to do with Maven runner and 'no valid installation' message. The Path Variables are only used to store paths in ipr/iml files in a platform-independent way.
The Maven Integration tries to use M2_HOME system variable if any and checks if it is pointing to a valid Maven installation (it must contain bin/m2.conf file). If the variable is recognized you will see the corresponding path in the Settings->Maven->Maven Home field. Please ensure the 'Overwrite' checkboks is not set.
Thanks,
Anton Makeev
Hi,
that seems fair enough. But how come my $M2_HOME is not recognize? It's got a bin/m2.conf.
Anything else I could verify?
thanks
-nodje
Please make sure the variable is defined for the same user as IDEA runs for. Also check if the variable's value is valid path.
If nothing helps, please attach a screenshot of Settings->Maven page and list of environvemt variables with values.
Thanks,
Anton Makeev
- double checked the user under wich idea is running, same as login user
- excerpt of environment variables:
....
M2_HOME=/java/maven
MACHTYPE=i386-apple-darwin9.0
MAILCHECK=60
MAVEN_OPTS='-server -Xmx512m -XX:MaxPermSize=256m'
....
The M2_HOME variable should certainly be a valid path since it's the one I have to manually set in Maven Settings to get it working.
Attached a screenshot of Settings->Maven.
thanks!
Attachment(s):
Picture 1.png
Those having similar problem please follow http://www.jetbrains.net/jira/browse/IDEA-21225.
Thanks,
Anton Makeev