2014年5月29日木曜日

homebrewでmavenもインストール

普段はeclipseでm2eを使っているので、
maven入れないでも何とかなるので入れてなかったのですが、
用意してあるプログラムがmvnコマンド実行するタイプのものだったので、
homebrewでmaven入れてみました。

まずはhomebrew入れられるのか確認してみるといくつか出てくる。
$ brew search maven
maven      maven-shell  maven2       maven30     maven31
homebrew/versions/maven2     homebrew/versions/maven30   homebrew/versions/maven31

とりあえず上の5つをbrew infoで確認してみると、
「maven」のやつが最新版のようです。
$ brew info maven2
maven2: stable 2.2.1
http://maven.apache.org/
Not installed
From: https://github.com/Homebrew/homebrew/commits/master/Library/Formula/maven2.rb
==> Caveats
WARNING: This older version will conflict with Maven if installed at the
same time.
 
$ brew info maven30
maven30: stable 3.0.5
http://maven.apache.org/
Not installed
From: https://github.com/Homebrew/homebrew/commits/master/Library/Formula/maven30.rb
==> Caveats
WARNING: This older version will conflict with Maven if installed at the
same time.
 
$ brew info maven31
maven31: stable 3.1.1
http://maven.apache.org/
Not installed
From: https://github.com/Homebrew/homebrew/commits/master/Library/Formula/maven31.rb
==> Caveats
WARNING: This older version will conflict with Maven if installed at the
same time.
 
$ brew info maven
maven: stable 3.2.1
http://maven.apache.org/
Not installed
From: https://github.com/Homebrew/homebrew/commits/master/Library/Formula/maven.rb
 
$ brew info maven-shell
maven-shell: stable 1.1.0
http://shell.sonatype.org/
Not installed
From: https://github.com/Homebrew/homebrew/commits/master/Library/Formula/maven-shell.rb

versionsがつくやつはやはりtapしてないのでエラーになる。
$ brew info homebrew/versions/maven2
Error: No available formula for maven2 
Please tap it and then try again: brew tap homebrew/versions 

