PageRenderTime 50ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

/Library/Formula/mvnvm.rb

https://bitbucket.org/JoshHagins/homebrew
Ruby | 44 lines | 38 code | 6 blank | 0 comment | 0 complexity | 75433f48b12a04625d501c2feb45816c MD5 | raw file
  1. require "formula"
  2. class Mvnvm < Formula
  3. homepage "http://mvnvm.org"
  4. url "https://bitbucket.org/mjensen/mvnvm/get/mvnvm-0.1.zip"
  5. sha1 "ae75e26265c62daab4e9f751f5a6a44325247e23"
  6. head "https://bitbucket.org/mjensen/mvnvm.git"
  7. depends_on :java => "1.7"
  8. def install
  9. bin.install "mvn"
  10. end
  11. conflicts_with "maven",
  12. :because => "also installs a 'mvn' executable"
  13. test do
  14. ENV["JAVA_HOME"] = `/usr/libexec/java_home`.chomp
  15. (testpath/"mvnvm.properties").write <<-EOS.undent
  16. mvn_version=3.0.5
  17. EOS
  18. (testpath/"pom.xml").write <<-EOS.undent
  19. <?xml version="1.0" encoding="UTF-8"?>
  20. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  21. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  22. <modelVersion>4.0.0</modelVersion>
  23. <groupId>org.homebrew</groupId>
  24. <artifactId>maven-test</artifactId>
  25. <version>1.0.0-SNAPSHOT</version>
  26. </project>
  27. EOS
  28. (testpath/"src/main/java/org/homebrew/MavenTest.java").write <<-EOS.undent
  29. package org.homebrew;
  30. public class MavenTest {
  31. public static void main(String[] args) {
  32. System.out.println("Testing Maven with Homebrew!");
  33. }
  34. }
  35. EOS
  36. system "#{bin}/mvn", "compile"
  37. end
  38. end