0

您好,当我执行以下 ant 脚本时出现构建错误。有人可以帮我解决问题吗?

蚂蚁输出:

Buildfile: D:\workspace\Webformular2\WebContent\WEB-INF\XSD-Pfad.ant 

[delete] Deleting directory D:\workspace\Webformular2\WebContent\WEB-INF\src 
[mkdir] Created dir: D:\workspace\Webformular2\WebContent\WEB-INF\src xjc: 
[xjc] Consider using <depends>/<produces> so that XJC won't do unnecessary compilation
[xjc] Compiling file:/D:/workspace/Webformular2/WebCo ntent/WEB-INF/jaxb/antragsdaten.xsd and others

BUILD FAILED D:\workspace\Webformular2\WebContent\WEB-INF\XSD-Pfad.ant:11: java.lang.NoClassDefFoundError: javax/validation/constraints/NotNull

蚂蚁脚本

<project default="xjc">
        <delete dir="src"/>
        <mkdir dir="src" />
        <target name="xjc" description="JAXB Generation">
                <taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask">
                  <classpath>
                    <fileset dir="lib" includes="*.jar" />
                  </classpath>
                </taskdef>`
`
                <xjc destdir="src" extension="true">
                        <schema  dir="jaxb" includes="*.xsd"/>
                        <arg line="
                                        -XJsr303Annotations
                                        -XReplacePrimitives"/>
                </xjc>
        </target>
</project>`
4

2 回答 2

0

-------- 蚂蚁脚本 --------- <project default="xjc"> <delete dir="src"/> <mkdir dir="src" /> <target name="xjc" description="JAXB Generation"> <taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask"> <classpath> <fileset dir="lib" includes="*.jar" /> </classpath> </taskdef> <xjc destdir="src" extension="true"> <schema dir="jaxb" includes="*.xsd"/> <arg line=" -XJsr303Annotations -XReplacePrimitives"/> </xjc> </target> </project>

于 2013-11-05T08:16:03.833 回答
0

您的 lib 目录中缺少“validation-api.jar”。

参考:

于 2013-11-05T16:44:44.280 回答