maven多仓库私库模板配置

文章目录


<?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>

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
在IDEA中配置Maven,你可以按照以下步骤进行操作: 1. 打开IDEA,点击左上角的File选项,然后选择Settings。 2. 在Settings窗口中,找到左侧的Build, Execution, Deployment选项,展开后选择Build Tools,然后选择Maven。 3. 在右侧的Maven选项中,你可以配置Maven的路径。如果你还没有安装Maven,可以点击右侧的链接下载并安装。 4. 在Maven配置中,你可以指定Maven的本地仓库位置。默认情况下,本地仓库路径是在用户目录下的.m2文件夹。如果你想修改本地仓库的路径,可以在这里进行设置。你可以点击右侧的文件夹图标来选择新的路径。 5. 配置完成后,点击Apply或OK按钮保存更改。 引用提到了Maven的本地仓库路径,默认情况下是在C:\Users\你的用户名\.m2\repository。你可以根据需要修改为其他路径,如D盘。请注意,修改路径后需要重新导入依赖。 另,如果你是在新建项目时配置Maven,你可以按照引用中的步骤进行操作:创建项目时选择maven-archetype-webapp模板,然后修改项目名称、指定Maven的目录和配置文件路径,最后完成项目的创建。这样,在下载jar包时,它们会被自动放入你指定的本地仓库中。 希望以上信息对你有所帮助,祝你成功!<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* *3* [IDEA配置Maven——(傻瓜式教程)](https://blog.csdn.net/qq_45867488/article/details/115748607)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

最难不过坚持丶渊洁

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值