Maven刷新,本地仓库无法更新
现象
This failure was cached in the local repository and resolution is not reattempted until the update interval of aliyunmaven has elapsed or updates are forced
原因
因为上一次尝试下载,发现对应的仓库没有这个maven配置,本地缓存中也没有。因此,不会更新
解决方案
使用maven强制更新,来刷新本地maven仓库
mvn clean package -U
依赖的父项目不存在,但install能成功
现象
在项目中有个${build.env}变量,在项目中没有找到这个变量;但项目中有一个parent项目
<parent>
<groupId>com.kingreda.framework</groupId>
<artifactId>kingreda-framework</artifactId>
<version>2.4.7</version>
<relativePath>../kingreda-framework</relativePath>
</parent>
在父项目中的profile中中定义了<build.env>dev<build.env>,但本项目中父项目的路径是:<relativePath>../kingreda-framework</relativePath>
,但在本地没有这个项目。
但是,本地能build成功,package和install也都能成功
原因
- 虽然本地没有父项目,因为配置了导致提示告警,但在本项目maven的
refresh
刷新按钮的时候,会从私有仓库下载父类项目的pom文件、jar等 - 同时,compile的时候,发现本地缓存没有父类项目,也会从私有仓库下载父类项目的pom文件等信息
- 因此,compile,package,install的时候都能成功
解决方案
- maven的compile会自动解决依赖的parent项目的问题,无需手动解决