なのでtapしてみると、すごくWarning出た。
$ brew tap homebrew/versions
Cloning into '/usr/local/Library/Taps/homebrew/homebrew-versions'...
remote: Reusing existing pack: 2077, done.
remote: Counting objects: 2, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 2079 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (2079/2079), 664.37 KiB | 338.00 KiB/s, done.
Resolving deltas: 100% (1148/1148), done.
Checking connectivity... done.
Warning: Could not tap homebrew/homebrew-versions/allegro4 over 
Warning: Could not tap homebrew/homebrew-versions/allegro5 over 
Warning: Could not tap homebrew/homebrew-versions/ansible14 over 
Warning: Could not tap homebrew/homebrew-versions/antlr2 over 
Warning: Could not tap homebrew/homebrew-versions/appledoc20 over 
Warning: Could not tap homebrew/homebrew-versions/appledoc21 over 
Warning: Could not tap homebrew/homebrew-versions/appledoc22 over 
Warning: Could not tap homebrew/homebrew-versions/autoconf213 over 
Warning: Could not tap homebrew/homebrew-versions/autoconf264 over 
Warning: Could not tap homebrew/homebrew-versions/automake112 over 
Warning: Could not tap homebrew/homebrew-versions/bash-completion2 over 
Warning: Could not tap homebrew/homebrew-versions/bison27 over 
Warning: Could not tap homebrew/homebrew-versions/boost149 over 
Warning: Could not tap homebrew/homebrew-versions/cassandra-0.6 over 
Warning: Could not tap homebrew/homebrew-versions/cassandra10 over 
Warning: Could not tap homebrew/homebrew-versions/cassandra12 over 
Warning: Could not tap homebrew/homebrew-versions/clojure14 over 
Warning: Could not tap homebrew/homebrew-versions/cloog-ppl015 over 
Warning: Could not tap homebrew/homebrew-versions/cloog018 over 
Warning: Could not tap homebrew/homebrew-versions/coq83 over 
Warning: Could not tap homebrew/homebrew-versions/cvsps2 over 
Warning: Could not tap homebrew/homebrew-versions/doxygen1831 over 
Warning: Could not tap homebrew/homebrew-versions/drush4 over 
Warning: Could not tap homebrew/homebrew-versions/drush5 over 
Warning: Could not tap homebrew/homebrew-versions/eigen2 over 
Warning: Could not tap homebrew/homebrew-versions/elasticsearch-0.20 over 
Warning: Could not tap homebrew/homebrew-versions/elasticsearch090 over 
Warning: Could not tap homebrew/homebrew-versions/erlang-r13 over 
Warning: Could not tap homebrew/homebrew-versions/erlang-r14 over 
Warning: Could not tap homebrew/homebrew-versions/erlang-r15 over 
Warning: Could not tap homebrew/homebrew-versions/gawk3 over 
Warning: Could not tap homebrew/homebrew-versions/gcc43 over 
Warning: Could not tap homebrew/homebrew-versions/gcc44 over 
Warning: Could not tap homebrew/homebrew-versions/gcc45 over 
Warning: Could not tap homebrew/homebrew-versions/gcc46 over 
Warning: Could not tap homebrew/homebrew-versions/gcc47 over 
Warning: Could not tap homebrew/homebrew-versions/gcc48 over 
Warning: Could not tap homebrew/homebrew-versions/gcc49 over 
Warning: Could not tap homebrew/homebrew-versions/giflib5 over 
Warning: Could not tap homebrew/homebrew-versions/git-tf-2.0.2 over 
Warning: Could not tap homebrew/homebrew-versions/glfw2 over 
Warning: Could not tap homebrew/homebrew-versions/glfw3 over 
Warning: Could not tap homebrew/homebrew-versions/gmp4 over 
Warning: Could not tap homebrew/homebrew-versions/grails13 over 
Warning: Could not tap homebrew/homebrew-versions/grails20 over 
Warning: Could not tap homebrew/homebrew-versions/grails21 over 
Warning: Could not tap homebrew/homebrew-versions/grails22 over 
Warning: Could not tap homebrew/homebrew-versions/gsl114 over 
Warning: Could not tap homebrew/homebrew-versions/gst-ffmpeg010 over 
Warning: Could not tap homebrew/homebrew-versions/gst-plugins-bad010 over 
Warning: Could not tap homebrew/homebrew-versions/gst-plugins-base010 over 
Warning: Could not tap homebrew/homebrew-versions/gst-plugins-good010 over 
Warning: Could not tap homebrew/homebrew-versions/gst-plugins-ugly010 over 
Warning: Could not tap homebrew/homebrew-versions/gst-python010 over 
Warning: Could not tap homebrew/homebrew-versions/gst-rtsp010 over 
Warning: Could not tap homebrew/homebrew-versions/gstreamer010 over 
Warning: Could not tap homebrew/homebrew-versions/guile18 over 
Warning: Could not tap homebrew/homebrew-versions/hadoop0202 over 
Warning: Could not tap homebrew/homebrew-versions/hadoop121 over 
Warning: Could not tap homebrew/homebrew-versions/hdf4 over 
Warning: Could not tap homebrew/homebrew-versions/imagemagick-ruby186 over 
Warning: Could not tap homebrew/homebrew-versions/isl011 over 
Warning: Could not tap homebrew/homebrew-versions/jboss-as5 over 
Warning: Could not tap homebrew/homebrew-versions/jboss-forge1 over 
Warning: Could not tap homebrew/homebrew-versions/jenkins-lts over 
Warning: Could not tap homebrew/homebrew-versions/jetty76 over 
Warning: Could not tap homebrew/homebrew-versions/jetty8 over 
Warning: Could not tap homebrew/homebrew-versions/jpeg6b over 
Warning: Could not tap homebrew/homebrew-versions/jpeg9 over 
Warning: Could not tap homebrew/homebrew-versions/json-c010 over 
Warning: Could not tap homebrew/homebrew-versions/leptonica169 over 
Warning: Could not tap homebrew/homebrew-versions/libcouchbase1 over 
Warning: Could not tap homebrew/homebrew-versions/libgee08 over 
Warning: Could not tap homebrew/homebrew-versions/libmpc08 over 
Warning: Could not tap homebrew/homebrew-versions/libotr4 over 
Warning: Could not tap homebrew/homebrew-versions/libpng12 over 
Warning: Could not tap homebrew/homebrew-versions/llvm-gcc28 over 
Warning: Could not tap homebrew/homebrew-versions/llvm31 over 
Warning: Could not tap homebrew/homebrew-versions/llvm32 over 
Warning: Could not tap homebrew/homebrew-versions/llvm33 over 
Warning: Could not tap homebrew/homebrew-versions/llvm34 over 
Warning: Could not tap homebrew/homebrew-versions/llvm35 over 
Warning: Could not tap homebrew/homebrew-versions/log4cplus10 over 
Warning: Could not tap homebrew/homebrew-versions/lua52 over 
Warning: Could not tap homebrew/homebrew-versions/mapnik071 over 
Warning: Could not tap homebrew/homebrew-versions/maven2 over 
Warning: Could not tap homebrew/homebrew-versions/maven30 over 
Warning: Could not tap homebrew/homebrew-versions/maven31 over 
Warning: Could not tap homebrew/homebrew-versions/mongodb24 over 
Warning: Could not tap homebrew/homebrew-versions/mpfr2 over 
Warning: Could not tap homebrew/homebrew-versions/mysql51 over 
Warning: Could not tap homebrew/homebrew-versions/mysql55 over 
Warning: Could not tap homebrew/homebrew-versions/node04 over 
Warning: Could not tap homebrew/homebrew-versions/node06 over 
Warning: Could not tap homebrew/homebrew-versions/node08 over 
Warning: Could not tap homebrew/homebrew-versions/nu0 over 
Warning: Could not tap homebrew/homebrew-versions/open-mpi16 over 
Warning: Could not tap homebrew/homebrew-versions/openjpeg20 over 
Warning: Could not tap homebrew/homebrew-versions/openssl098 over 
Warning: Could not tap homebrew/homebrew-versions/percona-server55 over 
Warning: Could not tap homebrew/homebrew-versions/perl514 over 
Warning: Could not tap homebrew/homebrew-versions/perl516 over 
Warning: Could not tap homebrew/homebrew-versions/perl518 over 
Warning: Could not tap homebrew/homebrew-versions/phantomjs17 over 
Warning: Could not tap homebrew/homebrew-versions/phantomjs182 over 
Warning: Could not tap homebrew/homebrew-versions/phantomjs192 over 
Warning: Could not tap homebrew/homebrew-versions/play12 over 
Warning: Could not tap homebrew/homebrew-versions/plowshare3 over 
Warning: Could not tap homebrew/homebrew-versions/postgis15 over 
Warning: Could not tap homebrew/homebrew-versions/postgis20 over 
Warning: Could not tap homebrew/homebrew-versions/postgresql8 over 
Warning: Could not tap homebrew/homebrew-versions/postgresql9 over 
Warning: Could not tap homebrew/homebrew-versions/postgresql91 over 
Warning: Could not tap homebrew/homebrew-versions/postgresql92 over 
Warning: Could not tap homebrew/homebrew-versions/povray36 over 
Warning: Could not tap homebrew/homebrew-versions/ppl011 over 
Warning: Could not tap homebrew/homebrew-versions/ppl10 over 
Warning: Could not tap homebrew/homebrew-versions/protobuf240a over 
Warning: Could not tap homebrew/homebrew-versions/protobuf241 over 
Warning: Could not tap homebrew/homebrew-versions/rabbitmq30 over 
Warning: Could not tap homebrew/homebrew-versions/raptor1 over 
Warning: Could not tap homebrew/homebrew-versions/redis1310 over 
Warning: Could not tap homebrew/homebrew-versions/redis24 over 
Warning: Could not tap homebrew/homebrew-versions/ruby182 over 
Warning: Could not tap homebrew/homebrew-versions/ruby186 over 
Warning: Could not tap homebrew/homebrew-versions/ruby192 over 
Warning: Could not tap homebrew/homebrew-versions/ruby193 over 
Warning: Could not tap homebrew/homebrew-versions/ruby20 over 
Warning: Could not tap homebrew/homebrew-versions/scala210 over 
Warning: Could not tap homebrew/homebrew-versions/scala29 over 
Warning: Could not tap homebrew/homebrew-versions/solr14 over 
Warning: Could not tap homebrew/homebrew-versions/solr36 over 
Warning: Could not tap homebrew/homebrew-versions/squid2 over 
Warning: Could not tap homebrew/homebrew-versions/subversion16 over 
Warning: Could not tap homebrew/homebrew-versions/subversion17 over 
Warning: Could not tap homebrew/homebrew-versions/tomcat6 over 
Warning: Could not tap homebrew/homebrew-versions/unison232 over 
Warning: Could not tap homebrew/homebrew-versions/valgrind36 over 
Warning: Could not tap homebrew/homebrew-versions/valgrind38 over 
Warning: Could not tap homebrew/homebrew-versions/varnish3 over 
Warning: Could not tap homebrew/homebrew-versions/vtk5 over 
Warning: Could not tap homebrew/homebrew-versions/zeromq22 over 
Warning: Could not tap homebrew/homebrew-versions/zeromq3 over 
Warning: Could not tap homebrew/homebrew-versions/zeromq32 over 
Tapped 144 formulae

