如何从xjc ant重新生成java类,而xsd是最新的

时间:2016-05-02 12:08:41

标签: ant xsd jaxb xjc

如果xsd是最新的,则xjc不会生成该类。

我希望总是生成类..

<target name="jaxbSource" description="Generate jaxb objects">

            <echo message="Generate jaxb objects for CategoryAPIRequest..." />
                <xjc source="2.0" schema="${basedir}/schemas/categoryAPI/CategoryAPIRequest.xsd" package="com.myrio.tm.company.categories.util.request"
                     destdir="${basedir}/src" binding="${basedir}/schemas/categoryAPI/binding.xml">
                    <produces dir="${basedir}/src" includes="**/*.java" />
                    <arg value="-extension" />
                </xjc> 

            <echo message="Generate jaxb objects for CategoryAPIReturn..." />
                <xjc source="2.0" schema="${basedir}/schemas/categoryAPI/CategoryAPIReturn.xsd" package="com.myrio.tm.company.categories.util.response"
                    destdir="${basedir}/src" binding="${basedir}/schemas/categoryAPI/binding.xml">
                    <produces dir="${basedir}/src" includes="**/*.java" />
                    <arg value="-extension" /> 
                </xjc> 

        </target>

- My Binding xml是:

<?xml version="1.0" encoding="UTF-8"?>
<jaxb:bindings xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" jaxb:version="2.1">
    <jaxb:globalBindings>
        <xjc:serializable/>
    </jaxb:globalBindings>
</jaxb:bindings>

0 个答案:

没有答案