First off, open the POM.xml file of the module or project that needs to use Payara Embedded or Micro, and add one of the embedded distributions as a dependency:
Payara Embedded All
Payara Embedded Web
And that’s about it! With one of the above added as a dependency, you can now begin using Payara embedded in your application and project. For example, the following code will create and start an embedded Payara server, with the HTTP and HTTPS listener set to ports 8083 and 8184 respectively:
Note: You won’t be able to drop in Payara Micro quite like this; Payara Micro is based on the GlassFish Web distribution, and using it programmatically works a little differently (See Steve's introductory blog for an example).
That’s it for now, if you need further help with using Payara Embedded, you can find the GlassFish guide for using the embedded server here: http://docs.oracle.com/cd/E26576_01/doc.312/e24932/embedded-server-guide.htm#GSESG00001
If you are needing some help with the new Payara Micro, don’t worry, we should have some documentation for it up on our GitHub wiki soon; we’ll let you know when. As always, let us know if there’s any killer feature, improvement, or fix that you want to make it into Payara.