zoukankan      html  css  js  c++  java
  • maven将镜像站点改为中国开源镜像点

       在Apache官网上下载bin文件,解压到相应目录。然后配置/etc/profile即可,环境变量名为M2_HOME,如下:(配置完后注意source /etc/profile)
    #Maven
    export M2_HOME=/usr/local/apache-maven-3.3.1
    export PATH=$PATH:$M2_HOME/bin
    由于编译时要下载很多东西,我们可以编辑mavenconfsettings.xml文件,将镜像站点改为中国开源镜像点,如下:
    <mirrors>
        <mirror>

           <id>nexus-osc</id>

           <mirrorOf>*</mirrorOf>

            <name>Nexusosc</name>

           <url>http://maven.oschina.net/content/groups/public/</url>

        </mirror>
    </mirrors>
    和(注意不要把这个文件改错了)
    <profiles>
    <profile>
        <id>jdk-1.7</id>
            <activation>

                   <jdk>1.7</jdk>

            </activation>
            <repositories>

                   <repository>

                           <id>nexus</id>

                           <name>local private nexus</name>

                            <url>http://maven.oschina.net/content/groups/public/</url>

                           <releases>

                                   <enabled>true</enabled>

                           </releases>

                           <snapshots>

                                   <enabled>false</enabled>

                           </snapshots>

                   </repository>

            </repositories>

           <pluginRepositories>

                   <pluginRepository>

                           <id>nexus</id>

                           <name>local private nexus</name>

                           <url>http://maven.oschina.net/content/groups/public/</url>

                           <releases>

                                   <enabled>true</enabled>

                           </releases>

                            <snapshots>

                                   <enabled>false</enabled>

                           </snapshots>

                   </pluginRepository>

           </pluginRepositories>

        </profile>
    </profiles>
    然后将这个mavenconfsettings.xml文件拷贝到~/.m2文件夹下,保证用户每次使用maven都可以用到这个配置(.m2是个隐藏文件夹)

  • 相关阅读:
    使用helm管理复杂kubernetes应用
    helm repository 相关
    PSQLException: An I/O error occurred while sending to the backend.
    使用helm进行kubernetes包管理
    Slave作为其它Slave的Master时使用
    ext3是对ext2文件系统的一个扩展高性能日志文件系统
    ready是先执行的,load后执行,DOM文档的加载步骤
    jQuery上定义插件并重设插件构造函数
    在PHP与HTML混合输入的页面或者模板中就需要对PHP代码进行闭合
    decode 函数将字符串从某种编码转为 unicode 字符
  • 原文地址:https://www.cnblogs.com/ilinuxer/p/5041575.html
Copyright © 2011-2022 走看看