前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >【springboot】配置默认maven仓库

【springboot】配置默认maven仓库

原创
作者头像
无敌小菜鸟
修改2022-07-05 10:50:25
3.3K0
修改2022-07-05 10:50:25
举报
文章被收录于专栏:搬砖笔记

每次换个环境,都要在本地配置一下本地的maven仓库,配置国内源加速,随即研究了下在springboot中配置仓库加速的案例,顺手记录下笔记。

一、修改配置文件

修改springboot中的pom.xml配置文件,配置远程仓库。以下仓库配置任意一个即可。

标签解释:

  • Snapshot版本代表不稳定、尚处于开发中的版本。
  • Release版本则代表稳定的版本

腾讯云加速

代码语言:html
复制
        <repository>
            <id>tencent</id>
            <name>Nexus tencentyun</name>
            <url>http://mirrors.cloud.tencent.com/nexus/repository/maven-public/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>

阿里云加速

代码语言:html
复制
        <repository>
            <id>aliyun</id>
            <name>Nexus aliyun</name>
            <url>https://maven.aliyun.com/repository/public</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>

网易镜像加速,这里还配置了 插件加速仓库,上边如果需要配置的话,也可以配置一下。

代码语言:javascript
复制
    <!--maven仓库-->
    <repositories>
        <repository>
            <id>nexus-163</id>
            <name>Nexus 163</name>
            <url>http://mirrors.163.com/maven/repository/maven-public/</url>
            <layout>default</layout>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
    </repositories>
    <!--插件仓库-->
    <pluginRepositories>
        <pluginRepository>
            <id>nexus-163</id>
            <name>Nexus 163</name>
            <url>http://mirrors.163.com/maven/repository/maven-public</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </pluginRepository>
    </pluginRepositories>

图示

1
1

二、测试

刷新maven,测试下载依赖的路径。

2
2

完!

总结

腾云先锋(TDP,Tencent Cloud Developer Pioneer)是腾讯云GTS官方组建并运营的技术开发者群体。这里有最专业的开发者&客户,能与产品人员亲密接触,专有的问题&需求反馈渠道,有一群志同道合的兄弟姐妹。来加入属于我们开发者的社群吧!

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 一、修改配置文件
  • 二、测试
  • 总结
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档