问题描述
错误:自动模块不能与 jlink: org.json 一起使用
我在为 javafx 项目创建构建时遇到错误。我正在使用 JDK 11 并且无法为此项目创建构建。我正在使用 moditect 为 org.json 生成模块信息,但我无法创建它。
下面是我的模块信息
module hellofx {
requires javafx.controls;
requires javafx.fxml;
requires com.fasterxml.jackson.databind;
requires org.apache.httpcomponents.httpcore;
requires org.apache.httpcomponents.httpclient;
requires org.json;
requires java.sql;
requires com.jfoenix;
requires static lombok;
opens org.openjfx to javafx.fxml;
exports org.openjfx.controllers;
exports org.openjfx.models.Vouchers;
exports org.openjfx.utils;
exports org.openjfx;
}
这里是 pom.xml
<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">
.....
<build>
<plugins>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.5</version>
<configuration>
<release>${maven.compiler.release}</release>
<jlinkImageName>hellofx</jlinkImageName>
<launcher>launcher</launcher>
<mainClass>org.openjfx.Main</mainClass>
<ignoreSigningInformation>true</ignoreSigningInformation>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.moditect</groupId>
<artifactId>moditect-maven-plugin</artifactId>
<version>1.0.0.RC1</version>
<executions>
<execution>
<id>add-module-info</id>
<phase>generate-resources</phase>
<goals>
<goal>add-module-info</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/modules</outputDirectory>
<modules>
<module>
<artifact>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20201115</version>
</artifact>
<moduleInfoSource>
module org.openjfx.json {
exports org.json;
}
</moduleInfoSource>
</module>
</modules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)