I have a Java EE application (with maven) which currently is packaged into a .war file. What I want to do now is execute this project with a Payara Micro Embedded server. This is done like this:
public static void main(String[] args) {
PayaraMicro.getInstance().addDeployment("test.war").bootStrap();
}
The complete application should be packaged into a .jar file and fire up the application server and deploy the application automatically. How do I achieve this?
With Payara Micro, you don't have to write any additional code to run your WAR application or package it is an executable JAR file together with all the dependencies.
Just to run the application (in development or tests), you can do:
If you need to package everything as a single JAR, do the following after your WAR application is built in order to create myapplication-standalone.jar, which you can run with
java -jarlater:You can now execute your application deployed in payara micro with this command:
The latter approach is described in more detail in Payara blog, including how to integrate it with your maven build. You can find further documentation about this feature of Payara Micro in the documentation.