Maven setting.xml 配置详解

2023年 5月 4日 23.5k 0

maven settings.xml详解
Maven setting.xml 配置详解
Maven

settings.xml详解

声明规范

 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

/opt/repository

interactiveMode

true

usePluginRegistry

false

offline

false

pluginGroups


  
  org.codehaus.mojo

proxies


  
  
   
   myproxy
   
   true
   
   http
   
   proxy.somewhere.com
   
   8080
   
   proxyuser
   
   somepassword
   
   *.google.com|ibiblio.org
  

servers


  
  
   
   server001
   
   my_login
   
   my_password
   
   ${usr.home}/.ssh/id_dsa
   
   some_passphrase
   
   664
   
   775
  

mirrors

  
  
   
   planetmirror.com
   
   PlanetMirror Australia
   
   http://downloads.planetmirror.com/pub/maven2
   
   central
  

profiles


  
  
   
   test

Activation

   

    false

    1.5

    

     Windows XP

     Windows

     x86

     5.1.2600
    

    

     mavenVersion

     2.0.3
    

    

     ${basedir}/file2.properties

     ${basedir}/file1.properties
    
   

Properties

      
        /path/to/tomcat/instance
      

Repositories

 
           nexus 
           local private nexus 
           http://localhost:8081/nexus/content/groups/public 
           true
            true
   






    

     codehausSnapshots

     Codehaus Snapshots

     

      false

      always

      warn
     

     
      
     

     http://snapshots.maven.codehaus.org/maven2

     default
    
   

   
 
                     
           
      
     
     
      
     
     
          
        
  
 

activeProfiles

默认配置:
 
    devactiveProfile> 
    
activeProfiles>

配置解释:


 
    
    env-testactiveProfile>
 activeProfiles>
settings>

例子:
我们公司nexus地址:172.16.1.40
Maven settings.xml 如下:

xml version="1.0" encoding="UTF-8"?>




 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">
  
  /opt/repository
  

  

  
  
    
    org.apache.maven.plugins
    org.mortbay.jetty
        com.oracle.weblogic
  

  
  
    
  

  
  
    

    
 
    
        nexus
        admin
        anonymous123
    
    
        releases
        admin
        anonymous123
    
    
        snapshots
        admin
        anonymous123
    

        
            thirdparty
            admin
            anonymous123
        
  

  
  
    
  
   
            nexus
            internal nexus repository
            http://172.16.1.40:8080/nexus/content/groups/public 
            * 
         

  

  
  
    

    
    

   
 
apatch 
 
 
re-apatch 
remote apatch 
http://inno.starhubdev.com/nexus/content/groups/public/

true


true



 
 


 
ibiblio 
 
 
re-ibiblio 
remote ibiblio 
https://nexus.sourcesense.com/nexus/content/repositories/public/ 

true


true

 
 
 





 
redev 
 
 
re-nexus 
remote nexus 
http://repository.sonatype.org/content/groups/public/ 

true


true

 
 
 





            dev
            
                
                    nexus
                    http://172.16.1.40:8080/nexus/content/groups/public
                    true
                    true
                
            
            
                
                    nexus
                    http://172.16.1.40:8080/nexus/content/groups/public
                    true
                    true
                
            
    
  

  
   
    dev 
    
    


相关文章:

  1. Jenkins+Maven+SVN+Nexus 搭建持续集成环境
  2. Kubernetes 1.14 二进制集群安装
  3. Kubenetes 1.13.5 集群二进制安装
  4. Kuerbernetes 1.11 集群二进制安装

相关文章

服务器端口转发,带你了解服务器端口转发
服务器开放端口,服务器开放端口的步骤
产品推荐:7月受欢迎AI容器镜像来了,有Qwen系列大模型镜像
如何使用 WinGet 下载 Microsoft Store 应用
百度搜索:蓝易云 – 熟悉ubuntu apt-get命令详解
百度搜索:蓝易云 – 域名解析成功但ping不通解决方案

发布评论