首页 > 其他分享 >Maven配置多数据源

Maven配置多数据源

时间:2023-02-15 22:56:53浏览次数:37  
标签:maven cloudera -- 数据源 配置 Maven repo1 aliyun true

一、配置文件

修改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>

 

标签:maven,cloudera,--,数据源,配置,Maven,repo1,aliyun,true
From: https://www.cnblogs.com/robots2/p/17125054.html

相关文章

  • spring管理配置文件实现注入
    创建配置文件  写入以下内容:  创建配置文件的bean:  <beanid="configProperties"class="org.springframework.beans.factory.config.PropertiesFact......
  • Jdbc_Druid_Utils_V2连接池-需要在src文件夹下创建配置文件druid.properties
    packagecom.atguigu.api.utils;importcom.alibaba.druid.pool.DruidDataSourceFactory;importjavax.sql.DataSource;importjava.io.IOException;importjava.io.InputS......
  • zsh配置
    sudoaptupdatesudoaptinstallzshchsh-s/usr/bin/zshwgethttps://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh-O-|shgitclonehttps://gi......
  • eclipse配置tomcat环境
    Eclipse配置tomcat环境 第一步:进行下面操作: window–>Preference–>Server–>RuntimeEnvironments->Add搜索server在里面找到RuntimeEnviror并点击Add点击电脑......
  • hadoop集群配置
    进入hadoop的etc目录下找到配置文件cd /opt/module/hadoop-3.1.3/etc/hadoop   配置core-site.xml指定NameNode的地址指定hadoop数据的存储目录<configurati......
  • vue中element-ui配置一二级导航动态渲染并跳转
    这次的导航效果,包括二级导航,请认真食用~先看下效果图吧具体的步骤如下1.安装element-uinpminstallelement-ui--save或cnpminstallelement-ui--save2.需要准......
  • spring boot中自定义数据源属性注入
    在配置文件中写入如下配置,注释用户名密码,使用代码注入自定义config类,覆盖默认的hikari配置,其中数据库的用户名密码可以自定义,可以从第三方配置中心拿去......
  • CentOS里配置.net core运行环境
    CentOS里配置.netcore运行环境(含后台运行,附ssh长连接)说明:2带了4(vs2017仅支持2.1,命令中修改版本就好)另外,2.1、3.1等版本可以共存,不影响使用1注册Microsoft......
  • ignite系列之6-- 使用注解配置索引
    官方连接:见处理SQL-3.2.使用注解配置索引https://www.ignite-service.cn/doc/java/WorkingwithSQL.html#_3-2-%E4%BD%BF%E7%94%A8%E6%B3%A8%E8%A7%A3%E9%85%8D%E7%BD%AE%E......
  • ignite系列之4--jdbc端口xml配置
    jdbc端口xml配置<!--jdbc端口范围配置--><propertyname="clientConnectorConfiguration"><beanclass="org.apache.ignite.configuration.Clie......