- Download the apache-maven.tar.gz. If you follow the link on the maven download page both Firefox and Safari will get an html page but save it as a tar file. Look in the downloaded file (search for the string "apache-maven") and extract a real download link. When in doubt run md5 apache-maven-version.tar.gz on the result and compare it to the MD5 that is posted on the download page.
- Extract the tar somewhere. For example with tar xzf apache-maven-version.tar.gz. Here it gives an error (tar: A lone zero block at 3083) but so far it does not seem to affect the result.
- Ignore all the babbling about environment.plist files, and just create a ~/.bash_profile and put something like the following in it:
export M2_HOME=/Users/erik/apps/apache-maven-2.0.8 export M2=$M2_HOME/bin export JAVA_HOME=/Library/Java/Home/ export PATH=$PATH:$M2
Wednesday, March 19, 2008
Installing Maven under Mac OSX
Update 2011-09-12: Forget everything that's below here. Just install HomeBrew and type brew install maven.
Update 2008-03-28: Instead of following this article, you are probably better of with MacPorts. Thanks for the suggestion Nino!
I did not know it could be this hard to install Maven. I've installed Maven a bunch of times already but never before on a Mac. It took me about 1 hour!
Here is what you need to do:
Subscribe to:
Post Comments (Atom)
have you seen :
ReplyDeletemacports.org
Nice Nino. Yes, that looks a lot easier :)
ReplyDeleteI guess you are not using leopard?
ReplyDeletehttp://www.gridshore.nl/2008/01/28/upgrading-maven-on-the-mac/
greetz Jettro
Nope, still on 10.4.11.
ReplyDeleteSo this is just about how to set environment variables on Mac OS, right?
ReplyDeleteI've been using Maven for years on Mac OS and other platforms and never felt there was any significant difference.
thanks mate - just what i needed
ReplyDeleteThanks for this link Jettro!
ReplyDeleteI guess you are not using leopard?
http://www.gridshore.nl/2008/01/28/upgrading-maven-on-the-mac/
greetz Jettro
It is really tricky to install maven on macosx but it is worth the time.
ReplyDeletecongratulations for an other great article. I am checking your blog daily!
Thanks
ReplyDeletenow about brew install maven :)
ReplyDeleteif there is another version of maven already installed, du this:
ReplyDeleteexport PATH=$M2:$PATH
You shouldn't have 2 Maven versions on your machine. Always go with the current version. Everything else leads do problems ;-)
ReplyDelete@versioneye, people don't even install a single Maven for fun, let alone 2 ;)
ReplyDelete@Erik
ReplyDeleteah, but they do. In my world of open source, its not unheard of 8-) (i've got 3).
@anonymous, I've got 4 :(
ReplyDelete