maven setting.xml 多仓库配置(插件依赖来自不同私服,须保证pom.xml中插件版本的唯一性)

maven 私服配置如下:


<?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
                          https://maven.apache.org/xsd/settings-1.0.0.xsd">
  <localRepository/>
  <interactiveMode/>
  <usePluginRegistry/>
  <offline/>
  <pluginGroups/>

  <mirrors>  
      <mirror>  
          <id>nexus-public</id>  
          <name>Maven China Mirror</name>  
          <url>http://maven.net.cn/content/groups/public/</url>  
          <mirrorOf>*</mirrorOf>  
      </mirror>
      <mirror>  
          <id>local-public</id>  
          <name>local Mirror</name>  
          <url>http://maven.net.cn/content/groups/public/</url>  
          <mirrorOf>rockRelease</mirrorOf>  
      </mirror>
  </mirrors> 
  
  <proxies/>
  
  <profiles>
      <profile>
          <id>jdk-1.7</id>
          <activation>
              <activeByDefault>true</activeByDefault>
              <jdk>1.7</jdk>
          </activation>
          <properties>
              <maven.compiler.source>1.7</maven.compiler.source>
              <maven.compiler.target>1.7</maven.compiler.target>
              <maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>
          </properties>
      </profile>


      <profile>
          <id>sit</id>
          <properties>
             <env>sit</env>
          </properties>
      </profile>


      <profile>
          <id>sit</id>
          <properties>
              <env>sit</env>
          </properties>
          <!-- 设置默认打包环境 -->
          <activation>
              <activeByDefault>true</activeByDefault>
              </activation>
      </profile>

    <!-- 设置私服profile -->
    <profile>
        <id>chinaRepo</id>
         <repositories>
             <repository>
                 <id>control-release</id>
                 <name>provate Nexus of Control</name>
                 <url>http://200.201.202.203:18081/nexus/content/repositories/control-release/</url>
                 <releases><enabled>true</enabled></releases>
                 <snapshots><enabled>true</enabled></snapshots>
             </repository>
             <repository>
                 <id>control-snapshots</id>
                 <name>provate Nexus of Control</name>
                 <url>http://200.201.202.203:18081/nexus/content/repositories/control-snapshots/</url>
                 <releases><enabled>true</enabled></releases>
                 <snapshots><enabled>true</enabled></snapshots>
             </repository>
         </repositories>
    </profile>

    <!-- 仓库配置2 -->
    <profile>
        <id>ggyLocalRepo</id>
        <repositories>
            <repository>
                <id>rockRelease</id>
                <name>provate Nexus of Local</name>
                <url>http://200.201.202.203:9999/nexus/content/repositorie/thirdparty/</url>
                <releases><enabled>true</enabled></releases>
                <snapshots><enabled>true</enabled></snapshots>
            </repository>
        </repositories>
    </profile>

    <server>
        <id>tomcat</id>
        <username>admin</username>
        <password>admin</password>
    </server>
  </profiles>
  
  <activeProfiles>
      <!-- 仓库1 -->
      <activeProfile>chinaRepo<activeProfile>
      <!-- 仓库2 -->      
      <activeProfile>ggyLocalRepo<activeProfile>
  </activeProfiles>
</settings>

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值