我尝试使用self-contained copy of my JavaFX application生成包含Oracle JavaFX Ant fx:deploy
Task的.deb
文件。
I've followed the samples on official documentation和我的pom.xml
配置如下所示:
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>install</phase>
<configuration>
<target xmlns:fx="javafx:com.sun.javafx.tools.ant">
<manifestclasspath property="manifest.classpath" jarfile="${application.dist}/${jar.name}.jar">
<classpath>
<path id="build.classpath">
<fileset dir="${application.dist}/lib">
<include name="*.jar"/>
</fileset>
</path>
</classpath>
</manifestclasspath>
<taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
uri="javafx:com.sun.javafx.tools.ant"
classpath="${project.basedir}:${javafx.lib.ant-javafx.jar}"/>
<fx:preferences id="fxPreferences" shortcut="true" menu="true" install="true"/>
<fx:jar destfile="${application.dist}/${jar.name}.jar">
<fx:application name="${application.title}"
mainClass="${application.main.class}"/>
<manifest>
<attribute name="Class-Path" value="${manifest.classpath}"/>
</manifest>
<!-- The target/classes folder which contains all resources and
class files -->
<fileset dir="${project.build.outputDirectory}"/>
</fx:jar>
<fx:resources id="appRes">
<fx:fileset dir="${classes.dir}" includes="*.ico"/>
<fx:fileset dir="${classes.dir}" includes="*.bat"/>
<fx:fileset dir="${classes.dir}" includes="*.conf"/>
<fx:fileset dir="${application.dist}" includes="*.jar"/>
<fx:fileset dir="${application.dist}" includes="lib/*.jar"/>
<fx:fileset dir="${java.home}/lib/ext" includes="sunjce_provider.jar" type="data"/>
<fx:fileset dir="${java.home}/bin" includes="java.exe" type="data"/>
<fx:fileset dir="${java.home}/bin" includes="javaw.exe" type="data"/>
<fx:fileset dir="${extra.dir}" includes="**"/>
</fx:resources>
<!-- This same fx:deploy task MUST be able to generate a Windows .EXE bundle as well -->
<fx:deploy verbose="true" embedJNLP="false" extension="false" includeDT="false"
offlineAllowed="true" outdir="${application.dist}"
outfile="${bundle.name}" nativeBundles="all" updatemode="background">
<fx:application name="${application.name}" mainClass="${application.main.class}"/>
<fx:resources refid="appRes"/>
<fx:preferences refId="fxPreferences" shortcut="true" menu="true"/>
<fx:info title="${application.title}" vendor="${application.vendor}"/>
<fx:platform javafx="8.0+">
<fx:jvmarg value="-Djava.security.debug=sunpkcs11"/>
</fx:platform>
</fx:deploy>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
在构建结束时(mvn clean install
),.deb
文件在/target/dist/bundles
文件夹中正确生成。
但是当我使用dpkg -i
安装它时,我的应用程序将安装在/opt/${bundle.name}
。
DEB packaging options documentation表示默认安装位置为/opt
,但它不告诉我如何更改它。
我的问题是:如何设置其他安装路径以覆盖默认的/opt
值?
例如,如果我可以将其安装在/opt/company/apps/${bundle.name}
上,那就太棒了。
我已经了解了fx:deploy中fx:bundleArgument
的使用情况,它有固定的选项。但是没有关于安装路径的linux.*
选项。
环境信息: