从spring转到springboot,配置过程中遇到了一些小问题,虽然都很快的解决了,还是记录一下吧,前车之鉴,以供所需。
1.gradle打包遇到错误
14:39:27.810 [INFO] [org.gradle.api.internal.tasks.compile.JdkJavaCompiler] Compiling with JDK Java compiler API.
14:39:28.033 [ERROR] [system.err] 错误: 无法访问Immutable
14:39:28.033 [ERROR] [system.err] 找不到org.apache.http.annotation.Immutable的类文件
14:39:28.033 [ERROR] [system.err] 1 个错误
原因:
httpclient:4.5.2 is not compatible with httpcore:4.4.5 because class org.apache.http.annotation.Immutable was removed from httpcore:4.4.5 and httpclient:4.5.2 still uses it!
所以,需要在dependency里面加上 4.4.4的httpcore的依赖。
compile("org.apache.httpcomponents:httpclient:4.5.2") compile("org.apache.httpcomponents:httpcore:4.4.4")重新编译就好了。
refer:
https://github.com/spring-projects/spring-boot/issues/6662
2.启动springboot appl