Maven配置多数据源
一、配置文件
修改maven配置文件,用户目录下.m2文件夹中的setting.xml,内容如下
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<!-- 本地仓库存储地址 -->
<localRepository>/Users/Robots2/.m2/repository</localRepository>
<pluginGroups></pluginGroups>
<!-- 代理配置 -->
<proxies></proxies>
<!-- 仓库需要验证账号密码的,在这里配置 -->
<servers>
<server>
<id>名称id</id>
<username>账号</username>
<password>密码</password>
</server>
</servers>
<!-- 单一库,用这个就行了。 这个虽然也可以配置多个,但是,它是第一个镜像挂了,才会找第二个。 不是多仓库的意思 -->
<mirrors>
<!-- 1、CDH加速镜像 -->
<!-- <mirror> -->
<!-- 多仓库配置时,用 profiles 配置,mirror需要注掉 -->
<!-- 镜像唯一标识符 -->
<!-- <id>cloudera</id> -->
<!-- <name>cloudera_mirror</name> -->
<!-- 构建系统会优先考虑使用该URL,而非使用默认的服务器URL -->
<!-- <url>https://repository.cloudera.com/artifactory/cloudera-repos/</url> -->
<!-- 被镜像的服务器的id,为哪个repository配置的id做镜像 -->
<!-- <mirrorOf>cdh</mirrorOf> -->
<!-- </mirror> -->
</mirrors>
<!-- maven配置多仓库。使用顺序是倒序的,所以最流畅的写在最下面。 -->
<profiles>
<!-- repo1仓库 -->
<profile>
<id>repo1</id>
<repositories>
<repository>
<id>repo1</id>
<url>https://repo1.maven.org/maven2</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
</profile>
<!-- 阿里云 -->
<profile>
<id>aliyun</id>
<repositories>
<repository>
<id>aliyun</id>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled><updatePolicy>always</updatePolicy></snapshots>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>repo1</activeProfile>
<activeProfile>aliyun</activeProfile>
</activeProfiles>
</settings>
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· Ollama——大语言模型本地部署的极速利器
· DeepSeek如何颠覆传统软件测试?测试工程师会被淘汰吗?
2022-02-15 spring boot配置mybatis-plus
2022-02-15 spring boot配置pagehelper插件