IntelliJ OSX M2_HOME Issue Solution

October 15th, 2011

Every time I start a new project in IntelliJ that uses maven, I run into the issue of Maven home not being set.   Without fail I’ll create a new Maven module and it won’t use the archetype because it can’t find the mvn command which means I have to delete the module, set Maven home manually and then recreate it.  This is a pain in the ass, but I’m usually more interested in getting to my coding than trying to figure how to get the environment variable set so I can avoid the issue in the future.  But not today.

This morning while playing around with custom archetypes and after seeing that frigging error message yet again,  I figured it was as a good a time as any to find a solution.  To the google! (Cue Batmanesque music)  A quick search for “set global environment variable mac” turned up this blog post, http://www.digitaledgesw.com/node/31.  Interestingly  it was written to solve the exact problem I was encountering.  Ain’t Google great?

The solution was simple.  I just needed to fire up vi, edit ~/.MacOSX/environment.plist and add the following lines:

<key>M2_HOME</key>
<string>/usr/share/maven</string>

The values specified in environment.plist file are set globally whenever a user logs in.  Check out this page for more info.  The author of the post said he had issues with this method when he used spotlight to launch app on Leopard. I’m currently running Lion and it works like a charm.

The comments also introduced me to some pretty cool stuff.  For example to fix the problem quickly without having to log out I ran

shell> launchctl setenv M2_HOME /usr/share/maven

restart IntelliJ and bingo its set.  If you haven’t used it launchctl is pretty schweet command and well worth checking out.  Well this concludes this entry.  Thanx to Digital Age Software.  You saved me enough time that I could write up my own blog post.

Coupons.com Grease Monkey Script

November 7th, 2010

This will make using coupons.com super easy. couponscom.user

Messy Vs. Functional

August 12th, 2010

Thursday morning brought the usual conundrum of trying to figure out what the hell had my wife upset.  Note to self:  at some point learn to read her mind.  At any rate, it turned out that the issue du jour was that I’d left my camelbak on the kitchen counter.  Which I suppose is a valid beef.  It would have been nice if she’d just said that, but that is a topic of another post.  However it did make me start thinking about a question on the silent commute to work (we ride to work together).  Is it better to “put things where they belong” or to put them where they are convenient or at least where they can be found when you need them?  This is a topic that myself and a group of people made up by my wife, mother and quite a few others are diametrically opposed on.  I’m not saying that I want to live in a house crap strewn everywhere, but I also don’t want to live a pristine model home in which I can’t find anything.  I prefer to live in a state that I consider organized chaos.  It looks completely chaotic to pretty much everyone else but if I need something I can find it in matter of minutes because I know exactly which stack of stuff its in.  My wife’s things on the other hand look very organized in their color coded folders and boxes with labels and things in neat and tidy closets.  But if she needs to find something it will take her the better part of a day to figure out where it is and in the process she creates as big if not a bigger mess that I live in to begin with.  So I have to wonder which is really better?

It’s Wednesday

August 11th, 2010

This is my firstish post.  This blog that is yet another attempt to find an outlet for my sporadic overflows of creativity, cynicism, rants and general opinions on the bs that happens around me.  What is on my mind this morning?  I don’t really know and thusly I won’t bother making something up.  Instead I’ll come later when and if something is on my mind.  At least I posted something and that’s a step in the right direction.  I guess?