尝试运行多模块gradle构建时出现以下错误:
/Users/ashley/Personal/juggernaut/display/src/main/java/module-info.java:2: error: module not found: org.lwjgl.natives
requires org.lwjgl.natives;
^
/Users/ashley/Personal/juggernaut/display/src/main/java/module-info.java:3: error: module not found: org.lwjgl.glfw.natives
requires org.lwjgl.glfw.natives;
^
/Users/ashley/Personal/juggernaut/display/src/main/java/module-info.java:4: error: module not found: org.lwjgl.opengl.natives
requires org.lwjgl.opengl.natives;
^
/Users/ashley/Personal/juggernaut/display/src/main/java/module-info.java:5: error: module not found: org.lwjgl.stb.natives
requires org.lwjgl.stb.natives;
^
/Users/ashley/Personal/juggernaut/display/src/main/java/module-info.java:6: error: module not found: org.lwjgl.assimp.natives
requires org.lwjgl.assimp.natives;
我的项目结构如下:
├── build.gradle
├── display
│ ├── build.gradle
│ └── src
│ └── main
│ ├── java
│ │ ├── module-info.java
├── engine
│ ├── build.gradle
│ └── src
│ └── main
│ ├── java
│ │ ├── module-info.java
└── settings.gradle
module-info.java
的{{1}}需要必要的LWJGL3模块:
display
相关的依存关系包含在module uk.ashleybye.juggernaut.display {
requires org.lwjgl.natives;
requires org.lwjgl.glfw.natives;
requires org.lwjgl.opengl.natives;
requires org.lwjgl.stb.natives;
requires org.lwjgl.assimp.natives;
exports uk.ashleybye.juggernaut.display;
}
中:
build.gradle
引擎project.ext.lwjglVersion = "3.2.2"
project.ext.lwjglNatives = "natives-macos"
dependencies {
implementation "org.lwjgl:lwjgl:$lwjglVersion"
implementation "org.lwjgl:lwjgl-assimp:$lwjglVersion"
implementation "org.lwjgl:lwjgl-glfw:$lwjglVersion"
implementation "org.lwjgl:lwjgl-openal:$lwjglVersion"
implementation "org.lwjgl:lwjgl-opengl:$lwjglVersion"
implementation "org.lwjgl:lwjgl-stb:$lwjglVersion"
runtimeOnly "org.lwjgl:lwjgl:$lwjglVersion:$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-assimp:$lwjglVersion:$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-glfw:$lwjglVersion:$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-openal:$lwjglVersion:$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-opengl:$lwjglVersion:$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-stb:$lwjglVersion:$lwjglNatives"
}
,并具有实现依赖性:requires uk.ashleybye.juggernaut.display;
。
我的版本信息:
implementation project(":display")
为什么gradle找不到模块?
答案 0 :(得分:1)
您的youServiceName.verifyUserHaveReviewToApp().subscribe()
根本不需要包括任何本地人。
从每个module-info.class
中删除所有.natives
。
此外,您可以压缩requires
:
build.gradle
您可以参考我们的this project作为参考,这是一个多模块项目,它高度依赖lwjgl并也使用JPMS。