搭建的maven仓库如何在本地配置maven下载仓库以及仓库下载优先级

  1. 打开maven的settings.xml文件
  2. 首先可配置maven的本地仓库路径
    1.   D:\java\apache-maven-3.6.3\resourceRoot
  3. 配置自己搭建的maven的服务名以及账号密码
    1. 	
             xxxxServer
             xxxx
             xxxxx
           
  4. 配置镜像地址信息列表
    1. 	
      		xxxxServer
      		xxxxServer
      		http://xxxxxxxxxx/xxxx/repository/internal
      	
      	
              alimaven
              https://maven.aliyun.com/repository/public
              central
          
      	
              nexus-aliyun
              central
              http://maven.aliyun.com/nexus/content/groups/public
          
  5. 配置仓库下载优先级
    1. 	
      		nexus
      		
      			
      				xxxxServer
      				http://xxxxxx/xxxxxx/repository/internal
      				
      					false
      				
      				
      					true
      				
      			
      			
      				nexus-aliyun
      				http://maven.aliyun.com/nexus/content/groups/public
      				
      					false
      				
      				
      					true
      				
      			
      			
      				alimaven
      				https://maven.aliyun.com/repository/public
      				
      					true
      				
      				
      					true
      				
      			
      		
      		
      			
      				xxxxServer
      				http://xxxxxxxx/xxxxxxx/repository/internal
      				
      					false
      				
      				
      					true
      				
      			
      			
      				nexus-aliyun
      				http://maven.aliyun.com/nexus/content/groups/public
      				
      					false
      				
      				
      					true
      				
      			
      			
      				alimaven
      				https://maven.aliyun.com/repository/public
      				
      					true
      				
      				
      					true
      				
      			
      		
      	
  6. 设置活跃配置
    1.     
              nexus
          
  7. 然后在项目中配置好当前的maven的settings.xml就可以愉快的使用maven仓库了

你可能感兴趣的:(java,maven,maven,java)