Required filename-based automodules detected. Please don't publish this project to a public artifact repository

K

kneitzel

Gast
Hier 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 ...
 

Nilsy8214

Aktives Mitglied
Hier 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 ...
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 jlink
 
K

kneitzel

Gast
Die Änderung in der module-info hatte ich auch erwähnt. Das muss sein.

Antworten im Forum geht derzeit nicht richtig
 

Nilsy8214

Aktives Mitglied
Die Änderung in der module-info hatte ich auch erwähnt. Das muss sein.
ja aber wenn ich das ändere wird das garnicht mehr erkannt also zumbeispiel der import
Java:
import com.github.kwhat.jnativehook.keyboard.NativeKeyListener;
wird mir dann als Falsch angezeigt und erst wenn ich es wieder zu
Java:
requires jnativehook;
mache geht das wieder dann ist ja ber das Problem das Jlink nicht geht
 
M

Mart

Gast
du kannst deinen repository ordner mal löschen und neu downloaden ansonsten ist das wie ein "cache"
in C:\Users\.m2\repositories

irgendwo da sind die repositories zwischne gespeichert
 
K

kneitzel

Gast
Also 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.
 

Nilsy8214

Aktives Mitglied
Also 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.
Also meine pom.xml sieht jetzt so aus
Java:
<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>
Meine module-info so
Java:
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;
}
und es wird in Meiner MainClass nicht erkannt und Intellij schlägt mir vor wieder requires jnativehook; zu machen also so
Java:
module Listener {


    requires javafx.controls;
    requires javafx.fxml;
    requires jnativehook;
    requires java.logging;



    opens org.openjfx to javafx.fxml;
    exports org.openjfx;
}
dann hab ich aber wieder das Problem vom Anfang
 
K

kneitzel

Gast
Hast 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.
 

Nilsy8214

Aktives Mitglied
Hast 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.
Also reload ist da aber ich hab es noch nicht von der Kommandozeile versucht aber wie mach ich das
 
Ähnliche Java Themen

Ähnliche Java Themen

Neue Themen


Oben