users@jaxb.java.net

maven 2 plugin, multiple schemas, single binding file

From: Stephen Parker <stevesp4644_at_yahoo.com>
Date: Thu, 19 Apr 2007 01:08:01 -0700 (PDT)

I have multiple schemas in a single directory that I wish to bind. I also have a single binding file for specifying the package locations of the generated code for each schema.

If I do

xjc.bat *.xsd -d someDir/java -b binding.xjb

all is fine. However the maven plugin seems to do the schemas individually using the same binding.xjb for each. As the binding.xjb contains entries that are not relevant to every schema I get an error:

[ERROR] [ERROR] "file:/C:/Finesse/trunk/schemas/SomeOther.xsd" is not a part of this compilation. Is this a mistake for "file:/C:/Finesse/trunk/schemas/Some.xsd"?
[ERROR] line 10 of file:/C:/Finesse/trunk/schemas/binding.xjb

At this point it is trying to bind Some.xsd; Some.xsd and SomeOther.xsd are present and have an entries in the binding.xjb:

    <jxb:bindings schemaLocation="Some.xsd" node="/xs:schema">
        <jxb:schemaBindings>
            <jxb:package name="com.foo.somepackage"/>
        </jxb:schemaBindings>
    </jxb:bindings>

    <jxb:bindings schemaLocation="SomeOther.xsd" node="/xs:schema">
        <jxb:schemaBindings>
            <jxb:package name="com.foo.someotherpackage"/>
        </jxb:schemaBindings>
    </jxb:bindings>

This seems very similar to the problem reported in issue 212 but the latest plugin does not fix the problem.

Is there any way around this? Could the error be replaced with a warning (urrgh)?

Thanks,

Steve.

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com