Deployment 为javafx应用程序创建捆绑jar

Deployment 为javafx应用程序创建捆绑jar,deployment,ant,javafx,bundle,jar-with-dependencies,Deployment,Ant,Javafx,Bundle,Jar With Dependencies,我正在尝试使用ANT将所有库捆绑到一个jar中,用于我的JavaFX应用程序。我发现了以下问题,但无法使其发挥作用。通过添加,可以在中添加库*.jar文件: 生成的jar现在包含包含所有库的libs目录 我如何告诉生成的jar应该在jar内部而不是外部查看libs目录 谢谢 谢谢你,杰维西 我无法使这些库中的任何一个与JavaFX一起工作。但我发现: 所以在之后,我解包并重新打包所有库,它就可以工作了 <target name="do-deploy-bundle" depends="ini

我正在尝试使用ANT将所有库捆绑到一个jar中,用于我的JavaFX应用程序。我发现了以下问题,但无法使其发挥作用。通过添加
,可以在
中添加库*.jar文件:

生成的jar现在包含包含所有库的
libs
目录

我如何告诉生成的jar应该在jar内部而不是外部查看
libs
目录

谢谢

谢谢你,杰维西

我无法使这些库中的任何一个与JavaFX一起工作。但我发现:

所以在
之后,我解包并重新打包所有库,它就可以工作了

<target name="do-deploy-bundle" depends="init-properties, do-deploy-dist">
    <property name="tmp.file" value="temp_final.jar"/>

    <delete file="${dist.dir}/${app.jar}" />
    <delete dir="${bundle-dist.dir}"/>
    <mkdir dir="${bundle-dist.dir}"/>

    <jar destfile="${bundle-dist.dir}/${tmp.file}" filesetmanifest="skip">
        <zipgroupfileset dir="${dist.dir}" includes="*.jar" />
        <zipgroupfileset dir="${dist.dir}/libs" includes="*.jar" />

        <manifest>
            <attribute name="Implementation-Vendor" value="${app.vendor}"/>
            <attribute name="Implementation-Title" value="${app.name}"/>
            <attribute name="Implementation-Version" value="${app.version}"/>
            <!--<attribute name="Main-Class" value="com.javafx.main.Main" />-->
            <attribute name="Main-Class" value="com.poterion.texovac.application.Main" />
            <attribute name="JavaFX-Version" value="2.2" />
            <attribute name="JavaFX-Feature-Proxy" value="None"/>
            <!--<attribute name="JavaFX-Application-Class" value="com.poterion.texovac.application.Main" />-->
            <attribute name="Created-By" value="JavaFX Packager" />
        </manifest>
    </jar>

    <zip destfile="${dist.dir}/${app.jar}">
        <zipfileset src="${bundle-dist.dir}/${tmp.file}" excludes="META-INF/*.SF, META-INF/*.DSA, META-INF/*.RSA , META-INF/maven/**,META-INF/*.txt" />
    </zip>

    <delete file="${bundle-dist.dir}/${tmp.file}" />
    <delete dir="${bundle-dist.dir}"/>
</target>

请参阅:。
build
  |-- classes (compiled classes)
  |-- libs (external libraries)
  |-- src (sources)
<target name="do-deploy-bundle" depends="init-properties, do-deploy-dist">
    <property name="tmp.file" value="temp_final.jar"/>

    <delete file="${dist.dir}/${app.jar}" />
    <delete dir="${bundle-dist.dir}"/>
    <mkdir dir="${bundle-dist.dir}"/>

    <jar destfile="${bundle-dist.dir}/${tmp.file}" filesetmanifest="skip">
        <zipgroupfileset dir="${dist.dir}" includes="*.jar" />
        <zipgroupfileset dir="${dist.dir}/libs" includes="*.jar" />

        <manifest>
            <attribute name="Implementation-Vendor" value="${app.vendor}"/>
            <attribute name="Implementation-Title" value="${app.name}"/>
            <attribute name="Implementation-Version" value="${app.version}"/>
            <!--<attribute name="Main-Class" value="com.javafx.main.Main" />-->
            <attribute name="Main-Class" value="com.poterion.texovac.application.Main" />
            <attribute name="JavaFX-Version" value="2.2" />
            <attribute name="JavaFX-Feature-Proxy" value="None"/>
            <!--<attribute name="JavaFX-Application-Class" value="com.poterion.texovac.application.Main" />-->
            <attribute name="Created-By" value="JavaFX Packager" />
        </manifest>
    </jar>

    <zip destfile="${dist.dir}/${app.jar}">
        <zipfileset src="${bundle-dist.dir}/${tmp.file}" excludes="META-INF/*.SF, META-INF/*.DSA, META-INF/*.RSA , META-INF/maven/**,META-INF/*.txt" />
    </zip>

    <delete file="${bundle-dist.dir}/${tmp.file}" />
    <delete dir="${bundle-dist.dir}"/>
</target>