Skip to content

Instantly share code, notes, and snippets.

@danschultz
Created January 2, 2017 20:46
Show Gist options
  • Save danschultz/88ea4cafc2820d66f3492a24190bbe17 to your computer and use it in GitHub Desktop.
Save danschultz/88ea4cafc2820d66f3492a24190bbe17 to your computer and use it in GitHub Desktop.
Brew formula for Maven 2.2.1
class Maven2 < Formula
desc "Java-based project management"
homepage "https://maven.apache.org/"
url "https://archive.apache.org/dist/maven/binaries/apache-maven-2.2.1-bin.tar.gz"
sha256 "b9a36559486a862abfc7fb2064fd1429f20333caae95ac51215d06d72c02d376"
conflicts_with "maven", :because => "Differing versions of same formula"
depends_on :java
def install
# Remove windows files
rm_f Dir["bin/*.bat"]
# Install jars in libexec to avoid conflicts
prefix.install %w[NOTICE.txt LICENSE.txt README.txt]
libexec.install Dir["*"]
# Symlink binaries
bin.mkpath
Dir["#{libexec}/bin/*"].each do |f|
ln_s f, bin+File.basename(f)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment