【仅供内部供应商使用,不提供对外解答和培训】

Page tree

【仅供内部供应商使用,不提供对外解答和培训】

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

第一步修改${MAVEN_HOME}/conf下settings.xml

1、在<mirrors>标签下增加如下内容(该步骤可选)

<mirror>
   <id>fanruan</id>
   <mirrorOf>*</mirrorOf>
   <name>fanruan</name>
   <url>http://mvn.finedevelop.com/repository/maven-public/</url>
 </mirror>

 

注1:mac下如果是通过brew安装的maven,该配置在 /usr/local/Cellar/maven@version/version/libexec目录下

注2:IDEA默认的maven配置路径,可打开Preferences->Build,Excution,Deployment->Build Tools->Maven,找到Users settings file属性的值,同时修改这个配置文件

2、在  <profiles>标签下增加如下内容,snapshots的enable状态一定要是true,否则无法自动更新

<profile>
    <id>fanruan</id>
    <repositories>
        <repository>
            <id>fanruan</id>
            <name>fanruan</name>
            <url>http://mvn.finedevelop.com/repository/maven-public/</url>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
                <checksumPolicy>warn</checksumPolicy>
            </snapshots>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>fanruan</id>
            <name>fanruan</name>
            <url>http://mvn.finedevelop.com/repository/maven-public/</url>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
                <checksumPolicy>warn</checksumPolicy>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>
</profile>

3、在 <activeProfiles>标签下 增加如下内容

<activeProfile>fanruan</activeProfile>

注意 1、2、3提到的三个主标签是同级关系

  • No labels