class Mvnvm < Formula
desc "Maven version manager"
homepage "http://mvnvm.org"
url "https://bitbucket.org/mjensen/mvnvm/get/mvnvm-1.0.10.tar.gz"
sha256 "355747ed47b5941e071893f89fa2c0e3eb63dd301e095166983ca4503f4967c9"
head "https://bitbucket.org/mjensen/mvnvm.git"
bottle :unneeded
depends_on :java => "1.7+"
conflicts_with "maven", :because => "also installs a 'mvn' executable"
def install
bin.install "mvn"
bin.install "mvnDebug"
bin.env_script_all_files(libexec/"bin", Language::Java.overridable_java_home_env("1.7+"))
end
test do
(testpath/"settings.xml").write <<~EOS
#{testpath}/repository
EOS
(testpath/"mvnvm.properties").write <<~EOS
mvn_version=3.5.2
EOS
(testpath/"pom.xml").write <<~EOS
4.0.0
org.homebrew
maven-test
1.0.0-SNAPSHOT
1.7
1.7
EOS
(testpath/"src/main/java/org/homebrew/MavenTest.java").write <<~EOS
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