该随笔仅限自己记录,请谨慎参考!!

为什么把这2块内容放一个标题里?

发现lombok和eclipse结合的一些问题

关于lombok如何与eclipse结合,网上应该有很多教程,我这块已经做过了,但是在使用springboot的demo时,还是发现一些问题。。。

1、仓库问题

springboot的build.gradle增加阿里仓库地址以及eclipse增加lombok

 demo默认是这样的,但是我在执行gradle build --refresh-dependencies 时,发现报仓库地址错误(maven仓库地址换过,不知道大家留意没,应该是2019年底左右?)

解决办法:增加阿里仓库地址

 springboot的build.gradle增加阿里仓库地址以及eclipse增加lombok 

repositories { //远程仓库,根据先后顺序,决定优先级
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/'}
mavenCentral()
}

配置好阿里仓库后,执行gradle  build --refresh-dependencies可以生成jar包,但是lombok还是不能使用,在eclipse的Refereferenced Libraries中看不到任何依赖,我怀疑是不是命令执行有问题 也许执行gradle eclipse --refresh-dependencies就可以?

 

2、lombok还是不能使用(@Getter、@Setter报错)

springboot的build.gradle增加阿里仓库地址以及eclipse增加lombok

解决办法:

springboot的build.gradle增加阿里仓库地址以及eclipse增加lombok

 

 在此基础上增加  

id 'idea'
id 'eclipse'

 springboot的build.gradle增加阿里仓库地址以及eclipse增加lombok

 

最后,执行  gradle clean  eclipse --refresh-dependencies

 3、还有问题

springboot的build.gradle增加阿里仓库地址以及eclipse增加lombok

 

 然后我就把第二行去掉了

springboot的build.gradle增加阿里仓库地址以及eclipse增加lombok

 执行 gradle clean  eclipse --refresh-dependencies 成功

 可能问题在这

 

相关文章:

  • 2022-02-27
  • 2021-10-21
  • 2021-04-23
  • 2022-02-16
  • 2022-12-23
猜你喜欢
  • 2022-02-05
  • 2022-02-08
  • 2022-02-08
  • 2022-02-27
  • 2022-02-26
  • 2022-02-04
相关资源
相似解决方案