前提:IDEA由于权限以及一些其他原因不能自动更新maven依赖包
问题:IDEA在项目.idea目录下的libararies包括了包cn.xxxx.commons.jar,但importcn.xxxx.commons.entity.IdEntity;时报如下错误:
1)cn. cannot be resolved (不能解析)
2)cn.xxxx.commons.jar不存在
3)最关键的错误:IDEA->File->Project Structure->Project Setting->Libaries 对应的 cn.xxxx.commons.jar,其Classes、Sources、JavaDocs都红色警告
解决:
将cn.xxxx.commons.jar的classes、sources和javaDoc等文件copy到IDEA默认的repository中,如C:\user\Tom\.m2\repository\cn\csdb\sdc-commons\1.6.0。
就会看到cn.xxxx.commons.jar的红色警告消失,重新编译不会再报错。