class Jenkins < Formula desc "Extendable open source continuous integration server" homepage "https://jenkins-ci.org" url "http://mirrors.jenkins-ci.org/war/1.618/jenkins.war" sha256 "86cb65bb3c8980d61336bdf1b10af1fefd2e1d9fca678ff4efc054c1b498a7ee" bottle do cellar :any sha256 "8c33ee7db0ca318faf22a70de6ed53cbe483e2bd1c89f1afc1a58525e4c69551" => :yosemite sha256 "02bcf3c913bbbf4e2b300fc2a927b507f43cced5ff60a69cce47bb1b4ec378ee" => :mavericks sha256 "9ed11acf90254febe47170236e6482e149dc37208ed66222e3f62665d4ac7e79" => :mountain_lion end head do url "https://github.com/jenkinsci/jenkins.git" depends_on "maven" => :build end depends_on :java => "1.6+" def install if build.head? system "mvn", "clean", "install", "-pl", "war", "-am", "-DskipTests" else system "jar", "xvf", "jenkins.war" end libexec.install Dir["**/jenkins.war", "**/jenkins-cli.jar"] bin.write_jar_script libexec/"jenkins.war", "jenkins" bin.write_jar_script libexec/"jenkins-cli.jar", "jenkins-cli" end plist_options :manual => "jenkins" def plist; <<-EOS.undent Label #{plist_name} ProgramArguments /usr/bin/java -Dmail.smtp.starttls.enable=true -jar #{opt_libexec}/jenkins.war --httpListenAddress=127.0.0.1 --httpPort=8080 RunAtLoad EOS end def caveats; <<-EOS.undent Note: When using launchctl the port will be 8080. EOS end end