49 lines
1.5 KiB
Ruby
49 lines
1.5 KiB
Ruby
class OpenlibertyWebprofile9 < Formula
|
|
desc "Lightweight open framework for Java (Jakarta EE Web Profile 9)"
|
|
homepage "https://openliberty.io"
|
|
url "https://public.dhe.ibm.com/ibmdl/export/pub/software/openliberty/runtime/release/22.0.0.7/openliberty-webProfile9-22.0.0.7.zip"
|
|
sha256 "c9127e8648532bc11e9821461564db48a6c723fd55cdae541172d4eac2a7a0ec"
|
|
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: "92bd51c495a5fbd696c9d19f5b7426fd153333a5ebcd4f43e87fd8c73e36b06a"
|
|
end
|
|
|
|
depends_on "openjdk"
|
|
|
|
def install
|
|
rm_rf Dir["bin/**/*.bat"]
|
|
|
|
prefix.install_metafiles
|
|
libexec.install Dir["*"]
|
|
(bin/"openliberty-webprofile9").write_env_script "#{libexec}/bin/server",
|
|
Language::Java.overridable_java_home_env
|
|
end
|
|
|
|
def caveats
|
|
<<~EOS
|
|
The home of Open Liberty Jakarta EE Web Profile 9 is:
|
|
#{opt_libexec}
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
ENV["WLP_USER_DIR"] = testpath
|
|
|
|
begin
|
|
system bin/"openliberty-webprofile9", "start"
|
|
assert_predicate testpath/"servers/.pid/defaultServer.pid", :exist?
|
|
ensure
|
|
system bin/"openliberty-webprofile9", "stop"
|
|
end
|
|
|
|
refute_predicate testpath/"servers/.pid/defaultServer.pid", :exist?
|
|
assert_match "<feature>webProfile-9.1</feature>", (testpath/"servers/defaultServer/server.xml").read
|
|
end
|
|
end
|