nexus maven私有库搭建

阅读更多
1.下载nexus包,linux命令
wget http://sonatype-download.global.ssl.fastly.NET/nexus/oss/nexus-2.11.4-01-bundle.tar.gz
2.解压nexus包
  tar -zxvf  nexus-2.11.4-01-bundle.tar.gz
3.配置环境变量
  export RUN_AS_USER=root
4.启动命令(start | stop | restart),前提是配置了Java环境,默认端口为8081
./nexus-2.11.4-01/bin/nexus start
5.可以修改自己默认端口(nexus-2.11.4-01/conf/nexus.properties)
6.登录界面:http://IP:8081/nexus
  nexus maven私有库搭建_第1张图片
其中默认用户/密码:admin/admin123
登录后的界面
nexus maven私有库搭建_第2张图片
7.配置本地maven的setting配置
  

  
 D:/MvnRepository
     
    
    nexus-releases
    admin
    admin123
  
  
    nexus-snapshots
    admin
    admin123
  
    
    
    
        nexus
        internal nexus repository
        http://192.168.149.192:8081/nexus/content/groups/public/
        central
    
  
   
    
    nexus
    
      
        nexus
        Nexus
        http://192.168.149.192:8081/nexus/content/groups/public/
        true
        true
      
    
    
      
        nexus
        Nexus
        http://192.168.149.192:8081/nexus/content/groups/public/
        true
        true
    
    

  
    nexus-releases
    Nexus Releases Repository
    http://192.168.149.192:8081/nexus/content/repositories/releases/
  
  
    nexus-snapshots
    Nexus Snapshots Repository
    http://192.168.149.192:8081/nexus/content/repositories/snapshots/
  
 

   
    
    nexus
  


8.pom.xml文件配置:上传私有库代码

        
            
                maven-compiler-plugin
                
                    1.6
                    1.6
                
            
            
                maven-source-plugin
                2.1
                
                    true
                
                
                    
                        compile
                        
                            jar
                        
                    
                
            
        
    

        
            nexus-releases
            Nexus Release Repository
            http://192.168.149.192:8081/nexus/content/repositories/releases/
        
        
            nexus-snapshots
            Nexus Snapshot Repository
            http://192.168.149.192:8081/nexus/content/repositories/snapshots/
        
    

基本配置已完成;
具体详情可参考博客:
http://blog.csdn.net/shenshen123jun/article/details/9084293
http://www.cnblogs.com/luotaoyeah/p/3791966.html


  • nexus maven私有库搭建_第3张图片
  • 大小: 96.7 KB
  • nexus maven私有库搭建_第4张图片
  • 大小: 69.5 KB
  • 查看图片附件

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