所以我用 Maven 做了一个非常简单的 java 项目,其中我使用了一个 Libary jnativehook,在 intellij 中它工作得很好但是当我使用 jlink 导出它时,这个警告出现了
Required filename-based automodules detected. Please don't publish this project to a public artifact repository!
后跟此错误消息
Failed to execute goal org.openjfx:javafx-maven-plugin:0.0.6:jlink (default-cli) on project hellofx: Error
我搜索过,但没有任何帮助
这是我的 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">
<modelVersion>4.0.0</modelVersion>
<groupId>org.openjfx</groupId>
<artifactId>hellofx</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>11</maven.compiler.release>
<javafx.version>17.0.0.1</javafx.version>
<javafx.maven.plugin.version>0.0.6</javafx.maven.plugin.version>
</properties>
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>com.1stleg</groupId>
<artifactId>jnativehook</artifactId>
<version>2.1.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<release>${maven.compiler.release}</release>
</configuration>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>${javafx.maven.plugin.version}</version>
<configuration>
<launcher>hellofx</launcher>
<mainClass>Listener</mainClass>
</configuration>
</plugin>
</plugins>
</build>
和我的 module-info.java
module Listener {
requires javafx.controls;
requires javafx.fxml;
requires jnativehook;
requires java.logging;
opens org.openjfx to javafx.fxml;
exports org.openjfx;
}
所以我测试了一些东西,我删除了与 jNativeHook https://github.com/kwhat/jnativehook有关的所有内容,它有效,但我需要 jNativehook 有没有人有解决这个问题的想法或者有没有人有类似的问题