Payara Starter Documentation
Introduction
Payara Starter is a web application and command line tool designed to accelerate Jakarta EE development by simplifying the creation of new application projects. It supports the creation of both Maven and Gradle projects, allowing developers to focus on coding their application components in a faster way as they don’t have to deal with the complexities of setting up their projects.
Key Features of Payara Starter
-
Build System Flexibility: Supports Maven and Gradle as Project Management tools for seamless integration with preferred build systems.
-
Customizable Project Details: Define crucial project specifics upfront, aligning with organizational naming conventions.
-
Java and Jakarta EE Version Control: Allows the selection of specific versions to ensure compatibility and leverage the latest features.
-
MicroProfile Integration: Includes options to integrate MicroProfile APIs for building resilient, scalable services.
-
Payara Platform Compatibility: Effortlessly works with the Payara Platform, ensuring readiness for deployment.
-
Docker Support: Facilitates Docker compatibility, streamlining containerization for agile deployment.
-
Unit Test Templates: Optionally includes test templates, encouraging best testing practices from project initiation.
-
Advanced Security Configuration: Optional advanced security setup for robust authentication via Jakarta Security, facilitating secure application development from the start.
Supported Jakarta EE Profiles
Payara Starter supports various Jakarta EE profiles:
-
Platform:
jakarta.platform:jakarta.jakartaee-api
-
Web Profile:
jakarta.platform:jakarta.jakartaee-web-api
Generating a New App using Payara Starter
You can generate a new application using Payara Starter in two ways:
Command Line Using Archetype:
To generate a new application using the Payara Starter archetype from the command line, use the following Maven command:
mvn archetype:generate -DarchetypeGroupId=fish.payara.starter -DarchetypeArtifactId=payara-starter-archetype -DarchetypeVersion=1.0-beta4 <other options>
This command generates a new application based on specified options. Adjust these properties according to your project requirements.
Payara Starter Archetype Parameters
The Payara Starter Archetype has a robust set of parameters that allows the customization of various aspects during the application generation process. Below is a table detailing each parameter, its default value, and additional notes:
Element | Default Value | Notes | ||
---|---|---|---|---|
|
|
Specifies the preferred build system for the project. Options include: |
||
|
|
Specifies the Group ID for the generated project. |
||
|
|
Determines the Artifact ID for the generated project. |
||
|
|
Sets the version of the generated project. |
||
|
|
Defines the base package name for the project. |
||
|
|
Sets the Java version for the project. Available options:
|
||
|
|
Specifies the targeted Jakarta EE version. Valid options:
|
||
|
|
Specifies the Jakarta EE profile options: 'core', 'web', or 'full'.
|
||
|
|
Specifies the target distribution where the application will be deployed Options include:
|
||
|
5.68.0 |
Sets the targeted Payara Platform version. Retrieved from Maven Central. |
||
|
|
Includes support for the Concurrent API if |
||
|
|
Includes support for the Resource API if |
||
|
|
Includes support for the JBatch API if |
||
|
|
Includes support for the MicroProfile API if |
||
|
|
Includes support for the JCache if |
||
|
|
Includes support for the Payara Public API if |
||
|
|
Automatically deploys the WAR file if
|
||
|
|
Enables automatic HTTP binding.
|
||
|
|
Sets the web context root for the deployed artifact.
|
||
|
|
Includes a set of generated Unit tests if
|
||
|
|
Enables Docker compatibility. |
||
|
|
Enables support for the MicroProfile Config API. |
||
|
|
Enables support for MicroProfile OpenAPI. |
||
|
|
Enables support for MicroProfile Fault Tolerance. |
||
|
|
Enables support for MicroProfile Metrics. |
||
|
|
Specifies the authentication type for the application. Available choices:
|
Payara Starter Website
Visit start.payara.fish to use a web application to generate new application projects using a simpler graphical interface.
Using the Payara Starter Web Application
Payara Starter provides a convenient web application that allows you to generate Jakarta EE projects via a graphical interface.
Follow these steps to use the web application:
-
Access the web application:
-
Visit the Payara Starter web application at https://start.payara.fish.
-
-
Fill in the Project Details:
-
On the web application’s landing page, you’ll find a user-friendly interface to input project details.
-
Enter the required information, such as Group ID, Artifact ID, and other relevant details.
You can customize these based on your project requirements:
-
-
Choose the Build System and Jakarta EE Version:
-
Select your preferred build system (Maven or Gradle) from the provided options.
-
Choose the desired Jakarta EE version that aligns with your project’s compatibility requirements.
-
-
Configure any Additional Options:
-
The web application allows you to configure additional options such as MicroProfile integration, Payara Platform version, and more.
-
Customize these options based on your project needs.
-
-
Review and Generate:
-
Review the summary of your selected options to ensure they match your project requirements.
-
Click the Generate button to initiate the project generation process.
-
-
Download the Generated Project:
-
Once the generation process is complete, the web application triggers the download of the generated project archive.
-
Download the project archive, and you can then proceed to import it into your preferred Integrated Development Environment (IDE).
-
The web application simplifies the project creation process but may not expose all configuration options available through the command-line archetype generation. If you need better control of how the application is generated, we recommend using the starter archetype instead. |
Sample Generated Jakarta REST Resource
Here’s an example of a generated Jakarta REST resource using Payara Starter:
package fish.payara.hello;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Response;
@Path("hello")
public class HelloWorldResource {
@GET
public Response hello(@QueryParam("name") String name) {
if ((name == null) || name.trim().isEmpty()) {
name = "world";
}
return Response.ok(name).build();
}
}
This sample demonstrates a simple REST endpoint named hello
that accepts a query parameter name
and responds with a greeting message.
Feel free to adjust archetype parameters to tailor the generated application to your project requirements.