homebrew-core/Formula/mvnvm.rb
ilovezfs 927185b53a mvnvm 1.0.9
Closes #9268.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
2017-01-26 00:54:46 -08:00

47 lines
1.6 KiB
Ruby

class Mvnvm < Formula
desc "Maven version manager"
homepage "http://mvnvm.org"
url "https://bitbucket.org/mjensen/mvnvm/get/mvnvm-1.0.9.tar.gz"
sha256 "7f05b0a310cf57d62c224f43e4ee2221608a3cfa266eb248c9b0a924ea569270"
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
<settings><localRepository>#{testpath}/repository</localRepository></settings>
EOS
(testpath/"mvnvm.properties").write <<-EOS.undent
mvn_version=3.3.9
EOS
(testpath/"pom.xml").write <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="https://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.homebrew</groupId>
<artifactId>maven-test</artifactId>
<version>1.0.0-SNAPSHOT</version>
</project>
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