This is Part 2 of our Payara Server - Back to Basics series, see Part 1 - Installing Payara Server on Ubuntu here.
In order for a web application to run, it must be first deployed on an application server such as Payara Server. Deployment in the context of web applications is the act of installing the application on a server. It allows requests to be handled and so on. This guide will provide you with a few different ways to get your application running.
HK2 is a rather old dependency injection (DI) framework and is used as the core of Payara Server. Created in 2007 by Kohsuke Kawaguchi (who is also the creator of the Hudson project, now Jenkins) at Sun Microsystems, it followed JSR 330 closely, which was the JSR that introduced the @Inject, @Named and @Qualifier annotations, the very annotations which are also heavily used in CDI.
Having previously blogged about setting up data sources in Payara Server, we thought we should mention that you can also set up data sources in Payara Micro. In this blog, we'll take you through the process of setting up a data source using Payara Micro, including code snippets and where to find full code examples. Let's get started!
When creating a Java EE application it is important to deploy and test it on a server that is as close to the target production environment as possible. If you use Maven in your project, it is possible to do so using the Cargo plugin, which allows you to deploy an application to an instance of Payara Server either locally or remotely. A complete example is available at https://github.com/payara/Payara-Examples/blob/master/ecosystem/payara-maven/pom.xml.