Debugging Clover
Debugging Ant plugin
- Create "Remote" run configuration in IDEA.
Export ANT_OPTS, e.g.:
export ANT_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005
- Run 'ant'. Attach remote debugger in IDEA.
Debugging Maven plugin
- Create "Remote" run configuration in IDEA.
Export MAVEN_OPTS, e.g.:
export MAVEN_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005
- Run 'mvn'. Attach remote debugger in IDEA.
Debugging Eclipse plugin
- Create "Remote" run configuration in IDEA.
Edit eclipse.ini and add options for remote debugging after the "-vmargs" flag, e.g.:
-startup [...] -vmargs -Dosgi.requiredJavaVersion=1.7 -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -XX:MaxPermSize=256m -Xms256m -Xmx1024m -Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
- Run Eclipse. Attach remote debugger in IDEA.
Debugging IDEA plugin
Debugging directly in IDE
- Add "Plugin" run configuration and set "Use classpath of module" to clover-idea.
Optional: setup alternative JRE.
Click "Debug".
In case you encounter this error while building a project in IDEA instance being debugged:Error:Internal error: (java.lang.ClassNotFoundException) clover.com.google.common.collect.Lists java.lang.ClassNotFoundException: clover.com.google.common.collect.Lists at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at com.atlassian.clover.idea.build.jps.CloverSerializerExtension.getGlobalExtensionSerializers(CloverSerializerExtension.java:50) ...
then extract all "clover/**" classes from clover-idea.jar into $IDEA_CACHES_DIR/plugins-sandbox/plugin/clover-idea/classes. A problem is caused by a fact that a build server process does not see third party JARs from the 'clover-idea' module. The IDEA_CACHES_DIR is base directory where is your`s Idea stores caches.
For Mac it's: ~/Library/Caches/IntelliJIdea14/plugins-sandbox/plugin/clover-idea/For Windows it's: ~/.IntelliJIdea/system/plugins-sandbox/plugins/clover-idea
Debugging in standalone IDEA
- Create "Remote" run configuration in IDEA.
Edit idea64.vmoptions (or idea.vmoptions) of your test IDEA instance and add options for remote debugging, e.g.:
-Xms128m -Xmx750m -XX:ReservedCodeCacheSize=240m -XX:+UseCompressedOops -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005
Run test IDEA instance. Attach remote debugger in developer IDEA.
In case you would like to debug the external build process (which is launched by IDEA), then add the following option to the idea.properties file:
-Dcompiler.process.debug.port=5006
External compiler process will pause until debugger is connected to specified port.