maven-导入4.0.0.BOOTSTRAP-SNAPSHOT遇到的问题。

今天深入了解一下Spring,看了曹工的文章,想跑一下他的demo:https://gitee.com/ckl111/spring-boot-first-version-learn

他是基于Spring的第一个版本:4.0.0.BOOTSTRAP-SNAPSHOT 来做demo和分析源码的。

结果maven导入依赖报错:

 

 

 

 

好不容易找到华为云的镜像:https://mirrors.huaweicloud.com/repository/maven/org/springframework/spring-expression/4.0.0.BOOTSTRAP-SNAPSHOT/

在网页上明明看到这些maven包,但是idea中maven  reimport还是报上面说的,无法找到包的错误。

然后就是各种调maven中setting.xml的repository的顺序,还是下载不了jar包到本地。

<repositories>

                <!--这个是陈琪新增的snapshot地址-->
                <repository>
                    <id>huaweicloud-snapshots</id>
                    <name>huaweicloud Spring Snapshots</name>
                    <!--这个修改成了https 这个顺序是第二的-->
                    <url>http://mirrors.huaweicloud.com/repository/maven/</url>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>

                <!--这个顺序是第一的-->
                <repository>
                    <id>nexus-aliyun</id>
                    <name>Nexus aliyun</name>
                    <layout>default</layout>
                    <url>http://maven.aliyun.com/nexus/content/groups/public</url>
                    <snapshots>
                        <enabled>true</enabled>
                        <updatePolicy>daily</updatePolicy>
                    </snapshots>
                    <releases>
                        <enabled>true</enabled>
                        <updatePolicy>daily</updatePolicy>
                        <checksumPolicy>fail</checksumPolicy>
                    </releases>
                </repository>
                
                <!--解决uow-6.0.2.17这个jar不能下载的问题,参考:
                https://mvnrepository.com/artifact/com.ibm.websphere/uow/6.0.2.17-->
                <repository>
                    <id>spring-snapshots</id>
                    <name>Spring Snapshots</name>
                    <!--这个修改成了https 这个顺序是第二的-->
                    <url>https://maven.springframework.org/snapshot</url>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>

                <!--因为本项目非release版本,所以大类依赖都是snapshot版本,需要去spring的snapshot仓库下载-->
                <repository>
                    <id>spring-plugins</id>
                    <name>Spring plugins</name>
                    <url>https://repo.spring.io/plugins-release/</url>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>

                <repository>
                    <id>spring</id>
                    <name>spring</name>
                    <layout>default</layout>
                    <url>https://repo.spring.io/plugins-release/</url>
                    <snapshots>
                        <enabled>true</enabled>
                        <updatePolicy>daily</updatePolicy>
                    </snapshots>
                    <releases>
                        <enabled>true</enabled>
                        <updatePolicy>daily</updatePolicy>
                        <checksumPolicy>fail</checksumPolicy>
                    </releases>
                </repository>
                
</repositories>

 

 

最后实在不行没有办法了,把报错找不到 jar 包的,一个一个在浏览器下载下来,放到本地的 repository 中。

 

 浏览器中查看华为云镜像的jar包

 

 

 

并且把pom.xml中设置了repository的全部改成华为镜像的地址,终于成功。

posted @ 2020-12-14 00:26  粤港澳工具人码农  阅读(458)  评论(0编辑  收藏  举报