I want to build a runnable/executable JAR (to run with java -jar my.jar
), using Open Liberty, from my Maven WAR project.
If I run mvn package
I get a WAR, but if I then run mvn liberty:package
I get something like:
[INFO] CWWKM2001I: Invoke command is ["C:\git\lmparch1\test\target\liberty\wlp\bin\server.bat", package, defaultServer, --archive="C:\git\lmparch1\test\target\test.jar", --include=runnable].
[INFO] CWWKE0005E: The runtime environment could not be launched.
[INFO] CWWKE0031E: Specified defaultServer server does not exist; use the create action to create a new server. serverPath: C:\git\lmparch1\test\target\liberty\wlp\usr\servers\defaultServer
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20.531 s
[INFO] Finished at: 2021-04-09T15:32:01-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.openliberty.tools:liberty-maven-plugin:3.3.4:package (default-cli) on project test: CWWKM2002E: Failed to invoke ["C:\git\lmparch1\test\target\liberty\wlp\bin\server.bat", package, defaultServer, --archive="C:\git\lmparch1\test\target\test.jar", --include=runnable]. RC= 2 but expected=[0]. -> [Help 1]
What goals am I supposed to configure and bind to which phases, etc. ?