class Mvnvm < Formula desc "Maven version manager" homepage "http://mvnvm.org" url "https://bitbucket.org/mjensen/mvnvm/downloads/mvnvm-1.0.8.zip" sha256 "b2953ec2e4c94849f6764db3e6079f397e117c65a2e80e59af03a6bda013a80b" head "https://bitbucket.org/mjensen/mvnvm.git" bottle :unneeded depends_on :java => "1.7+" def install bin.install "mvn" bin.install "mvnDebug" bin.env_script_all_files(libexec/"bin", Language::Java.overridable_java_home_env("1.7+")) end conflicts_with "maven", :because => "also installs a 'mvn' executable" test do (testpath/"settings.xml").write <<-EOS.undent #{testpath}/repository EOS (testpath/"mvnvm.properties").write <<-EOS.undent mvn_version=3.3.9 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", "-gs", "#{testpath}/settings.xml", "compile" end end