Misleading error message for JavaBeautifier dependencies

The postprocessor org.eclipse.xpand2.output.JavaBeautifier comes with the plugin org.eclipse.xpand, but needs additional dependencies to work. Under the hood the beautifier leverages JDT, so the dependency to JDT is obvious. Normally the missing plugin dependencies can be easily derived from the error messages, since the package name of some missing class usually maps to the plugin identifier where the class resides. However, you might recognize the error message
java.lang.NoClassDefFoundError: org/eclipse/jface/text/BadLocationException
and think that the class must be in plugin org.eclipse.jface.text. But that’s not true, although there is of course a plugin org.eclipse.jface.text. Actually, class BadLocationException is in the plugin org.eclipse.text and is reexported from the JFace plugin.

The actual dependencies that have to be added when using the JavaBeautifiers are:

  • org.eclipse.jdt.core
  • org.eclipse.text
  • org.eclipse.core.resources
  • org.eclipse.core.runtime