IntelliJ IDEA Ultimate comes with out-of-the-box support for the most popular enterprise and open-source application servers, including GlassFish, WebLogic, WebSphere, Tomcat, and more.
In this section:
To configure a server in IntelliJ IDEA, open Application Servers page of the Settings dialog, and click . The IDE automatically detects the server version, and suggests you to choose which libraries to add to the dependencies, when the server is used in project.
Refer to the section Defining Application Servers for details.
One important thing when working with an application server, is the Web facet. This is where the IDE stores web settings for each module of your project. These settings include the deployment descriptors and web resources roots, and are available in the Modules and Facets pages of the Project Structure dialog.
Usually you don’t need to configure the Web facet manually. The IDE automatically detects the descriptors and web resource roots and offers to configure it.
An artifact is what the IDE deploys to a server, when you run an application via a run/debug configuration. Each artifact has its name, type, output directory, layout and type (Web Application: Archive, Web Application: Exploded, EJB Application: Archive, EJB Application: Exploded, etc). You can configure artifacts in the Artifacts of the Project Structuredialog.
A server run configuration defines how the artifacts are deployed to the servers. IntelliJ IDEA has two types of the server run configurations: Local and Remote. The Local run configuration starts a new instance of the server and deploy artifacts there. The Remote run configuration deploys the artifacts to an already running standalone server.
Refer to the run configurations reference for servers under Run/Debug Configurations.
Each application server may have a different set of parameters in a Run configuration:
- One important parameter here is On 'update' action, which defines how to update the application, when you use the Update action via Ctrl+F10. Based on your choice, the IDE can update resources, update classes and resources, or redeploy or restart the server.
- Turn off the Show dialog checkbox, if you don’t like to see the dialog every time you update an application. This is a great time-saver when you update your application frequently.
- Another important parameter is On frame deactivation check box, which defines how to update an application, when you switch from IntelliJ IDEA, say, to a browser. Based on this setting, IntelliJ IDEA can update resources, update classes and resources, or do nothing. This setting may be very useful, when you’d like to have your application updated automatically each time when you switch to a browser.
- Keep in mind that update resources and update classes and resources options are available only for the Exploded artifact type. For the Archive artifact type use the common HotSwap.
- By default, IntelliJ IDEA runs application servers using the project JRE. However, you can always choose to use an alternative JRE.
- An essential part of any Run configuration is the artifacts deployment:
By default, IntelliJ IDEA automatically builds the artifacts before deploying. However, you can change it using the Before launch group in the run configuration dialog for your server.
A Remote run configuration has additional parameters such as the host/port of the server you’d like to deploy your artifacts to.
Running and debugging applications
Once a Run configuration is created, you can run or debug your application via the main toolbar buttons /, menu Run , or the shortcuts Shift+F10/Shift+F9.