0

我已经阅读了文档,但找不到让它工作,我正在使用最新的 JDK/Eclipse/Debian。

这是我的 build.xml

<project name="PMRx" default="default" basedir="."
xmlns:fx="javafx:com.sun.javafx.tools.ant">

<property name="src.dir" location="src" />
<property name="build.dir" location="build" />
<property name="dist.dir" location="dist" />
<property name="docs.dir" location="docs" />
<property name="application.vendor.dir" location="Comelecinca" />
<property name="application.title.dir" location="PMRx" />
<property name="build.classes.dir" location="build/classes" />
<property name="certification.dir" location="/home/rafael/Workspace/Certification" />
<property name="application.title" location="Sistema de Monitoreo Remoto" />

<target name="default">

    <taskdef resource="com/sun/javafx/tools/ant/antlib.xml" uri="javafx:com.sun.javafx.tools.ant"
        classpath=".:/usr/lib/jvm/java-7-oracle/lib/ant-javafx.jar" />

    <!-- Details about application -->
    <fx:application id="PMRx" name="Sistema de Monitoreo Remoto"
        mainClass="pmrx.Ventana" />

    <!-- Define what auxilary resources are needed -->
    <fx:resources id="appRes">
        <fx:fileset dir="dist" includes="lib/*.jar" />
    </fx:resources>


    <fx:jar destfile="${dist.dir}/pmrx.jar">

        <!-- Define what to launch -->
        <fx:application refid="PMRx" />

        <!-- Define what classpath to use -->
        <fx:resources refid="appRes" />

        <manifest>
            <attribute name="Implementation-Vendor" value="${application.vendor}" />
            <attribute name="Implementation-Title" value="${application.title}" />
            <attribute name="Implementation-Version" value="1.0" />
        </manifest>

        <!-- Define what files to include -->
        <fileset dir="${build.classes.dir}" />
    </fx:jar>

    <fx:signjar keyStore="${certification.dir}/sopc.crt"
        destdir="dist" alias="comelecinca" storePass="951753" keyPass="951753">
        <fileset dir='dist/*.jar' />
    </fx:signjar>

    <fx:deploy outdir="${dist.dir}" embedJNLP="true"
        outfile="${application.title}">
        <fx:application refId="PMRx" />

        <fx:resources refid="appRes" />

        <fx:info title="Sample app: ${application.title}" vendor="${application.vendor}" />

        <!-- Request elevated permissions -->
        <fx:permissions elevated="true" />
    </fx:deploy>

</target>

这是我得到的错误:

BUILD FAILED
/home/rafael/Workspace/PMRx/build.xml:19: All filesets are empty.

这将对应于该行:

<fx:jar destfile="${dist.dir}/pmrx.jar">
4

1 回答 1

0

已解决:问题是我在 fx:jar 过程中指示要包含的文件的空路径。

澄清一下,令人困惑的是错误指向第 19 行。但它只是告诉整个 XML 块(从第 19 行开始)是错误所在,实际上问题出在一个内部部分,在这种特定情况下,问题是:

<fileset dir="${build.classes.dir}" />

我只是将 dir 的参数更改为我真正托管 .class 文件的位置,问题就解决了。

于 2013-03-20T14:43:19.713 回答