Maven setting.xml 配置详解

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 
    
    


「点点赞赏,手留余香」

    还没有人赞赏,快来当第一个赞赏的人吧!
2 条回复 A 作者 M 管理员
  1. 博主你这网站插件太多了,我一上你这网站cpu就飙升
    • 后期会进行优化,现在关闭了几个插件!
欢迎您,新朋友,感谢参与互动!欢迎您 {{author}},您在本站有{{commentsCount}}条评论
网站搭建
加入我们
  • 站长QQ:381493251一键联系
  • abcdocker 微信公众号
    abcdocker QQ群