博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

maven config配置模板

Posted on 2021-11-18 17:02  青柠时光  阅读(50)  评论(0编辑  收藏  举报

示例

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
 
  <localRepository>D:\maven\repo</localRepository>


  <servers>
      <!-- 账号密码配置-->
     <server>
            <id>snapshots</id>
            <username>myname1</username>
            <password>mypsd1</password>
        </server>
        <server>
            <id>releases</id>
            <username>myname2</username>
            <password>mypsd2</password>
        </server>
  </servers>
  <profiles>

     <profile>
            <id>dev</id>
            <activation>
                <jdk>1.8</jdk>
            </activation>
       <repositories>
                 <!-- 仓库1 -->
        <repository>
            <id>neop</id>
            <url>http://域名/nexus/content/groups/public/</url>
            <snapshots>
                <updatePolicy>always</updatePolicy>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>
 
        </profile>
  </profiles>

   <activeProfiles>
        <activeProfile>dev</activeProfile>
        <!-- <activeProfile>nexus-snapshots</activeProfile> -->
    </activeProfiles>

    
    
</settings>