Creating a Remote Debug Target
This page describes how to set up standard IDE debugging tools to work with Atlassian plugins.
About Remote Debug Targets
Since plugin are deployed as part of another application (e.g., Confluence or JIRA), you can't just start your IDE in debug mode to debug the plugin. Your IDE must connect to the Atlassian application that hosts the plugin. In terms of your IDE configuration, the Atlassian host application needs to be configured as the remote debug target.
To connect to an Atlassian application, you need to connect to it in debug mode. With the SDK, you use the atlas-debug command to start the application in debug mode. By default, this command opens port 5005 as the debug port, the default for Java debugging. But you can specify another using the
--jvm-debug-port parameter. When setting up your debug target, configure this port value as the debug port, as described below
Creating a remote debug target in IDEA
- From the IDEA main menu, click Run > Edit Configurations.
- Click the plus button and choose Remote.
The new remote target configuration appears with default settings, including a default debug port of 5005. If you start the Atlassian application using the default settings for the
atlas-debugcommand, you do not need to change the default target values.
- Enter a descriptive name for your profile in the Name field and click OK. (Or click the Debug button if you created your profile from the Run > Debug menu.)
If you have not already done so, start the Atlassian application using the
atlas-debugcommand. For example:
- When the Atlassian application finishes starting up, go to Run > Debug and choose your new remote target profile.
You can now attempt to use your plugin in the Atlassian application to generate and receive debugging information in IDEA.
Creating a remote debug target in Eclipse
- From the Eclipse main menu, click Run > Debug Configurations.
- Double-click Remote Java Application.
- In the Name field, enter a descriptive name for your profile.
- Set the Port field to 5005, or the port number you will use to start the Atlassian application in debug mode.
- Click Apply to save your configuration, or just Debug to save your configuration and start debugging.
You can now start the Atlassian application in debug mode and connect to it from Eclipse.