users@jaxb.java.net

Re: JAXB compilation plugin

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Tue, 28 Feb 2006 12:13:23 -0800

Malachi de Ælfweald wrote:
> I'm glad to hear that this was done. I had recently just wrote one of my own
> because of the others I found not working. I had emailed Kohsuke about it,
> but didn't think about getting it up on java.net.

My sincere apologies for not being able to respond to it quickly. I'm
really sorry to cause the duplication of work.


> A quick question... Why did you have it interact with the XJC2Task instead
> of with Driver.run?

I suggested that eventually it should be possible to read in the plugin
configuration directly into Ant task definition, so you can write:

             <plugin>
                 <groupId>com.sun.tools.xjc.maven2</groupId>
                 <artifactId>maven-jaxb-plugin</artifactId>
                 <executions>...</executions>
                 <configuration>
                    <xjc ant task definition here />
                 </configuration>

... instead of defining its own syntax for the maven plugin. I plan to
look at the code to see how hard it is to do this, and hopefully I
should be able to submit a patch for a consideration of Jonathan.

I think reusing the same syntax would reduce the amount of work, as well
as being easier to understand.

> Also, one of the things that I implemented that might be useful for yours
> was adding codemodel extensions so that we could add custom 'implements',
> etc. The specific one that I did added a .toJAXBElement() method to
> whichever class ObjectFactory created an JAXBElement for....

Reusing Ant syntax should let one specify plugins, which I assume is
what you are talking about, right?

> Is there actually a dev.java.net project for this specific piece? I would be
> more than willing to be a contributor on it.

Yes. The code lives in a part of the JAXB project CVS repository. It's
up to Jonathan to decide if he wants to have other developers, and if
he's OK, I can grant necessary roles to Malachi.

(Jonathan, in case you don't know, Malachi has been around the JAXB
mailing list for a long time, and he knows a good deal about JAXB.)

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com