users@jaxb.java.net

Re: Getting Simple Plugins to work

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Wed, 08 Mar 2006 15:06:31 -0800

dustin hunter wrote:
> So I started by writting a stubbed out plugin that just prints the method
> name. I just want to see that the plugin is getting executed. I then compile
> and jar it up according to the documentation and create a META-INF/services
> file called com.sun.tools.xjc.MyPlugin which contains the fully qualifed
> name of my plugin.

Ah, that's the problem, I think. The META-INF/services file must be
named as:

   META-INF/services/com.sun.tools.xjc.Plugin

and this file has to have your plugin class name in it. This is the
standard META-INF/services idiom.

Also you can set the "com.sun.tools.xjc.Options..findServices" system
property to true to see the debug output from how XJC is locating services.

Also check out other plugins in jaxb2-commons. Those plugins tend to be
simpler, so it might suit you better as an example.

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com