Я хочу упаковать JAR для проекта kotlin / tornadofx с maven3 - PullRequest
0 голосов
/ 14 ноября 2018

Создание JAR происходит неправильно с зависимостями JDK 11 и JavaFX.Жир JAR строит, но выполнение не работает, смотрите ошибку ниже ...

Это мой MANIFEST.MF:


Manifest-Version: 1.0
Created-By: Apache Maven 3.5.4
Built-By: gerri
Build-Jdk: 11.0.1
Class-Path: javax.json-api-1.1.2 tornadofx-1.7.17 kotlin-reflect-1.2.60 
 kotlin-stdlib-1.3.0-rc-198 kotlin-stdlib-common-1.3.0-rc-198 kotlin-std
 lib-jdk7-1.2.60 kotlin-stdlib-jdk8-1.2.60 javax.json-1.1.2 annotations-
 13.0
Main-Class: de.auticon.maven.tornadofx.MainAppKt

PS Я хочу упаковатьJAR с maven3, b / c с IntelliJ IDEA тоже не работает!

Обновлено pom.xml по запросу:


<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>de.auticon.maven.tornadofx</groupId>
    <artifactId>de-auticon-maven-tornadofx</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>de.auticon.maven.tornadofx de-auticon-maven-tornadofx</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <kotlin.version>1.3.0-rc-198</kotlin.version>
        <kotlin.code.style>official</kotlin.code.style>
        <junit.version>4.12</junit.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib</artifactId>
            <version>${kotlin.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-test-junit</artifactId>
            <version>${kotlin.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>no.tornado</groupId>
            <artifactId>tornadofx</artifactId>
            <version>1.7.17</version>
        </dependency>

        <dependency>
            <groupId>org.openjfx</groupId>
            <artifactId>javafx-controls</artifactId>
            <version>11-ea+19</version>
        </dependency>

    </dependencies>

    <build>
        <sourceDirectory>src/main/kotlin</sourceDirectory>
        <testSourceDirectory>src/test/kotlin</testSourceDirectory>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <archive>
                        <manifestFile>src/main/resources/META-INF/MANIFEST.MF</manifestFile>
                    </archive>
                </configuration>

            </plugin>
            <plugin>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-maven-plugin</artifactId>
                <version>${kotlin.version}</version>
                <configuration>
                    <jvmTarget>1.8</jvmTarget>
                </configuration>
                <executions>
                    <execution>
                        <id>compile</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>test-compile</id>
                        <phase>test-compile</phase>
                        <goals>
                            <goal>test-compile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.4.1</version>
                <configuration>
                    <!-- get all project dependencies -->
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                    <!-- MainClass in mainfest make a executable jar -->
                    <archive>
                      <manifest>
                        <mainClass>de.auticon.maven.tornadofx.MainAppKt</mainClass>
                      </manifest>
                    </archive>

                </configuration>
                <executions>
                  <execution>
                    <id>make-assembly</id>
                                        <!-- bind to the packaging phase -->
                    <phase>package</phase> 
                    <goals>
                        <goal>single</goal>
                    </goals>
                  </execution>
                </executions>
            </plugin>


        </plugins>
    </build>

</project>

Мне действительно нужно javafxpackager как описано здесь?

FatJAR строит, но не выполняет:

D:\Source\deauticonmaventornadofx\target>java -jar de-auticon-maven-tornadofx-1.0-SNAPSHOT-jar-with-dependencies.jar
Error: JavaFX runtime components are missing, and are required to run this application
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...