Setting up Maven home again and again

I set up Maven home directory in Idea Settings, but every time I need to do anything else with Maven (Maven run config) I need to override it again in runner's General tab and set it again. The same applies for new projects (Setting is for project only).

What is the best way to set Maven once and for all (until the next update)?

5 comments
Comment actions Permalink

Do you have your M2_HOME environment variable set?  IDEA will pick up everything from that - I've never had to mess with the settings.

1
Comment actions Permalink

Well, no... I update here and there and environment settings is always a big quickfest for me :-(

However, your answer lead me to an idea if there is any better faster tool (especially PATH modification is pain in default Windows window) and I tried one and the process is much better (quite google-randomly Rapid EE). Idea picks it up nicely. I'll stick to this method from now on.

What I expected though is something like M2_HOME but possibly set from within Idea - on one place. I expected that when I set it for project, I don't have to set it for runner, etc. This is not possible, you say?

0
Comment actions Permalink

Try configuring it under File -> Other Settings -> Template Settings.

Also - run configuration defaults can be set in the "Defaults" section of the Edit Configurations window.  However those are per-project.  I would think (hope) that it would pick up the settings from the default project settings though.

1
Comment actions Permalink

Somewhat off topic but I use Link Shell Extension to setup symlinks/junctions in Windows for things like Maven just like you would do in a *nix environemnt.  I link to the actual Maven installation with something like maven-3.0.x and that's the path I use for M2_HOME.  Then when I upgrade Maven I just switch the link and no need to update the environment variables.

0
Comment actions Permalink

Thank you, Russ, for both answers. I'll stick with your original one and take a look ath that LSE too, looks very interesting.

0

Please sign in to leave a comment.