A18.4 HOW TO DEBUG YOUR PLUGIN
You need to have the following installed on your machine
- Intellij (version 12 and forward) with SEAMCAT setup and running in debug mode;
- The source code of the plugin project;
- Â The plugin .jar file installed in the running SEAMCAT application.
To debug the plugin code the jar file of the plugin and the source code must be associated with the SEAMCAT project. This is done by doing the following steps:
- From the SEAMCAT intellij project open the project structure (menu "File -> Project Structure ...");
- From the "Project Settings" choose "Libraries";
- Choose "Attach files or Directories" (by clicking the green plus sign on the right);
- First attach the .jar file of the plugin (this will attach the binary code of the plugin to your SEAMCAT project);
- Second attach the root directory of the plugin project (this will attach the source code of the plugin).
Figure 510: How to associate a plugin .jar to its source code
You should now be able to open the plugin class from the SEAMCAT project. Press Ctrl-n and type the name of the plugin class you want to debug (note that the auto-complete may not work, so you need to write the full filename). This should open the source file of the plugin class and breakpoints should be possible to set normally.
Notice that if you make changes to this file it will be out of sync with the binary file running from within SEAMCAT. So eventual bugs to be fixed will have to be done inside the plugin project AND then subsequentially built and installed in SEAMCAT to be tested.