库不包含在javaFX jar中

问题描述 投票:0回答:1

我使用Maven构建了一个javaFX应用程序。问题是从maven生成的javaFX jar文件,不包含依赖项。

我通过这种方式包含了javaFx依赖项:

<dependency>
    <groupId>com.oracle</groupId>
    <artifactId>javafx</artifactId>
    <version>8.0.151</version>
    <scope>system</scope>
    <systemPath>C:\Program Files\Java\jdk1.8.0_151\jre\lib\ext\jfxrt.jar</systemPath>
</dependency>

我还包括了javaFx插件:

<plugin>
    <groupId>com.zenjava</groupId>
    <artifactId>javafx-maven-plugin</artifactId>
    <version>${javafx.plugin.version}</version>
    <configuration>
        <vendor>Vendor</vendor>
        <mainClass>org.bsh.generator.App</mainClass>
        <jarFileName>CSVGenerator</jarFileName>
    </configuration>
    <executions>
        <execution>
            <id>create-jfxjar</id>
            <phase>package</phase>
            <goals>
                <goal>build-jar</goal>
            </goals>
        </execution>
    </executions>
</plugin>

当我使用目标“build-jar”构建jar时,生成的jar不包含其他依赖项。有什么帮助吗?

java maven javafx plugins
1个回答
0
投票

作为system的依赖关系不受尊重,这是故意的。插件只尊重providedruntime作用域依赖项/库。

免责声明:我是javafx-maven-plugin的维护者。

© www.soinside.com 2019 - 2024. All rights reserved.