无法为 gradle 项目创建 JAR 文件

iDe*_*per 8 dependencies jar gradle spring-boot fatjar

我想创建一个可以在 AWS 上上传的 jar 文件,但每次gradle jar从命令提示符运行命令时都会收到以下错误。

> Task :compileJava FAILED

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
Run Code Online (Sandbox Code Playgroud)

每当我gradle clean在命令提示符下运行时,我都会收到“构建成功”。这是build.gradle的内容:

> Task :compileJava FAILED

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
Run Code Online (Sandbox Code Playgroud)

我需要添加任何插件吗?提前致谢。请帮忙

小智 15

打开任务管理器并强制停止Java(TM) Platform SE二进制文件并删除

C:\Users\{current user}\.gradle\caches\jars-9\jars-9.lock file


iDe*_*per 7

我正在使用gradle cleanandgradle build而不是gradlew cleanand gradlew build
gradle命令对我有用。