class Mvnvm < Formula homepage "http://mvnvm.org" url "https://bitbucket.org/mjensen/mvnvm/get/mvnvm-1.0.3.zip" sha1 "e72f47104ac16575f992be4234ab264579d66444" head "https://bitbucket.org/mjensen/mvnvm.git" depends_on :java => "1.7+" def install bin.install "mvn" end conflicts_with "maven", :because => "also installs a 'mvn' executable" test do ENV["JAVA_HOME"] = `/usr/libexec/java_home`.chomp (testpath/"mvnvm.properties").write <<-EOS.undent mvn_version=3.2.5 EOS (testpath/"pom.xml").write <<-EOS.undent 4.0.0 org.homebrew maven-test 1.0.0-SNAPSHOT EOS (testpath/"src/main/java/org/homebrew/MavenTest.java").write <<-EOS.undent package org.homebrew; public class MavenTest { public static void main(String[] args) { System.out.println("Testing Maven with Homebrew!"); } } EOS system "#{bin}/mvn", "compile" end end