users@jaxb.java.net

Re: how to avoid duplicated (generated) classes?

From: Aleksei Valikov <valikov_at_gmx.net>
Date: Thu, 11 Dec 2008 15:28:32 +0100

Hi.

> I have some separate *.xsd structures, sharing all the same common *.xsd
> structure:
>
> A.xsd
> +- a-Types.xd
> +- common.xsd
> +- person.xsd
> +- adress.xsd
> +- ...xsd
>
> B.xsd
> +- b-Types.xd
> +- common.xsd
> +- person.xsd
> +- adress.xsd
> +- ...xsd
>
> What I finally want is the following packages, containing the (XJC)
> generated JAXB classes:
>
> com.mycompany.a
> com.mycompany.b
> com.mycompany.common
> com.mycompany.person
> com.mycompany.adress
>
> How can I avoid common.xsd, person.xsd and adress.xsd being generated
> multiple times?

You may be interested in separate compilation:

http://weblogs.java.net/blog/kohsuke/archive/2006/09/separate_compil.html

Here's an example:

http://download.java.net/maven/2/org/jvnet/jaxb2/maven2/maven-jaxb2-plugin-sample-episode/0.6.3/

Bye.
/lexi