有些同学在导入CSEJavaSDK的demo工程的时候,会发现maven依赖没有导入进来。代码中很多类都是红的,显示无法找到类:

此时大家可以跑一下mvn clean package构建命令,看看控制台里的输出日志:

关键日志如下:
| 1 |
Non-resolvable import POM: Failure to find com.huawei.paas.cse:cse-dependency:pom:2.3.62 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced @ line 18, column 19 -> [Help 2] |
可以看到,日志里显示maven在尝试从maven中央仓库拉取依赖包(这是maven的默认配置,也有可能是其他的错误地址),而不是从华为云镜像站拉取依赖。
这就说明该环境上的maven setting文件没有按照Day2培训中的说明进行配置,建议大家按照操作指导再配置一下maven setting文件。