maven相关问题

一  idea 切换分支jar包导入不及时问题解决

现象:

 

 项目切换分支从a分支(pom 版本1.0-SNAPSHOT) 切换到b分支(pom版本1.1-SNAPSHOT)

项目的依赖的jar包没有及时更新(依赖的版本依然是 1.0-SNAPSHOT)会出现如图以上的报错

 

解决方案:

1. 切换分支之后

2. 重新打开项目(打开 enable auto import)

3. 刷新 Reimport All Maven Projects按钮,  即可解决

 

二.  Maven升级3.8.1后maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories

解决方案:https://blog.csdn.net/hadues/article/details/119038072

 补充: 如果使用的是 maven home path:  Bundled (Maven 3)

那么安装maven的地址: idea 安装目录下的setting文件例如:   D:\Program Files\JetBrains\IntelliJ IDEA 2021.3.3\plugins\maven\lib\maven3\conf

<mirror>
      <id>maven-default-http-blocker</id>
      <mirrorOf>external:http:*</mirrorOf>
      <name>Pseudo repository to mirror external repositories initially using HTTP.</name>
      <url>http://0.0.0.0/</url>
      <blocked>true</blocked>
</mirror>

这段显示http的设置注释掉

 

三  Maven中classifier

链接地址: https://blog.csdn.net/qiumengchen12/article/details/71688395

 jar包名: xxx-classifier.jar

 

四: 

Maven:resolution will not be reattempted until the update interval of central has elapsed or update

原因: 1. 可能idea  maven 没配置好。

 

五. jar包需要重新import

对整个工程import, 而不是某个模块, 可以借助maven helper 操作。

 

posted @ 2020-11-12 16:13  知行-zhixing  阅读(699)  评论(0编辑  收藏  举报