maven多仓库私库模板配置

文章目录


xml 复制代码
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">
    <!-- local repository -->
    <localRepository>E:\apache-maven-3.8.5\repository</localRepository>

    <!-- 远程存储库身份验证信息 -->
    <servers>
        <server>
            <id>nexus1</id>
            <username>admin</username>
            <password>password</password>
        </server>
    </servers>

    <!--远程存储库的镜像列表
   <mirrors>
     <mirror>
         <id>aliyun-public</id>
         <mirrorOf>*</mirrorOf>
         <name>aliyun public</name>
         <url>https://maven.aliyun.com/repository/public</url>
     </mirror>
     <mirror>
         <id>aliyun-central</id>
         <mirrorOf>*</mirrorOf>
         <name>aliyun central</name>
         <url>https://maven.aliyun.com/repository/central</url>
     </mirror>
     <mirror>
         <id>aliyun-spring</id>
         <mirrorOf>*</mirrorOf>
         <name>aliyun spring</name>
         <url>https://maven.aliyun.com/repository/spring</url>
     </mirror>
     <mirror>
         <id>aliyun-spring-plugin</id>
         <mirrorOf>*</mirrorOf>
         <name>aliyun spring-plugin</name>
         <url>https://maven.aliyun.com/repository/spring-plugin</url>
     </mirror>
     <mirror>
         <id>aliyun-apache-snapshots</id>
         <mirrorOf>*</mirrorOf>
         <name>aliyun apache-snapshots</name>
         <url>https://maven.aliyun.com/repository/apache-snapshots</url>
     </mirror>
     <mirror>
         <id>aliyun-google</id>
         <mirrorOf>*</mirrorOf>
         <name>aliyun google</name>
         <url>https://maven.aliyun.com/repository/google</url>
     </mirror>
     <mirror>
         <id>aliyun-gradle-plugin</id>
         <mirrorOf>*</mirrorOf>
         <name>aliyun gradle-plugin</name>
         <url>https://maven.aliyun.com/repository/gradle-plugin</url>
     </mirror>
     <mirror>
         <id>aliyun-jcenter</id>
         <mirrorOf>*</mirrorOf>
         <name>aliyun jcenter</name>
         <url>https://maven.aliyun.com/repository/jcenter</url>
     </mirror>
     <mirror>
         <id>aliyun-releases</id>
         <mirrorOf>*</mirrorOf>
         <name>aliyun releases</name>
         <url>https://maven.aliyun.com/repository/releases</url>
     </mirror>
     <mirror>
         <id>aliyun-snapshots</id>
         <mirrorOf>*</mirrorOf>
         <name>aliyun snapshots</name>
         <url>https://maven.aliyun.com/repository/snapshots</url>
     </mirror>
     <mirror>
         <id>aliyun-grails-core</id>
         <mirrorOf>*</mirrorOf>
         <name>aliyun grails-core</name>
         <url>https://maven.aliyun.com/repository/grails-core</url>
     </mirror>
     <mirror>
         <id>aliyun-mapr-public</id>
         <mirrorOf>*</mirrorOf>
         <name>aliyun mapr-public</name>
         <url>https://maven.aliyun.com/repository/mapr-public</url>
     </mirror>

     <mirror>
       <id>maven.net.cn</id>
       <name>Mirror from Maven in china</name>
       <url>http://maven.net.cn/content/groups/public/</url>
       <mirrorOf>central</mirrorOf>
     </mirror>

     <mirror>
       <id>central</id>
       <name>Maven Repository Switchboard</name>
       <url>http://repo1.maven.org/maven2</url>
       <mirrorOf>central</mirrorOf>
     </mirror>

     <mirror>
       <id>repo2</id>
       <name>Human Readable Name for this Mirror.</name>
       <url>http://repo2.maven.org/maven2</url>
       <mirrorOf>central</mirrorOf>
     </mirror>

     <mirror>
       <id>google-maven-central</id>
       <name>Google Maven Central</name>
       <url>https://maven-central.storage.googleapis.com</url>
       <mirrorOf>central</mirrorOf>
     </mirror>

     <mirror>
       <id>blade</id>
       <name>blade</name>
       <url>http://nexus.javablade.com/repository/maven-public/</url>
       <mirrorOf>*</mirrorOf>
     </mirror>

     <mirror>
       <id>maven-default-http-blocker</id>
       <mirrorOf>external:http:*</mirrorOf>
       <name>Pseudo repository to mirror external repositories initially using HTTP.</name>
       <url>http://0.0.0.0/</url>
       <blocked>true</blocked>
     </mirror>
   </mirrors>
 -->
     <mirrors>
        <mirror>
            <id>aliyunmaven</id>
            <mirrorOf>*</mirrorOf>
            <name>阿里云公共仓库</name>
            <url>https://maven.aliyun.com/repository/public</url>
        </mirror>
    </mirrors>
    <!-- profiles
     | This is a list of profiles which can be activated in a variety of ways, and which can modify
     | the build process. Profiles provided in the settings.xml are intended to provide local machine-
     | specific paths and repository locations which allow the build to work in the local environment.
     |
     | For example, if you have an integration testing plugin - like cactus - that needs to know where
     | your Tomcat instance is installed, you can provide a variable here such that the variable is
     | dereferenced during the build process to configure the cactus plugin.
     |
     | As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles
     | section of this document (settings.xml) - will be discussed later. Another way essentially
     | relies on the detection of a property, either matching a particular value for the property,
     | or merely testing its existence. Profiles can also be activated by JDK version prefix, where a
     | value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'.
     | Finally, the list of active profiles can be specified directly from the command line.
     |
     | NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact
     |       repositories, plugin repositories, and free-form properties to be used as configuration
     |       variables for plugins in the POM.
     |
     |-->
    <profiles>
        <profile>
            <id>jdk8</id>

            <activation>
                <activeByDefault>true</activeByDefault>
                <jdk>1.8</jdk>
            </activation>
            <properties>
                <maven.compiler.source>1.8</maven.compiler.source>
                <maven.compiler.target>1.8</maven.compiler.target>
                <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
            </properties>
        </profile>
        <profile>
            <id>jdk11</id>

            <activation>
                <activeByDefault>true</activeByDefault>
                <jdk>11</jdk>
            </activation>
            <properties>
                <maven.compiler.source>11</maven.compiler.source>
                <maven.compiler.target>11</maven.compiler.target>
                <maven.compiler.compilerVersion>11</maven.compiler.compilerVersion>
            </properties>
        </profile>
        <profile>
            <id>aliyun</id>
            <repositories>
                <repository>
                    <id>aliyun</id>
                    <url>https://maven.aliyun.com/repository/public</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                        <updatePolicy>always</updatePolicy>
                    </snapshots>
                </repository>
            </repositories>
        </profile>

        <profile>
            <id>huaweicloud</id>
            <repositories>
                <repository>
                    <id>huaweicloud</id>
                    <url>https://repo.huaweicloud.com/repository/maven/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                        <updatePolicy>always</updatePolicy>
                    </snapshots>
                </repository>
            </repositories>
        </profile>

        <profile>
            <id>spring</id>
            <repositories>
                <repository>
                    <id>spring</id>
                    <url>https://maven.aliyun.com/repository/spring</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                        <updatePolicy>always</updatePolicy>
                    </snapshots>
                </repository>
            </repositories>
        </profile>

        <profile>
            <id>spring-plugin</id>
            <repositories>
                <repository>
                    <id>spring-plugin</id>
                    <url>https://maven.aliyun.com/repository/spring-plugin</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                        <updatePolicy>always</updatePolicy>
                    </snapshots>
                </repository>
            </repositories>
        </profile>

        <profile>
            <id>google</id>
            <repositories>
                <repository>
                    <id>google</id>
                    <url>https://maven.aliyun.com/repository/google</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                        <updatePolicy>always</updatePolicy>
                    </snapshots>
                </repository>
            </repositories>
        </profile>

        <profile>
            <id>apache-snapshots</id>
            <repositories>
                <repository>
                    <id>apache-snapshots</id>
                    <url>https://maven.aliyun.com/repository/apache-snapshots</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                        <updatePolicy>always</updatePolicy>
                    </snapshots>
                </repository>
            </repositories>
        </profile>

        <profile>
            <id>gradle-plugin</id>
            <repositories>
                <repository>
                    <id>gradle-plugin</id>
                    <url>https://maven.aliyun.com/repository/gradle-plugin</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                        <updatePolicy>always</updatePolicy>
                    </snapshots>
                </repository>
            </repositories>
        </profile>

        <profile>
            <id>grails-core</id>
            <repositories>
                <repository>
                    <id>grails-core</id>
                    <url>https://maven.aliyun.com/repository/grails-core</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                        <updatePolicy>always</updatePolicy>
                    </snapshots>
                </repository>
            </repositories>
        </profile>

        <profile>
            <id>spring-milestone</id>
            <repositories>
                <repository>
                    <id>spring-milestone</id>
                    <url>http://repo.spring.io/milestone</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                        <updatePolicy>always</updatePolicy>
                    </snapshots>
                </repository>
            </repositories>
        </profile>

        <profile>
            <id>spring-snapshot</id>
            <repositories>
                <repository>
                    <id>spring-snapshot</id>
                    <url>http://repo.spring.io/snapshot</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                        <updatePolicy>always</updatePolicy>
                    </snapshots>
                </repository>
            </repositories>
        </profile>

        <profile>
            <id>maven.net.cn</id>
            <repositories>
                <repository>
                    <id>maven.net.cn</id>
                    <url>http://maven.net.cn/content/groups/public/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                        <updatePolicy>always</updatePolicy>
                    </snapshots>
                </repository>
            </repositories>
        </profile>

        <profile>
            <id>maven2-repo1</id>
            <repositories>
                <repository>
                    <id>maven2-repo1</id>
                    <url>http://repo1.maven.org/maven2</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                        <updatePolicy>always</updatePolicy>
                    </snapshots>
                </repository>
            </repositories>
        </profile>

        <profile>
            <id>maven2-repo2</id>
            <repositories>
                <repository>
                    <id>maven2-repo2</id>
                    <url>http://repo2.maven.org/maven2</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                        <updatePolicy>always</updatePolicy>
                    </snapshots>
                </repository>
            </repositories>
        </profile>

        <profile>
            <id>blade-public</id>
            <repositories>
                <repository>
                    <id>blade-public</id>
                    <url>http://nexus.javablade.com/repository/maven-public/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                        <updatePolicy>always</updatePolicy>
                    </snapshots>
                </repository>
            </repositories>
        </profile>
    </profiles>

    <!-- 对于所有构建都是活动的配置文件列表-->
    <activeProfiles>
        <activeProfile>aliyun</activeProfile>
        <activeProfile>huaweicloud</activeProfile>
        <activeProfile>spring</activeProfile>
        <activeProfile>spring-plugin</activeProfile>
        <activeProfile>google</activeProfile>
        <activeProfile>apache-snapshots</activeProfile>
        <activeProfile>maven.net.cn</activeProfile>
        <activeProfile>maven2-repo1</activeProfile>
        <activeProfile>maven2-repo2</activeProfile>
        <activeProfile>blade-public</activeProfile>
        <activeProfile>spring-milestone</activeProfile>
        <activeProfile>spring-snapshot</activeProfile>
        <activeProfile>gradle-plugin</activeProfile>
        <activeProfile>grails-core</activeProfile>
    </activeProfiles>
</settings>
相关推荐
2401_857610039 分钟前
Spring Boot框架:电商系统的技术优势
java·spring boot·后端
希忘auto25 分钟前
详解MySQL安装
java·mysql
冰淇淋烤布蕾37 分钟前
EasyExcel使用
java·开发语言·excel
拾荒的小海螺43 分钟前
JAVA:探索 EasyExcel 的技术指南
java·开发语言
Jakarta EE1 小时前
正确使用primefaces的process和update
java·primefaces·jakarta ee
马剑威(威哥爱编程)1 小时前
哇喔!20种单例模式的实现与变异总结
java·开发语言·单例模式
java—大象1 小时前
基于java+springboot+layui的流浪动物交流信息平台设计实现
java·开发语言·spring boot·layui·课程设计
杨哥带你写代码2 小时前
网上商城系统:Spring Boot框架的实现
java·spring boot·后端
camellias_2 小时前
SpringBoot(二十一)SpringBoot自定义CURL请求类
java·spring boot·后端
布川ku子2 小时前
[2024最新] java八股文实用版(附带原理)---Mysql篇
java·mysql·面试