Maven私有仓库的基本配置

Maven仓库,私有仓库的设置(在 settings.xml 中配置远程仓库)

     1: 索引更新:将下载的nexus-maven-repository-index.zip包中替换  D:\Nexus\sonatype-work\nexus\indexer\central-ctx
     如果工厂换了,那么索引页需要更换

     2:  配置镜像,覆盖中央仓库的默认地址
         
             
              central
              nexus
              Human Readable Name for this Mirror.
              http://127.0.0.1:8081/nexus/content/groups/public/
             

        

         pom.xml文件中的配置为(在不修改默认配置的情况下):
            
                nexus
                nexus repository
                http://127.0.0.1:8081/nexus/content/groups/public/
                
                    true
                

                
                    true
                

            

         这就表示我们项目中所有的依赖不会到pom.xml文件中的url中找了,而是会倒我们镜像中配置的url中找,
         两者之间是通过id来进行一一对应关联的
     
      3: 如果我们将我们项目pom里面的仓库设置删除、那么我们有一个默认的仓库设置,但是不支持快照版的发布,
     如果我们修改这一默认的配置,就得使用profile。如下配置:
     在我们本地仓库的settings.xml文件中:
          
      
          central-repos
         
        
          central
          Central
          http://central
         
            true
         

         
            true
         

        

         

       

      
     
        central-repos
     

   
     4: 通过以上配置之后我们就可以在nexus上来搜索我们的项目依赖了,而不用去其他的网上maven仓库中查找

你可能感兴趣的:(项目协同管理)