2014-09-05 01:13:11 +00:00
|
|
|
class Mvnvm < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Maven version manager"
|
2014-09-05 01:13:11 +00:00
|
|
|
homepage "http://mvnvm.org"
|
2015-09-09 01:16:11 +00:00
|
|
|
url "https://bitbucket.org/mjensen/mvnvm/get/mvnvm-1.0.7.zip"
|
|
|
|
sha256 "1cd930d2d00bb8cdbc3f3a6c8e2ff1b98ba2bc5ffd77d639219b3dce273f826b"
|
2014-09-05 01:13:11 +00:00
|
|
|
|
|
|
|
head "https://bitbucket.org/mjensen/mvnvm.git"
|
|
|
|
|
2015-02-01 12:37:13 +00:00
|
|
|
depends_on :java => "1.7+"
|
2014-09-05 01:13:11 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
bin.install "mvn"
|
2015-03-12 15:36:55 +00:00
|
|
|
bin.env_script_all_files(libexec/"bin", Language::Java.overridable_java_home_env("1.7+"))
|
2014-09-05 01:13:11 +00:00
|
|
|
end
|
|
|
|
|
2015-02-01 12:37:13 +00:00
|
|
|
conflicts_with "maven", :because => "also installs a 'mvn' executable"
|
2014-09-05 01:13:11 +00:00
|
|
|
|
|
|
|
test do
|
2015-09-09 01:16:11 +00:00
|
|
|
(testpath/"settings.xml").write <<-EOS.undent
|
|
|
|
<settings><localRepository>#{testpath}/repository</localRepository></settings>
|
|
|
|
EOS
|
2014-09-05 01:13:11 +00:00
|
|
|
(testpath/"mvnvm.properties").write <<-EOS.undent
|
2015-01-08 01:12:27 +00:00
|
|
|
mvn_version=3.2.5
|
2014-09-05 01:13:11 +00:00
|
|
|
EOS
|
|
|
|
(testpath/"pom.xml").write <<-EOS.undent
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
2015-08-03 12:55:31 +00:00
|
|
|
<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">
|
2014-09-05 01:13:11 +00:00
|
|
|
<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
|
2015-09-09 01:16:11 +00:00
|
|
|
system "#{bin}/mvn", "-gs", "#{testpath}/settings.xml", "compile"
|
2014-09-05 01:13:11 +00:00
|
|
|
end
|
|
|
|
end
|