用idea建立maven项目时用模板建立慢的解决方法

来源:互联网 发布:javascript 验证表单 编辑:程序博客网 时间:2024/06/14 21:32

首先去maven的conf文件夹中找到setting.xml文件,然后在相应的位置加入以下配置,因为在国内还是aliyun快很多,如下所示:

setting.xml中添加这些配置:

<mirrors>

     <mirror>

      <id>alimaven</id>

      <name>aliyun maven</name>

      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>

      <mirrorOf>central</mirrorOf>        

    </mirror>

  </mirrors>




 </profiles>

 <profile>

        <id>aliyun</id>

        <repositories>

            <repository>

                <id>nexus</id>

                <url>http://maven.aliyun.com/nexus/content/groups/public/</url>

                <releases>

                    <enabled>true</enabled>

                </releases>

                <snapshots>

                    <enabled>false</enabled>

                </snapshots>

            </repository>

        </repositories>

        <pluginRepositories>

            <pluginRepository>

                <id>admin</id>

                <url>http://maven.aliyun.com/nexus/content/groups/public/</url>

                <releases>

                    <enabled>true</enabled>

                </releases>

                <snapshots>

                    <enabled>false</enabled>

                </snapshots>

            </pluginRepository>

        </pluginRepositories>

    </profile>

  </profiles>



 <activeProfiles>

    <activeProfile>aliyun</activeProfile>

</activeProfiles>

从网上下载一个archetype-catalog.xml文件

覆盖C:\Users\uds\.m2\repository\org\apache\maven\archetype\archetype-catalog\3.0.1中的xml文件

此路径为个人本地仓库位置

然后建立项目就贼快!贼快!


原创粉丝点击