10 Replies Last post: Jan 15, 2009 3:10 PM by Anton Makeev  
nodje Novice 295 posts since
Nov 4, 2003
Currently Being Moderated

Nov 21, 2008 7:08 AM

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

Trevor  Novice 237 posts since
Aug 21, 2002
Currently Being Moderated
Dec 1, 2008 8:42 PM in response to: nodje
Re: M2_HOME

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.

Esko Luontola Novice 117 posts since
Feb 11, 2005
Currently Being Moderated
Dec 2, 2008 5:31 PM in response to: nodje
Re: M2_HOME

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.

Anton Makeev JetBrains 745 posts since
Dec 19, 2006
Currently Being Moderated
Dec 3, 2008 6:41 PM in response to: nodje
Re: M2_HOME

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

Anton Makeev JetBrains 745 posts since
Dec 19, 2006
Currently Being Moderated
Dec 4, 2008 1:20 PM in response to: nodje
Re: M2_HOME

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

Anton Makeev JetBrains 745 posts since
Dec 19, 2006
Currently Being Moderated
Jan 15, 2009 3:10 PM in response to: nodje
Re: M2_HOME

Those having similar problem please follow http://www.jetbrains.net/jira/browse/IDEA-21225.

 

Thanks,

Anton Makeev

More Like This

  • Retrieving data ...