62,628
社区成员
发帖
与我相关
我的任务
分享
module test {
exports test;
requires com.google.common;
requires fastjson;
}
Working Directory: E:\java\test
Gradle user home: E:\gradle\home
Gradle Distribution: Local installation at E:\gradle\gradle-6.5
Gradle Version: 6.5
Java Home: E:\openjdk\jdk-14
JVM Arguments: None
Program Arguments: None
Build Scans Enabled: false
Offline Mode Enabled: false
Gradle Tasks: build
> Task :compileJava FAILED
E:\java\test\src\main\java\module-info.java:4: 错误: 找不到模块: fastjson
requires fastjson;
^
1 个错误
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 345ms
1 actionable task: 1 executed
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java Library project to get you started.
* For more details take a look at the Java Libraries chapter in the Gradle
* User Manual available at https://docs.gradle.org/6.5/userguide/java_library_plugin.html
*/
plugins {
// Apply the java-library plugin to add support for Java Library
id 'java-library'
}
java {
modularity.inferModulePath = true
}
repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
maven{
url 'https://maven.aliyun.com/repository/central'
}
jcenter()
}
dependencies {
// This dependency is exported to consumers, that is to say found on their compile classpath.
api 'org.apache.commons:commons-math3:3.6.1'
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:29.0-jre'
implementation 'com.alibaba:fastjson:1.2.70'
// Use JUnit test framework
testImplementation 'junit:junit:4.13'
}
version = '1.2'
tasks.compileJava {
// use the project's version or define one directly
options.javaModuleVersion = provider { project.version }
//options.compilerArgs.addAll( ['--add-modules','fastjson'])
}