class Jenkins < Formula homepage "https://jenkins-ci.org" url "http://mirrors.jenkins-ci.org/war/1.615/jenkins.war" sha256 "69b6617a460b4ad22552eab97e6c39312019d668198607dd72a2d0ea63884f40" bottle do cellar :any sha256 "e85b1c7de891d8e1db27811beb9cb4ecd1adaab9b79eff97a8b5d67fe84a150c" => :yosemite sha256 "ef6734ab3f491465305c9f0af67343e3793fc6242f2af8ec809a89bb12acc1b2" => :mavericks sha256 "012581ffed23fea6ca94596f6f2bac19816fbf904e357480b8bbaa613dc47876" => :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