使用 gradle 在 Spring 会话示例下构建时:https ://docs.spring.io/spring-session/docs/current/reference/html5/guides/boot-findbyusername.html
我遇到了关于 java.annotation 模块的错误,有人知道如何解决吗?
/spring-session/spring-session-core/src/main/java/org/springframework/session/config/annotation/web/http/SpringHttpSessionConfiguration.java:22: error: package javax.annotation is not visible
import javax.annotation.PostConstruct;
^
(package javax.annotation is declared in module java.xml.ws.annotation, which is not in the module graph)
warning: unknown enum constant When.MAYBE
reason: class file for javax.annotation.meta.When not found
1 error
1 warning
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':spring-session-core:compileJava'.
> Compilation failed; see the compiler error output for details.
Run Code Online (Sandbox Code Playgroud)
我尝试在 build.gradle 中添加以下配置,但问题仍然存在。
tasks.withType(AbstractCompile) { …Run Code Online (Sandbox Code Playgroud)