users@jaxb.java.net

RE: Maven 2 Jaxb2 plugin use

From: Jonathan Johnson <jonjohnson_at_mail.com>
Date: Mon, 10 Apr 2006 23:58:02 -0400

Yes - skip unnecessary compilation, which is crucial.

Good idea to test for pom.xml dependency, specifically the configuration
changes. Maven detects the jaxb-api and jaxb-impl jars as a dependency list
so I'll also carry those through to the xjc.

I have addConfiguredDepends and addConfiguredProduces working. Just doing
some testing. Should be checking in an update tomorrow.

I'll see if I can also post the updated jar to jaxb/www/jaxb-maven2-plugin
as you suggested.


-----Original Message-----
From: Kohsuke Kawaguchi [mailto:Kohsuke.Kawaguchi_at_Sun.COM]
Sent: Monday, April 10, 2006 9:21 PM
To: users_at_jaxb.dev.java.net
Subject: Re: Maven 2 Jaxb2 plugin use

Jonathan Johnson wrote:
> Should I be using the following XJC2Task method to ensure it will
determine
> if the generation is necessary?
>
> XJC2Task.addConfiguredDepends(dependencies);
> XJC2Task.addConfiguredProduces(products);

Yes, if possible, you should consider filling them, as that allows XJC
to skip unnecessary compilation, which is crucial, IMO.

> I was thinking of just adding all the schemas and binding files to the
> addConfiguredDepends
> and adding the *.java in the generated package directory to
> addConfiguredProduces

Yes, that should do. You might also add "pom.xml" in the depends list,
so that if people change pom.xml it will trigger recompilation.

> Or is there a better way? We could do the calculation in the maven
plugin,
> but thought it better to delegate to the existing code in XJC2Task.

Ideally XJC should compute all such dependencies by itself. Ideally. For
now, please fill in addConfiguredDepends and addConfiguredProduces.


--
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com