i have multimodule maven project javafx , running. can create jar file containing classes executable through maven assembly, know packaged bundle works. conveniance want create native bundle/executable using javafx-maven-plugin
<profile> <id>build-installer</id> <properties> <native.output.dir>${project.build.directory}/jfx/native/${project.build.finalname}</native.output.dir> <native.output.dir.app>${native.output.dir}/app</native.output.dir.app> <native.output.dir.security>${native.output.dir}/runtime/jre/lib/security</native.output.dir.security> <native.app.jar>${native.output.dir.app}/${project.build.finalname}-jfx.jar</native.app.jar> </properties> <dependencies> <dependency> <groupid>ch.sahits.game</groupid> <artifactid>openpatriciandisplay</artifactid> <version>${project.version}</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupid>com.zenjava</groupid> <artifactid>javafx-maven-plugin</artifactid> <version>8.1.2</version> <configuration> <mainclass>ch.sahits.game.openpatrician</mainclass> <verbose>true</verbose> </configuration> <executions> <execution> <phase>package</phase> <goals> <goal>native</goal> </goals> </execution> </executions> </plugin> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-antrun-plugin</artifactid> <version>1.7</version> <executions> <execution> <id>create zip archive</id> <phase>install</phase> <goals> <goal>run</goal> </goals> <configuration> <target> <echo>creating self-contained zip</echo> <zip destfile="${project.build.directory}/openpatrician-${project.version}.zip" basedir="${native.output.dir}" /> </target> </configuration> </execution> </executions> </plugin> </plugins> </build> </profile>
this works fine on windows, creates exe file can run. executing same thing on linux, maven runs through executable fails start these 2 messages:
openpatriciandisplay-0.5.0-snapshot no main class specified
openpatriciandisplay-0.5.0-snapshot failed launch jvm
taking @ cfg files of windows , linux bundle shows different. when replacing linux 1 one windows different errors created. not think fact different cause. creating single module javafx demo app plugin on linux works. figure out if maven plugin or underlying packager, tried following ant examples. hello world example works fine (chapter 10.4.1) when trying example external jar files (chapter 10.4.3) build fails:
build failed
/home/andi/eclipse/intellij/jdk1.8.0_60/demo/javafx_samples/src/ensemble8/build.xml:34: must specify @ least 1 fileset packed.
the build.xml
<?xml version="1.0" encoding="utf-8" ?> <project name="ensemble8 javafx demo application" default="default" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant"> <property name="java_home" value="/usr/lib/jvm/java-8-oracle"/> <path id="classpath"> <pathelement location="lib/lucene-core-3.2.0.jar"/> <pathelement location="lib/lucene-grouping-3.2.0.jar"/> <pathelement path="classes"/> </path> <property name="build.src.dir" value="src"/> <property name="build.classes.dir" value="classes"/> <property name="build.dist.dir" value="dist"/> <target name="default" depends="clean,compile"> <taskdef resource="com/sun/javafx/tools/ant/antlib.xml" uri="javafx:com.sun.javafx.tools.ant" classpath="${java_home}/lib/ant-javafx.jar"/> <fx:application id="ensemble8" name="ensemble8" mainclass="ensemble.ensembleapp"/> <fx:resources id="appres"> <fx:fileset dir="${build.dist.dir}" includes="ensemble8.jar"/> <fx:fileset dir="lib"/> <fx:fileset dir="${build.classes.dir}"/> </fx:resources> <fx:jar destfile="${build.dist.dir}/ensemble8.jar"> <fx:application refid="ensemble8"/> <fx:resources refid="appres"/> </fx:jar> <fx:deploy outdir="." embedjnlp="true" outfile="ensemble8" nativebundles="all"> <fx:application refid="ensemble8"/> <fx:resources refid="appres"/> <fx:info title="ensemble8 javafx demo application" vendor="oracle corporation"/> </fx:deploy> </target> <target name="clean"> <mkdir dir="${build.classes.dir}"/> <mkdir dir="${build.dist.dir}"/> <delete> <fileset dir="${build.classes.dir}" includes="**/*"/> <fileset dir="${build.dist.dir}" includes="**/*"/> </delete> </target> <target name="compile" depends="clean"> <javac includeantruntime="false" srcdir="${build.src.dir}" destdir="${build.classes.dir}" fork="yes" executable="${java_home}/bin/javac" source="1.8" debug="on" classpathref="classpath"> </javac> <!-- copy resources build.classes.dir --> <copy todir="${build.classes.dir}"> <fileset dir="src/app/resources"/> <fileset dir="src/generated/resources"/> <fileset dir="src/samples/resources"/> </copy> </target> </project>
so looks examples not date java 1.8.0_60. difference build.xml example path java_home.
does have idea on: a) how approach issue ant build prove/disprove packager problem or b) better have insights might problem when running maven plugin.
environment: linux mint 17.2 kde
- jdk 1.8.0_60
- ant 1.9.3
- maven 3.0.5
- javafx-maven-plugin 8.1.4
this @ least partial answer issue build ant. turns out documentation outdated, figured out when taking @ ant task definition.
the <fx:jar>
elements requires more children work:
<fx:application id="ensemble8" name="ensemble8" mainclass="ensemble.ensembleapp"/> <fx:resources id="appres"> <fx:fileset dir="${build.dist.dir}" includes="ensemble8.jar"/> <fx:fileset dir="lib"/> <fx:fileset dir="${build.classes.dir}"/> </fx:resources> <fx:jar destfile="${build.dist.dir}/ensemble8.jar"> <fx:application refid="ensemble8"/> <fx:resources refid="appres"/> <fx:fileset dir="${build.classes.dir}"/> <!-- customize jar manifest (optional) --> <manifest> <attribute name="implementation-vendor" value="samples team"/> <attribute name="implementation-version" value="1.0"/> <attribute name="main-class" value="ensemble.ensembleapp" /> </manifest> </fx:jar>
especially <manifest>
, <fx:fileset>
. in place can create demo application native bundle executable.
edit: original issue javafx-maven-plugin
turns out problem in packager , lookup of configuration file. updating version 8.1.5
, adding <bundler>linux.app</bundler>
in <configuration>
workaround until issue fixed in jdk.-
Comments
Post a Comment