So you need to do two things:
Deploy the code on the remote server. There are several ways:
- By integrating IDEA with your application server. Go to
Settings > Build, Execution, Deployments > Application Servers and add your application server there. Subsequently, you can use it as a deployment target. See the documentation . - Thanks to integration with the build tool, for example, maven has plugins for integration with many application servers. This works well when the build process is complicated.
- Manually β Simple copies of copy artifacts to the target application server and manual deployment.
Connect to the server in debug mode. To do this, you need to create a separate Run / Debug configuration in IDEA. If you have an Enterprise Edition, you can select a configuration template for your server (eq Tomcat Server) and select a server from the list of applications. In Community Edition, you must use the default Remote configuration.
When setup is complete, your workflow should be as follows:
- Make changes to the code;
- Reinstall it on the server (restart it if necessary);
- Run the debug configuration;
- Access to your application on the server (for example, through a browser) to run the required code to execute;
- Debug
source share