Forum Stats

  • 3,840,384 Users
  • 2,262,598 Discussions
  • 7,901,256 Comments

Discussions

How to debug custom taglets?

I am attempting to write a custom taglet that emits a table of information about any javax.validation constraints in the enclosing class. I'm actually making progress on the implementation, to the point where I'm refining the information I get from the validator infrastructure.

However, what is really annoying is that the only way I can debug my implementation is by adding print statements.  There appears to be no obvious way to get to a point where I can step through my code in a debugger.

I found the "ToolProvider.getSystemDocumentationTool()" call, which at lets me run javadoc from a test class, but that just forks a process.  I suppose there is the "-J" command-line option.  Is my only choice to pass the "-Xdebug" and related options through this, and then run a remote debugger to connect to that port?  I tried passing "-J-Xdebug" as one of the parameters to the "run()" method, but that fails with "javadoc: error - invalid flag: -J-Xdebug".

This discussion has been closed.