49 lines
1.4 KiB
Ruby
49 lines
1.4 KiB
Ruby
class OpenlibertyJakartaee8 < Formula
|
|
desc "Lightweight open framework for Java (Jakarta EE 8)"
|
|
homepage "https://openliberty.io"
|
|
url "https://public.dhe.ibm.com/ibmdl/export/pub/software/openliberty/runtime/release/2021-08-24_2341/openliberty-javaee8-21.0.0.9.zip"
|
|
sha256 "a8b47fa7a195908120f8c48a8cebbd80222f61692d1cb1dc704b143dab5dc690"
|
|
license "EPL-1.0"
|
|
|
|
livecheck do
|
|
url "https://openliberty.io/api/builds/data"
|
|
regex(/openliberty[._-]v?(\d+(?:\.\d+)+)\.zip/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, all: "e65b10889cade8b2f22d05ac3a042e49347066bf65d6dc266c78ec7d608d9b61"
|
|
end
|
|
|
|
depends_on "openjdk"
|
|
|
|
def install
|
|
rm_rf Dir["bin/**/*.bat"]
|
|
|
|
prefix.install_metafiles
|
|
libexec.install Dir["*"]
|
|
(bin/"openliberty-jakartaee8").write_env_script "#{libexec}/bin/server",
|
|
Language::Java.overridable_java_home_env
|
|
end
|
|
|
|
def caveats
|
|
<<~EOS
|
|
The home of Open Liberty Jakarta EE 8 is:
|
|
#{opt_libexec}
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
ENV["WLP_USER_DIR"] = testpath
|
|
|
|
begin
|
|
system bin/"openliberty-jakartaee8", "start"
|
|
assert_predicate testpath/"servers/.pid/defaultServer.pid", :exist?
|
|
ensure
|
|
system bin/"openliberty-jakartaee8", "stop"
|
|
end
|
|
|
|
refute_predicate testpath/"servers/.pid/defaultServer.pid", :exist?
|
|
assert_match "<feature>javaee-8.0</feature>", (testpath/"servers/defaultServer/server.xml").read
|
|
end
|
|
end
|