Payara Micro tools in Eclipse IDE

Creating A New Payara Micro Maven Application

  • Simply start up Eclipse IDE and then Choose File > New > Project from the main menu or press Ctrl+N to get the list of available projects:

Generate Payara Micro Application
  • Now, select the Payara Micro Project type to create the application:

Payara Micro Project
  • Select the destination folder, where the project will be generated. You may also use the default workspace location:

Project location
  • Enter the groupId, artifactId, etc to set up the project, and then click Next:

Enter GAV
  • Enter the Payara Micro application settings e.g context path of the application and Payara Micro version and click the Finish button:

Micro settings
  • The IDE creates the Payara Micro application using the Payara Micro maven archetype. As you can see, the project has a basic structure with src\main\java and src\main\webapp folders:

Micro project generated

Running The Payara Micro Application

Eclipse IDE needs a run configuration to build the artifacts and run/debug the Payara Micro application.

  • To create the Payara Micro Run configuration, select the Run > Run Configurations…​ from the main menu or toolbar:

Micro run configuration
  • The Payara Micro Run configuration dialog allows you to specify Payara Micro settings and environment variables. Note: Payara Micro setting specified by payara-micro-maven-plugin in the pom.xml takes precedence over the Run Configuration.

  • Select Payara Micro and double click it or click on the New configuration button to create a new configuration :

New run configuration
  • Associate the workspace project with the run configuration:

Associate project
  • Click the browse button and select the project from the Project Selection dialog:

Select the project
  • Enter the configuration name and choose the Build Artifact type & Reload Artifact action from the drop-down list:

Configuration name

By enabling the Auto Deploy or Hot Deploy feature, you may automate the manual deployment processes to boost the developers productivity. Auto Deploy will undeploy the existing application and redeploy the new application on every save action whereas the Hot Deploy mode reuses the existing application instance and updating its classloader & internal components relative to the modified source.

The Auto Deploy or Hot Deploy feature is only supported for the Exploded WAR artifact.
  • Add the configuration to Run and Debug menu and press the Apply button to save the configuration:

Add the Run and Debug configuration
  • To start the Payara Micro instance, run the Payara Micro Sample configuration from the toolbar or main menu:

Invoke run configuration
  • After running the Micro application, you may see the log in the OUTPUT window:

Payara Micro log
Payara Micro log

Similarly, to debug the Payara Micro application and attach the debugger to the application, instead of pressing the Run button, you can instead click Debug from similar locations and select the Payara Micro Sample configuration.