Huge build.gradle, how to add a single project dependency

Hi,

I’m trying to add a simple dependency into a big project with a huge build.gradle

I try to add the following at the graphics project:

    repositories {
        maven { setUrl("https://oss.sonatype.org/content/repositories/snapshots/") }
    }
    dependencies {
        ext.lwjglVersion = "3.2.1-SNAPSHOT"
        switch (org.gradle.internal.os.OperatingSystem.current()) {
            case org.gradle.internal.os.OperatingSystem.WINDOWS:
                ext.lwjglNatives = "natives-windows"
                break
            case org.gradle.internal.os.OperatingSystem.LINUX:
                ext.lwjglNatives = "natives-linux"
                break
            case org.gradle.internal.os.OperatingSystem.MAC_OS:
                ext.lwjglNatives = "natives-macos"
                break
        }
        ["", "-jemalloc", "-opengl"].each {
            implementation "org.lwjgl:lwjgl$it:$lwjglVersion"
            runtime "org.lwjgl:lwjgl$it:$lwjglVersion:$lwjglNatives"
        }
    }

I can see in Idea the dependency in the project view, but I cant access it from the code

I simply copy/pasted those lines under project(":graphics") {, extendint the already existing dependencies {} and added in module-info.java

requires org.lwjgl;
requires org.lwjgl.opengl;

But whenever I try to compile, I get:

C:\Users\elect\openjdk-jfx\modules\javafx.graphics\src\main\java\module-info.java:40: error: module not found: org.lwjgl
    requires org.lwjgl;
                ^
C:\Users\elect\openjdk-jfx\modules\javafx.graphics\src\main\java\module-info.java:41: error: module not found: org.lwjgl.opengl
    requires org.lwjgl.opengl;
                      ^
2 errors

Where am I mistaken?