文件存放位置

全局配置: ${M2_HOME}/conf/settings.xml

用户配置: ${user.home}/.m2/settings.xml

note:用户配置优先于全局配置。${user.home} 和和所有其他系统属性只能在3.0+版本上使用。请注意windows和Linux使用变量的区别。

 

settings.xml详解

声明规范

localRepository

 
 
usr/local/maven

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

   
   
${user.home}/our-project
   
note:如果该profile被激活,则可以再POM中使用${user.install}。

Repositories

   
    
    
     
     
codehausSnapshots
     
     
Codehaus Snapshots
     
     
      
      
false
      
      
always
      
      
warn
     
     
     
      
     
     
     
http://snapshots.maven.codehaus.org/maven2
     
     
default
    
   
   
   
    
          
                
            
     
     
      
     
     
          
        
   

activeProfiles

   
    
    
env-test