如何让 Maven 来使用 Nexus 本地仓库用来替代使用远程仓库

2025-03-18 17:05:08
推荐回答(1个)
回答1:

在Settings.xml文件(默认文件位置在:C:\Users\用户名\.m2\)中配置你的Maven的默认地址指向你的Nexus仓库,配置如下:


    
        
            dev
            
                
                    nexus
                    
你的nexus)

                    
                        true
                    

                    
                        false
                    

                

            

            
                
                    nexus
                    
(你的nexus)

                    
                        true
                    

                    
                        false
                    

                

            

        

    

 


如果有用户名密码:

  
      
        nexus-releases
        admin
        admin123
      

      
         nexus-snapshots
         admin
         xxx