有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java JavaFX使用maven在Linux下构建Windows自包含应用程序包

我使用一个多模块maven项目在Windows for Windows下创建一个独立的应用程序包(带有exe和嵌入式JRE)

但我不知道如何在Linux下使用Jenkins实现这一点。我提供了一个32位的Windows JDK/JRE(因为我们必须使用JNI DLL),但我收到一条错误消息(如下所示),表明任务需要构建一个Linux映像,因为它在Linux下运行

有没有可能说服DeployFXTask,他必须构建一个跨平台的windows软件包

ERRORMESSAGE: Bundler Linux Application Image skipped because of a configuration problem: This copy of ant-javafx.jar does not support Linux.

    <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <JAVA.JDK.HOME>${project.basedir}/../myapp-env/target/jdk-win32</JAVA.JDK.HOME>
    <JAVA.JRE.HOME>${JAVA.JDK.HOME}/jre</JAVA.JRE.HOME>
    <JAVAFX.TOOLS.ANT.JAR>${JAVA.JDK.HOME}/lib/ant-javafx.jar</JAVAFX.TOOLS.ANT.JAR>
</properties>

<build>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>properties-maven-plugin</artifactId>
            <version>1.0.0</version>
            <executions>
                <execution>
                    <goals>
                        <goal>set-system-properties</goal>
                    </goals>
                    <configuration>
                        <properties>
                            <property>
                                <name>fxpackager.disableBitArchitectureMismatchCheck</name>
                                <value>true</value>
                            </property>
                        </properties>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <!-- do the JavaFX magic via ant tasks -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.7</version>

            <executions>
                <execution>
                    <id>build-javafx.developer</id>
                    <phase>package</phase>
                    <!-- https://docs.oracle.com/javase/8/docs/technotes/guides/deploy/self-contained-packaging.html  -->
                    <!-- https://docs.oracle.com/javase/8/docs/technotes/guides/deploy/javafx_ant_task_reference.html -->
                    <!-- https://docs.oracle.com/javase/8/docs/technotes/tools/unix/javapackager.html -->
                    <configuration>
                        <target>
                            <property name="JAVA_HOME" value="${JAVA.JDK.HOME}"/>

                            <!-- also include icons into path - icons must be named equal to the application name -->
                            <path id="javafx.path">
                                <filelist>
                                    <file name="${JAVAFX.TOOLS.ANT.JAR}"/>
                                    <file name="${project.basedir}/src/main/resources/"/>
                                </filelist>
                            </path>

                            <!-- merge PDF, CSV and Maps into myappDeveloper.jar -->
                            <zip destfile="${project.build.outputDirectory}/myappDeveloper.jar">
                                <zipfileset
                                        dir="${project.basedir}/../myapp-generate-resources/target/classes/de/db/myapp/csv"
                                        prefix="de/db/myapp/csv"/>
                                <zipfileset
                                        dir="${project.basedir}/../myapp-generate-resources/target/classes/de/db/myapp/pdf"
                                        prefix="de/db/myapp/pdf"/>
                                <zipfileset
                                        dir="${project.basedir}/../myapp-generate-resources/target/classes/de/db/myapp/map"
                                        prefix="de/db/myapp/map"/>
                                <zipgroupfileset
                                        file="${project.basedir}/../myapp-core/target/myappDeveloper.jar"/>
                            </zip>

                            <!-- define the deploy ANT task-->
                            <taskdef
                                    name="dev.jfxdeploy"
                                    classname="com.sun.javafx.tools.ant.DeployFXTask"
                                    classpathref="javafx.path"/>

                            <dev.jfxdeploy
                                    width="1024"
                                    height="768"
                                    outdir="${project.build.directory}/deployDeveloper"
                                    outfile="${project.build.finalName}"
                                    nativeBundles="image"
                                    runtime="${JAVA.JRE.HOME}">

                                <info title="${project.name}" vendor="MyApp"
                                      description="myappstool"/>
                                <application
                                        name="myappDeveloper"
                                        mainClass="de.db.myapp.MainDeveloper"/>
                                <resources>
                                    <fileset
                                            dir="${project.build.outputDirectory}"
                                            includes="myappDeveloper.jar"/>
                                    <fileset
                                            dir="${project.build.directory}"
                                            includes="myapp-tool-1.0.0-SNAPSHOT.jar"/>
                                    <fileset
                                            dir="${project.basedir}/../myapp-dll/target/classes"
                                            includes="**/*.dll"/>
                                    <fileset
                                            dir="${project.basedir}/../myapp-dll/target/classes"
                                            includes="data/**"/>
                                </resources>

                                <!-- Custom JVM setup for application -->
                                <platform >
                                    <jvmarg value="-Xmx1024m"/>
                                    <jvmarg value="-verbose:jni"/>
                                </platform>

                                <!-- install for current user only -->
                                <preferences install="false" shortcut="true"/>
                                <!-- Windows Menü -->
                                <bundleArgument arg="win.menuGroup" value="MyApp"/>
                            </dev.jfxdeploy>
                        </target>
                    </configuration>
                    <goals>
                        <goal>run</goal>
                    </goals>
                </execution>

            </executions>
        </plugin>
    </plugins>

</build>

共 (0) 个答案