Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Intellij deploy to JBoss?

I finally have my application in IntelliJ and deploying to JBoss. I'd like to get hot deploy working but it looks like I need to understand how IntelliJ and JBoss interact.

When I build my project in IntelliJ and then start JBoss, the ear file does not appear in the deploy directory so I assume that there is some magic that IntelliJ does so that JBoss reads from a different folder. What is happening during this step?

Thanks :)

like image 680
Rachel Avatar asked Dec 20 '10 18:12

Rachel


People also ask

How does JBoss integrate with Intellij?

You can type cmd + shift + a ( or ctrl + shift + a on windows ) to access the action pop-up, then type something like add server and choose the 'server' option. This will bring you to the application servers panel of the preferences where you can add ( + ) the JBoss server.

How can you deploy an application in JBoss?

To install and deploy the mid tier with JBoss Application Server, complete the following steps: Install JBoss Application Server. (For instructions, see the appropriate JBoss Application Server documentation.) Deploy the WAR file by either extracting the WAR file or using the JBoss Admin Console.

How do I deploy in Intellij?

on the main toolbar or press Ctrl+Alt+S to open the Settings/Preferences dialog, and choose the Deployment page (you can access the same page by choosing Tools | Deployment | Configuration from the main menu).


2 Answers

I know this is an old and apparently answered question, but unfortunately the links provided in the accepted answer didn't give me the simple details I was looking for. For anyone also trying to understand how IntelliJ IDEA deploys your exploded war to JBoss without copying files to the deployments folder, here's what I've found while deploying locally from IDEA 14 (EAP) to JBoss 7.1.1.Final:

  • After you've created an "exploded war" artifact for your project (or it has automatically been created for you), IDEA will build your provided sources and place the output in the directory set in the artifact options (you can change this setting to place the output inside the deployments folder inside your jboss installation).
  • IDEA will update your JBoss configuration file (/standalone/configuration/standalone.xml) and add a "deployment" node inside the deployments section. This entry simply defines a name, a runtime name and the exploded war root folder for your project, which will point to the output directory of your artifact set in IDEA.
  • When JBoss is started (either manually or from your run/debug configuration in IDEA), it will automatically deploy your artifact. Be warned that if your files are in the output directory of your project and you clean it, JBoss will still try to find the directory, thus encountering errors in your next attempt to start it: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Failed to mount deployment content, Failed to process phase STRUCTURE of deployment and java.io.FileNotFoundException to name a few.
like image 110
Herick Avatar answered Sep 24 '22 14:09

Herick


Please refer to the documentation.

Basically, you need an exploded Artifact configuration with the directory name ending with .ear.

Build | Make performs hot deployment as well as Update action (which is configurable and can update only resources, resources and classes, optionally redeploy or restart the server).

Instead of copying your application to JBoss, IDEA runs it with appropriate parameters so that it uses Artifact directory instead. Configuration is very flexible and you can just change the artifact directory location to reside under JBoss directory.

like image 31
CrazyCoder Avatar answered Sep 22 '22 14:09

CrazyCoder