Ant 命令“war”失败,并出现错误“jvxml.xml.lib 不表示 zip 文件集或文件集”

问题描述 投票:0回答:1

我正在尝试运行 JVoiceXML 演示,但我对所有这些新技术都很陌生。我成功运行了演示,但 servlet 除外(其中您必须使用 tomcat。问题是:当我尝试“ant war”时,出现错误: “构建失败 C:\Users 904778\JVoiceXML\V1\demo\org.jvoicexml.demo.helloworldservletdemo uild.xml:113: jvxml.xml.lib 不表示 zipfileset 或 fileset"

这是我的 build.xml :

<project name="HelloWorldServlet" default="war" basedir=".">
    <description>
This file builds the 'Hello world' demo for JVoiceXML for a servlet container.

This demo consists of two servlets. The 'HelloWorldServlet' as the initial
servlet greets the user and passes a goodbye message to the next servlet,
the 'GoodbyServlet'.

You will need a servlet container, i.e. tomcat, to run this demo.

You will need to adapt the settings for your servlet container in the file
../personal-props/ant.properties.
Call target checkJEE to check the current settings.

I order to run the demo you will first have to call
ant war
to create a deployable war file. After the installation in you sevlet
container, call
ant run
to run the client.
    </description>

    <!-- allow the user to override setting in an own propertiesfile. -->
    <property file="../personal-props/ant.properties" />
    <property file="../config-props/ant.properties" />

    <!-- Load the settings for 3rdparty libraries -->
    <import file="3rdparty-libs.xml" />

    <target name="-setup" depends="-local-3rdparty-setup">
        <!-- The component built here-->
        <property name="component"
            value="org.jvoicexml.demo.helloworldservletdemo"/>
        <property name="component.path"
          value="org/jvoicexml/demo/helloworldservletdemo"/>

        <property name="src" value="src" />
        <property name="build" value="classes" />
        <property name="config" value="config" />
        <property name="dist" value="${jvxml.core.dir}/dist" />

        <property name="dist.war" value="${dist}/${component}.war" />

        <property name="optimize" value="off" />
        <property name="debug" value="on" />

        <!-- the used class path -->
        <path id="build.classpath">
            <fileset refid="log4j.lib" />
            <fileset refid="servlet.lib" />
            <path refid="jvxml.core.lib" />
        </path>

        <path id="run.classpath">
            <fileset refid="log4j.lib" />
            <fileset refid="rhino.lib" />
            <path refid="jvxml.core.lib" />
        </path>
    </target>

    <target name="-init" depends="-setup">
        <mkdir dir="${build}" />
    </target>

    <target name="-checkJVoiceXML">
        <available classname="org.jvoicexml.JVoiceXml" property="jvoicexml.present" classpathref="build.classpath" />
        <fail unless="jvoicexml.present">
Cannot find jvoicexml libraries needed to build this demo.
Build this jar from the main project first.
    </fail>
    </target>

    <target name="checkJEE" description="Check JEE library settings" depends="-init">
        <available classname="javax.servlet.http.HttpServlet" property="servlet.available">
            <classpath>
                <fileset refid="servlet.lib" />
            </classpath>
        </available>
        <fail unless="servlet.available">
Cannot find servlet libraries at '${servlet.lib.dir}'.
Adapt the settings for your servlet container in the file
../personal-props/ant.properties.
      </fail>
        <echo message="servlet.lib.dir = '${servlet.lib.dir}' usable:${servlet.available}" />
    </target>

    <target name="clean" description="Remove all compiled and distribution files">
        <delete dir="${build}" />
        <delete file="${jar.file}" />
        <delete file="${war.file}" />
    </target>

    <target name="compile" depends="-init,-checkJVoiceXML" description="Compile the JAVA sources">
        <copy todir="${build}">
            <fileset dir="${config}">
                <include name="**/*.xml" />
                <include name="**/*.properties" />
                <include name="**/*.policy" />
            </fileset>
        </copy>
        <echo message="compiling with debug=${debug}, optimize=${optimize}" />
        <javac destdir="${build}" optimize="${optimize}" debug="${debug}"
            deprecation="on" includeantruntime="false">
            <src path="${src}" />
            <include name="**/*.java" />
            <classpath refid="build.classpath" />
            <compilerarg value="-Xlint:unchecked" />
        </javac>
    </target>

    <target name="war" depends="compile" description="Pack all compiled servlet files into a single war">
        <war destfile="${dist.war}" webxml="WebContent/WEB-INF/web.xml">
            <lib refid="log4j.lib" />
            <lib refid="jvxml.xml.lib" />
            <classes dir="${build}">
                <include name="**/*Servlet.class" />
            </classes>
            <classes dir="config">
                <include name="log4j.xml" />
            </classes>
            <fileset dir="WebContent">
                <include name="*.html" />
                <include name="META-INF/**" />
            </fileset>
        </war>

        <echo message="Install ${dist.war} to your servlet container!" />
        <echo message="Then call 'ant run' to run the client" />
    </target>

    <target name="run" description="Run the 'hello world servlet demo' demo" depends="compile">
        <java classname="org.jvoicexml.demo.helloworldservletdemo.HelloWorldDemo" fork="true">
            <jvmarg value="-Djava.security.policy=${build}/jvoicexml.policy" />
            <classpath>
                <path refid="run.classpath" />
                <pathelement path="${build}" />
            </classpath>
            <arg value="http://127.0.0.1:8080/helloworldservletdemo/HelloWorld" />
        </java>
    </target>

    <target name="checkstyle" description="Check for JVoiceXML coding standard" depends="compile, -initcheckstyle" if="checkstyle.present">
        <property name="checkstyle-target.dir" value="${dist}/checkstyle/${component}" />
        <mkdir dir="${checkstyle-target.dir}" />
        <property name="checkstyle.data" value="${checkstyle-target.dir}/checkstyle-data.xml" />
        <checkstyle config="${jvxml.core.dir}/etc/jvoicexml-checks.xml" failonviolation="false">
            <classpath>
                <pathelement path="${project.classpath}" />
                <pathelement location="${build}" />
            </classpath>
            <classpath refid="jvxml.core.lib" />
            <fileset dir="${src}">
                <include name="${component.path}/**/*.java" />
            </fileset>
            <formatter type="xml" tofile="${checkstyle.data}" />
        </checkstyle>
        <xslt style="${jvxml.core.dir}/etc/checkstyle-frames.xsl" in="${checkstyle.data}" out="${checkstyle-target.dir}/report.html">
            <param name="output.dir" expression="${checkstyle-target.dir}" />
        </xslt>
    </target>

    <target name="all" depends="run, war" description="create binaries" />
</project>

我真的很想找出问题所在,但我没有。有人可以帮助我吗?

我尝试查看每个文件夹以了解情况,在互联网上查看以了解 build.xml 文件,但一无所获。

PS:我需要这场战争才能将其部署到tomcat服务器上

java xml ant build.xml vxml
1个回答
0
投票

请勿尝试运行演示。此外,不要尝试使用 ANT。该项目现在已经在 Github 上并且可以运行了。用户指南没有提供那么多信息。

© www.soinside.com 2019 - 2024. All rights reserved.