I've just started with this but I'm able to launch the standalone version of Confluence in a remote debugging mode through the following steps:
1) Specify the following in the environment variables (Windows):
JAVA_OPTS = -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,suspend=y,server=y
2) Create a project in Eclipse, i.e. "Confluence", and on its Properties page, Java Build Path, Libraries tab click the Add External Jars... button and bring in all the jar files in the confluence/WEB_INF/lib directory
3) Import the source of any code you expect to be debugging during your session as well. Ensure the source package names match those of the ones used in Confluence.
4) Select your Confluence project in Eclipse and then via the menus go Run | Debug... In the window that pops up, select the Remote Java Application in the tree on the left and then click the New button.
5) The following values should be set:
Project: <your project name>
Connection Type: Standard (Socket Attach)
Host: localhost
Port: 8000
6) Click Apply and close the window.
7) Set any breakpoints in your source or exception handlers as appropriate and then execute the Confluence startup.bat launcher.
6) Tomcat will try to startup and then seem to hang, it is waiting for the debugger to communicate with it so go back to Eclipse and launch the debugger using your new configuration you just created. Tomcat & Confluence should then continue to boot.
7) Exercise Confluence to get to invoke your relevant plugin and Eclipse should jump in when it hits your breakpoint or exception.
- - - -
If anyone knows more, I'd like to know how to reference ALL the altassian class files in the Eclipse project since Eclipse seems to prefer .jar files.
I'd also like to avoid setting the environment variable in my system by having two separate startup.bat files, one that operates normally and another that inserts the java VM arguments without going through an environment variable..any suggestions?
Enjoy,
Brian