Payara Platform Support for IntelliJ Plugin (Enterprise & Community)
Published on 02 Oct 2020

This tutorial describes how to create, debug and deploy a Maven web application to the Payara Platform. You may follow the same application deployment process and the Payara Platform configuration steps for a Gradle web application.
Payara IntelliJ IDEA tools provide integration of the Payara Platform Enterprise & Community Editions into IntelliJ IDEA Ultimate. Before you begin, make sure the Maven, Gradle and Payara IntelliJ tools are installed from the IntelliJ Marketplace and enabled. If not then press the following button to directly install the Payara Tools in IntelliJ Ultimate:
Or install the Payara Tools from the main menu File → Settings → Plugins and search for Payara Tools:
Creating a Payara Micro Web Application
Maven is the most widely used project build and dependency management tool in the Java ecosystem. In this tutorial we will generate a Payara Micro Maven Web Application through the Payara Micro Maven archetype. Let’s start by creating a new Project.
- Simply start up IntelliJ IDEA and then Choose File → New → Project from the main menu and select the Payara Micro project type:

- Enter the groupId, artifactId, etc to set up the project, and then click Next:
-Sep-22-2020-12-13-28-41-AM.png)
- On the Project name and Location panel, enter sample-micro-app as the project name, set the Project Location and click Finish:
-Sep-22-2020-12-13-27-53-AM.png)
- When you click Finish, the IDE creates the following projects from the Payara Micro maven archetype:
-Sep-22-2020-12-13-26-55-AM.png)
- Once the project is generated, you may either add the project to the current workspace or open in a new window:
-Sep-22-2020-12-13-28-70-AM.png)
- As you can see, the project has a basic structure with src\main\java and src\main\webapp folders:
-Sep-22-2020-12-13-25-48-AM.png)
- Now you can create the new REST Endpoint or Servlet, In the Project tool window, right-click the src/main/java directory, point to New and click Create New Servlet:
- In the New Servlet dialog, enter the name HelloServlet and click OK.
- Open the Servlet file and update the url pattern of servlet to '/hello':
In the following sections, we will deploy this application to Payara Platform.
Payara Micro application can be managed via IntelliJ Run/Debug configuration or Actions, where Run configuration can be customized by the developer and Actions are quick and easy to use:
Running the Payara Micro Application via Configuration:
IntelliJ IDEA needs a run configuration to build the artifacts and run the Payara Micro application.
- From the main menu, select Run | Edit Configurations:
- In the Run/Debug Configurations dialog, click +, expand the Payara Micro node, and select Maven.
-Sep-22-2020-12-13-26-06-AM.png)
- Now add the Before Launch tasks and assign a new artifact, click + on the left-hand pane, choose the Build Artifacts type from the drop-down list.
-Sep-22-2020-12-13-26-79-AM.png)
- In the Select Artifacts dialog, select to build the sample-micro-app:war artifact:

- Now save the configuration:
- To start the Payara Micro instance, click the run button in the top-right panel:
-Sep-22-2020-12-13-27-17-AM.png)
- After running the Payara Micro application, you may see the log in the OUTPUT window:
-4.png)
Debugging the Payara Micro Application
- Instead of pressing the Run button, you can instead click Debug from similar locations to automatically start the micro instance and attach the debugger to the application:
- After debugging the Payara Micro application, you may see the log in the Debug → Console window:

- After the debugger session starts and the application hits the breakpoint, the line where the servlet paused gets highlighted and the Debug tool window appears with the list of running threads and the stack-trace:
Running the Payara Micro Application via Actions:
The Payara IntelliJ tools also provide inbuilt actions to manage the Payara Micro application without creating the project configuration, which internally executes Payara Micro Maven/Gradle plugin goals/tasks:
- To invoke the actions, Goto Help menu → Find Action..:
-1.png?width=241&name=Payara%20Platform%20Support%20for%20IntelliJ%20Plugin%20(Enterprise%20%26%20Community)-1.png)
- Search the Micro actions and press the enter key:
-Sep-22-2020-12-13-26-31-AM.png)
- Similarly, you may also debug the Payara Micro application via actions:
-2.png)
-Sep-22-2020-12-13-24-68-AM.png)
Deploy the Maven Web Application to Payara Server:
- To deploy the Maven application to Payara Server, we will use the same existing application and create the new Payara Server configuration by selecting the Edit Configuration option:
- In the Run/Debug Configurations dialog, click +, expand the Payara Server node, and select Local:
-Sep-22-2020-12-13-25-76-AM.png)
- To add the Payara Server to the configuration, click the Configure button and browse the Payara Server installation path:
- Fix the artifacts warnings that appear at the bottom of the run configuration settings dialog, by clicking the Fix button:
- Select the sample-micro-app:war artifact for deployment to the Payara Server:
-Sep-22-2020-12-13-24-93-AM.png)
- Now fix the debugger related warning by pressing the Fix button, which updates the debugger settings in the domains.xml of the selected Payara Server’s domain:
-Sep-22-2020-12-13-27-79-AM.png)
- Now save the configuration:
-3.png)
- Click the Run or Debug button from top-right panel that starts the Payara Server and deploys the artifact to the server:
-Sep-22-2020-12-13-24-54-AM.png?width=340&name=Payara%20Platform%20Support%20for%20IntelliJ%20Plugin%20(Enterprise%20%26%20Community)-Sep-22-2020-12-13-24-54-AM.png)
- After application deployed to the Payara Server, IntelliJ starts a web browser and opens the application home page URL in the web browser:
- You may see the log in the Services → Payara Log window:
-Sep-22-2020-12-13-25-21-AM.png)

Currently, the Payara IntelliJ tools are only available for IntelliJ Ultimate Edition. In the upcoming release, Payara Micro tools will also be released for IntelliJ Community Edition with addition to some new cool features like Payara Micro Gradle project generator and Hot Deploy support.