JavaRush /Java Blog /Random EN /IntelliJ IDEA User Guide. Application Server.
theGrass
Level 24
Саратов

IntelliJ IDEA User Guide. Application Server.

Published in the Random EN group
Application Servers
IntelliJ IDEA Ultimate поставляется с предустановленной поддержкой большинства популярных проприетарных и открытых serverов приложений, включая GlassFish, WebLogic, JBoss EAP, Wildfly, WebSphere, Tomcat, TomEE, Jetty, Geronimo, Resin и Virgo.
  1. Application Servers To set up a server in a development environment, open Settings → Application Servers and click the Add application server button . The development environment will automatically determine the version of the installed server and prompt you to choose which libraries to add to the list of dependencies if this server is used in the project. IntelliJ IDEA User Guide.  Application Server.  - 1
    • Web facet A very important thing when dealing with application servers is the Web facet . In it, the development environment stores the settings associated with the web server for each module in the project. These settings include installation descriptors and web resource roots, and are available under Project Structure → Modules and Project Structure → Facets . IntelliJ IDEA User Guide.  Application Server.  - 2
        Usually you don't need to configure all of this manually. The development environment itself finds the resource descriptors and root folders, and prompts you to add them to the settings.
        • Artifacts Artifacts are what the development environment puts on the server when you run your web application using Run configurations . Each artifact has its name, type, directory in which it is built, and build type ( Web Application: Archive, Web Application: Exploded, EJB Application: Archive, EJB Application: Exploded, etc.). To set up artifacts, open Project Structure → Artifacts . IntelliJ IDEA User Guide.  Application Server.  - 3
            If you're using the Maven or Gradle build systems , you don't need to configure artifacts manually. The development environment automatically synchronizes them with the settings of the artifacts defined in the build configuration files.
            • Run settings The Run configuration determines how the artifact will be uploaded to the server. I ntelliJ IDEA supports two types of launch settings - local ( Local ) and remote ( Remote ). When run locally, a new server instance is started and the artifact is placed on it. When launched remotely, the artifact is laid out on an already running remote server. IntelliJ IDEA User Guide.  Application Server.  - 4
                Each application server can have a different set of parameters in the Run configuration . IntelliJ IDEA User Guide.  Application Server.  - 5
                  One important setting here is the On 'update' action , which determines how to update your application on the server when you want to push a new version by pressing Ctrl + F10 ( Cmd + F10 for Mac ). Depending on what you choose, the development environment can update resources, update classes and resources ( update resources ), redeploy the entire application ( update classes and resources ), or restart the server ( restart the server ). If you don't want a dialog box to pop up every time you start the project with a choice of how to update your project on the server, you can uncheck Show dialogin the settings, which will save you a lot of time if you often restart your project. Another important setting is On frame deactivation , which determines how to update your application on the server when you switch from a development environment (to a browser, for example). Depending on what you choose, the development environment can update resources, update classes and resources, or do nothing at all. This way, every time you switch to the browser, your project can be automatically uploaded to the server. Keep in mind that the option to update classes and resources is only available if your artifact is not an archive ( Exploded ). For archives, use HotSwap . By default, the development environment starts the application server using that JRE version.what is configured for your project. But you can choose any of the installed ones. An important part of any launch configuration is pushing the artifact to the server. IntelliJ IDEA User Guide.  Application Server.  - 6 By default, the development environment automatically collects artifacts before uploading them. But you can override this behavior in the Before launch tab of the Run configuration window . In the remote launch settings, you can also specify the address and port number of your server to which you want to upload the project. IntelliJ IDEA User Guide.  Application Server.  - 7
                  • Launching and Debugging the Application Once you have created the launch settings, you can launch your application with or without the debugger using the toolbar buttons, or the keyboard shortcuts Shift + F10 to launch without the debugger, and Shift + F9 with the debugger. IntelliJ IDEA User Guide.  Application Server.  - 8
                    • Update and HotSwap When you want to make changes to the code of an already running application, we recommend using the Update function, available via the keyboard shortcut Ctrl + F10 ( Cmd + F10 for Mac ). As already noted, it is only available if your artifact is not an archive. Depending on your choice, the upgrade may either re-upload resources or re-upload classes and resources. If the update is run in debug mode, it uses HotSwap mode . Otherwise, Hot redeployment is used. IntelliJ IDEA User Guide.  Application Server.  - 9
                        If your artifact is an archive, you can only rely on HotSwap to automatically be used in debug mode.
                        • Building artifacts In order to build the artifacts of your project, you need to run Build → Build artifacts in the development environment . IntelliJ IDEA User Guide.  Application Server.  - 10
                          • Application Server Tool Window Each build configuration is displayed in the Application Server Tool window, along with the server and artifact types. Also, this window can be useful when starting/stopping the server and uploading/deleting/configuring artifacts. IntelliJ IDEA User Guide.  Application Server.  - eleven
                            We also recommend that you study Getting Started with Java EE 7 and GlassFish 4.0, which describes how to create, configure, deploy and debug Java EE 7 applications on the GlassFish 4.0 application server . Original article
                            Comments
                            TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
                            GO TO FULL VERSION