解决idea项目代码报红 但是可以正常运行的问题

是不是有时候会遇到莫名其妙的飘红报错,但是代码却可以正常运行

这个原因是因为IDEA有缓存,只需要刷新一下缓存就好了

解决办法:

file --> Invalidate Caches /Restart. --> Invalidate and Restart

然后重启IDEA,OK~困扰多年的问题解决!

现象2

idea---pom没有错误,但是代码依然报红问题的解决方案

解决方案 alter+enter将jar包变为classpath; 

idea导入maven项目报错的思路:

1.本地maven的环境变量配置是否正确;

2,idea--》setting---》maven

重点看这里改没改

或者设置自动导入项目

3.是否导入pom文件,将pom文件作为as maven project运行

4,idea不够智能没有将maven的jar包自动转为classpath

需要手动添加

/** 请忽略此处
 * Implicitly sets a tag for the operations, legacy support (read description).
 * <p>
 * In swagger-core 1.3.X, this was used as the 'path' that is to host the API Declaration of the
 * resource. This is no longer relevant in swagger-core 1.5.X.
 * <p>
 * If {@link #tags()} is <i>not</i> used, this value will be used to set the tag for the operations described by this
 * resource. Otherwise, the value will be ignored.
 * <p>
 * The leading / (if exists) will be removed.
 *
 * @return tag name for operations under this resource, unless {@link #tags()} is defined.
 */
  • 23
    点赞
  • 33
    收藏
    觉得还不错? 一键收藏
  • 6
    评论
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值