tapした後はちゃんとinfoで引けるようになった。
ただ、versionsとついているだけあって、最新版のはないけど。
$ brew info homebrew/versions/maven2
maven2: stable 2.2.1
http://maven.apache.org/
Not installed
From: https://github.com/homebrew/homebrew-versions/commits/master/maven2.rb
==> Caveats
WARNING: This older version will conflict with Maven if installed at the
same time.
 
$ brew info homebrew/versions/maven30
maven30: stable 3.0.5
http://maven.apache.org/
Not installed
From: https://github.com/homebrew/homebrew-versions/commits/master/maven30.rb
==> Caveats
WARNING: This older version will conflict with Maven if installed at the
same time.
 
$ brew info homebrew/versions/maven31
maven31: stable 3.1.1
http://maven.apache.org/
Not installed
From: https://github.com/homebrew/homebrew-versions/commits/master/maven31.rb
==> Caveats
WARNING: This older version will conflict with Maven if installed at the
same time.

そして最新版をインストール。あっさりと終わる。
$ brew install maven
==> Downloading http://www.apache.org/dyn/closer.cgi?path=maven/maven-3/3.2.1/binaries/apache-maven-3.2.1-bin.tar.gz
==> Best Mirror http://ftp.riken.jp/net/apache/maven/maven-3/3.2.1/binaries/apache-maven-3.2.1-bin.tar.gz
######################################################################## 100.0%
🍺  /usr/local/Cellar/maven/3.2.1: 65 files, 7.8M, built in 3 seconds

ちゃんとmavenが入っていることが確認できた。
インストールされてるディレクトリもわかるので助かる。
$ mvn -v
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-15T02:37:52+09:00)
Maven home: /usr/local/Cellar/maven/3.2.1/libexec
Java version: 1.6.0_65, vendor: Apple Inc.
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: ja_JP, platform encoding: SJIS
OS name: "mac os x", version: "10.9.3", arch: "x86_64", family: "mac"

0 件のコメント:

コメントを投稿