Payara Platform

Payara Server Tools in IntelliJ IDEA

Using the Payara Tools, you can integrate Payara Server within the IntelliJ IDEA to streamline development workflows. This integration allows you to:

  • Start and stop the Payara Server from within the IDE

  • Define the Java runtime to be used by Payara Server

  • Deploy an application from within the IDE

Managing Payara Server from the IntelliJ IDE

  1. To manage Payara Server from the IntelliJ idea, first create the new Payara Server configuration by selecting the Edit Configuration option: image::intellij-plugin/payara-server/create-configuration.png[Create Configuration]

  2. In the Run/Debug Configurations dialog, click +, select the Payara Server: image::intellij-plugin/payara-server/create-server-configuration.png[Create Server configuration]

  3. In the newly created configuration:

    1. Set the goal to dev to deploy the application in development mode or start to start the server without dev mode.

    2. Specify the JDK or JRE path that Payara Server should use.

  4. Optionally, configure the application’s context path or exploded format. image::intellij-plugin/payara-server/app-configuration.png[App configuration]

  5. To add the Payara Server to the configuration, click the Payara Server Settings > Payara Home and set it to the Payara Server’s installation path you would like to add to the IDE. image::intellij-plugin/payara-server/payara-configuration.png[Payara configuration]

  6. Configure environment variables and system properties for the server. image::intellij-plugin/payara-server/env-server-properties.png[Env and Server properties]

  7. Define Maven properties used during the build. image::intellij-plugin/payara-server/maven-properties.png[Maven properties]

  8. Specify Maven tasks to run before launching the server. image::intellij-plugin/payara-server/before-launch-task.png[Before Launch Task]

  9. Click the Run or Debug button from top-right panel to start Payara Server, or start Payara Server in debug mode, which would allow you to debug deployed applications image::intellij-plugin/payara-server/run-server.png[Start the Payara Server]

  10. You can see the server log in the application build console window. image::intellij-plugin/payara-server/server-log.png[Payara Server log]

  11. After application deployed to the Payara Server, IntelliJ starts a web browser and opens the application context root in the web browser.

Deploy Applications in a Local Docker Container

The Payara Server tools for IntelliJ IDEA include Docker integration, making it seamless to deploy exploded applications to a Payara Server instance running within a local Docker container.

  1. Run the Payara Server Docker container using the following command:

    docker run -p 8080:8080 -p 4848:4848 -p 9009:9009 -v HOST_PATH:CONTAINER_PATH  payara/server-full:{page-version}

    Replace HOST_PATH with the actual host path and CONTAINER_PATH with the desired container path that must be the exploded application path or parent path of application.

    The HOST_PATH points to the location on your host machine, and CONTAINER_PATH is the corresponding location inside the container.

  2. Open Intellij IDEA Ultimate and first create the new Payara Server configuration by selecting the Edit Configuration option:

  3. In the Run/Debug Configurations dialog, click +, expand the Payara Server node, and select Remote.

  4. To add the Payara Server to the configuration, click the Configure…​ button and set it to the Payara Server’s installation path with the same version as the one running in the Docker container.

  5. For Docker integration, choose the "Docker Volume" option and provide the HOST_PATH (e.g., D:/test) and CONTAINER_PATH (e.g., /mnt/test) mapping details.

    This mapping should align with the exploded application path or parent path of exploded application.

  6. Navigate to the Deployment section and click on the + button to select Artifact…​.

  7. Click OK

  8. Click the Run or Debug button from top-right panel to deploy the application to the registered Payara Server docker instance.

Deploy Applications in a WSL Environment

Another noteworthy feature is the integration of the Payara Server Tools with Windows Subsystem for Linux (WSL).

This integration empowers developers to manage and deploy exploded applications to a Payara Server instance running within WSL.

Here’s how you can make use of this feature:

  1. Start the Payara Server instance within WSL:

    1. Run the following command to start the server:

      ./asadmin start-domain
    2. Set a password for the admin user:

      ./asadmin change-admin-password
    3. Enable secure admin:

      ./asadmin enable-secure-admin
    4. Restart the Payara Server domain:

      ./asadmin restart-domain
  2. Register the WSL-based Payara Server instance in the IntelliJ IDEA:

    1. Open Intellij IDEA Ultimate and first create the new Payara Server configuration by selecting the Edit Configuration option:

    2. In the Run/Debug Configurations dialog, click +, select the Payara Server node then go to Payara Server Settings and check the checkbox Remote.

    3. To add the Payara Server to the configuration, click the browse button in Payara Home field and set it to the Payara Server’s installation path running within WSL on your Windows machine.

    4. For WSL integration, choose the "WSL" option and make sure Use SSL Connection option is checked.

    5. Enter the host (fetched via the command hostname -I in WSL instance) and the necessary credentials.

    6. Click OK

    7. Click the Run or Debug button from top-right panel to deploy the application to the registered Payara Server WSL environment.

Back to Top