diff options
| author | Xu Cheng | 2015-03-06 16:07:10 +0800 |
|---|---|---|
| committer | Xu Cheng | 2015-03-07 12:04:54 +0800 |
| commit | f291481b4eaf9b2011004a1541096d2cb5dba817 (patch) | |
| tree | d2a4269ea0312f74d0300785cfb6aac6d16aed62 /Library/Formula | |
| parent | 86205ca1a74c1724ab747941e8bb411967bae702 (diff) | |
| download | homebrew-f291481b4eaf9b2011004a1541096d2cb5dba817.tar.bz2 | |
maven: add depends_on :java, mirror and modernize
Closes #37440.
Signed-off-by: Xu Cheng <xucheng@me.com>
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/maven.rb | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/Library/Formula/maven.rb b/Library/Formula/maven.rb index cc88b37f7..02b4e1d87 100644 --- a/Library/Formula/maven.rb +++ b/Library/Formula/maven.rb @@ -1,27 +1,35 @@ -require 'formula' - class Maven < Formula - homepage 'http://maven.apache.org/' - url 'http://www.apache.org/dyn/closer.cgi?path=maven/maven-3/3.2.5/binaries/apache-maven-3.2.5-bin.tar.gz' - sha1 '41009327d5494e0e8970b25b77ffed8934cd7ca1' + homepage "https://maven.apache.org/" + url "http://www.apache.org/dyn/closer.cgi?path=maven/maven-3/3.2.5/binaries/apache-maven-3.2.5-bin.tar.gz" + mirror "https://archive.apache.org/dist/maven/maven-3/3.2.5/binaries/apache-maven-3.2.5-bin.tar.gz" + sha256 "8c190264bdf591ff9f1268dc0ad940a2726f9e958e367716a09b8aaa7e74a755" + + depends_on :java def install # Remove windows files rm_f Dir["bin/*.bat"] # Fix the permissions on the global settings file. - chmod 0644, 'conf/settings.xml' + chmod 0644, "conf/settings.xml" prefix.install_metafiles - libexec.install Dir['*'] + libexec.install Dir["*"] # Leave conf file in libexec. The mvn symlink will be resolved and the conf # file will be found relative to it - bin.install_symlink Dir["#{libexec}/bin/*"] - ["#{libexec}/bin/m2.conf"] + Pathname.glob("#{libexec}/bin/*") do |file| + next if file.directory? + basename = file.basename + next if basename.to_s == "m2.conf" + (bin/basename).write_env_script file, Language::Java.java_home_env + end end + conflicts_with "mvnvm", :because => "also installs a 'mvn' executable" + test do - (testpath/'pom.xml').write <<-EOS.undent + (testpath/"pom.xml").write <<-EOS.undent <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> @@ -31,7 +39,7 @@ class Maven < Formula <version>1.0.0-SNAPSHOT</version> </project> EOS - (testpath/'src/main/java/org/homebrew/MavenTest.java').write <<-EOS.undent + (testpath/"src/main/java/org/homebrew/MavenTest.java").write <<-EOS.undent package org.homebrew; public class MavenTest { public static void main(String[] args) { @@ -39,7 +47,6 @@ class Maven < Formula } } EOS - system "#{bin}/mvn", 'compile' + system "#{bin}/mvn", "compile" end - end |
