Ich habe die Frage vor ein paar Tagen bei Stackoverflow hochgeladen aber keine Hilfreiche antwort bekommen https://stackoverflow.com/questions...e-dont-publish-this-project/70482179#70482179
wenn ich das mache wird das module nicht mehr erkannt und Intellij schlägt mir vor statt requires com.github.kwhat.jnativehook; das requires jnativehook; zu benjtzen aber dabb passiert wieder das gleiche beim jlinkHier das Forum spinnt mal wieder ... ich kann nichts posten ... hab daher in SO eine Antwort geschrieben.
Edit 1:
First of all to understand the problem: What does "Required filename-based automodules detected." warning mean?
The solution could simply be to use the latest version of the dependency: https://mvnrepository.com/artifact/com.github.kwhat/jnativehook/2.2.1 Be aware that the goupId changed! You are using the old one and the homepage of the dependency (you provided the link yourself) is giving you the correct groupId - you should really use that.
If that does not solve the issue, then a fix in that dependency is required and you should contact the authors of the dependency.
But from what I see, it should work - but be aware that your module-info.java should use com.github.kwhat.jnativehook instead of just jnativehook.
Edit 2:
Das Editieren des Posts scheint als Workaround zu gehen ... oder das Problem tritt nur temporär auf ...
ja aber wenn ich das ändere wird das garnicht mehr erkannt also zumbeispiel der importDie Änderung in der module-info hatte ich auch erwähnt. Das muss sein.
import com.github.kwhat.jnativehook.keyboard.NativeKeyListener;
requires jnativehook;
Also meine pom.xml sieht jetzt so ausAlso nach Änderung der dependency in der pom.xml und dem Ändern der module-info.java sollte zum einen die Abhängigkeit geladen und das Modul eingebunden werden. Wichtig sind beide Änderungen zusammen.
<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>Listener</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>
<!-- https://mvnrepository.com/artifact/com.github.kwhat/jnativehook -->
<dependency>
<groupId>com.github.kwhat</groupId>
<artifactId>jnativehook</artifactId>
<version>2.2.1</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>
</project>
module Listener {
requires javafx.controls;
requires javafx.fxml;
requires com.github.kwhat.jnativehook;
requires java.logging;
opens org.openjfx to javafx.fxml;
exports org.openjfx;
}
module Listener {
requires javafx.controls;
requires javafx.fxml;
requires jnativehook;
requires java.logging;
opens org.openjfx to javafx.fxml;
exports org.openjfx;
}
Also reload ist da aber ich hab es noch nicht von der Kommandozeile versucht aber wie mach ich dasHast du es mal auf der Kommandozeile gebaut? Vermutlich ist Intellij irgendwie durcheinander gekommen. Oder ganz trivial: hat Intellij die Datei neu geladen? Das Reload im Maven Toolfenster fehlt evtl. auch nur.
Das dieses alte requires gewollt wird, deutet darauf hin, dass die alte Abhängigkeit noch genutzt wird.
Titel | Forum | Antworten | Datum | |
---|---|---|---|---|
T | Buckminster-Hudson RCP-Build "CSpec source required" | Tools - Maven, Gradle, Ant & mehr | 9 |