Proper way of using Payara with IntelliJ Idea

Answered

Hi everyone,

I'm developing a web application using JSF, Spring, and Hibernate, packaged with Maven. The application is deployed on a full Payara 5.2024.x server.

Previously, I used Eclipse, where I had a Maven script that built the project and deployed it to the application server using the Cargo plugin. Now, after switching to IntelliJ, I'm trying to find the best way to run this application using either the Payara or GlassFish plugins. However, I haven't yet found a stable setup.

I've tried using both plugins, but they seem inconsistent. Sometimes the app deploys successfully, but at other times, IntelliJ cannot communicate with the server, claiming that the credentials are incorrect, even though they are correct.

Currently, I am using a technique similar to what I used in Eclipse: I use the Payara plugin to start and stop the server, and then I use a Maven run script to deploy the application. However, this method seems much slower than deploying the WAR file directly through IntelliJ.

Additionally, I'm unclear on how IntelliJ builds the app when deploying it as an artifact with the Payara plugin. For some projects, it seems to deploy a build that was not created with the corresponding Maven profile resulting in depeding profile variables not being applied in web.xml.

Can someone guide me to the most efficient way to deploy/redeploy an app on the Payara server using IntelliJ? 
I feel like I'm missing something here. 

 

Thank you for your help.

1
1 comment

Hello Adrian,

General information about deployment could be found in related article: https://www.jetbrains.com/help/idea/creating-and-running-your-first-jakarta-ee-application.html#war

IDE creates project configuration basing on pom.xml file, builds and creates Artifact that is used for deployment.

If it's not build correctly or there are some issues while deployment - they should be investigated. Probably there is some misconfiguration of bug in IDE.

0

Please sign in to leave a comment.