maven手动上传Jar包到nexus私服命令

1  在本地电脑安装maven环境配置,运行

mvn -version 检查是否正确安装成功

2 将要上传的包拷贝到文件夹中

3 在当前文件夹中打开命令窗口

4 运行maven上传jar包命令(包含release版本和snapshots)

mvn deploy:deploy-file -DgroupId=xxx.webgleaner -DartifactId=webgleaner-clound -Dversion=2.2.0-SNAPSHOT -Dpackaging=jar -Dfile=webgleaner-clound-2.2.0-SNAPSHOT.jar -Durl=http://nexus.xxx.com/content/repositories/snapshots -DrepositoryId=snapshots


mvn deploy:deploy-file -DgroupId=com.javacsv -DartifactId=csvreader -Dversion=2.1 -Dpackaging=jar -Dfile=csvreader-2.1.jar -Durl=http://nexus.xxx.com/content/repositories/releases -DrepositoryId=releases

根据要上传包的版本选择对应的命令配置

附 maven的settings.xml文件




  
    aliyun-profile
  

  
	
 	nexus-aliyun
	*
	Nexus aliyun
	http://106.75.152.xxx:8081/content/groups/public
	
   

    
        
            releases
            deploy
            xxx
        
        
            snapshots
            admin
            xxx
        
    
  
  
    releases
	releases
    http://106.75.152.xxx:8081/content/repositories/releases
  
  
    snapshots
	snapshots
    http://106.75.152.xxx:8081/content/repositories/snapshots
   

  

  
    
      aliyun-profile
      
        UTF-8
        ${encoding}
        ${encoding}
      
      
	
	nexus
	local private nexus
	http://106.75.152.xxx:8081/content/groups/public
		
			true
		
		
			true
		
		
      
      
          
			nexus
			local private nexus
			http://106.75.152.xxx:8081/content/groups/public
			
			true
			
			
			true
			
		
      
    
	
		jdk-1.8
		
			true
			1.8
		
		
			1.8
			1.8
			1.8
		
	
  
  







你可能感兴趣的:(Maven)