eclipse中maven插件上传项目jar包到私服

我们知道,每个公司都会有自己的工具包或公共包,这种包就可以上传到公司的maven私服,就不用每个人都去同步开发包了。那么,怎么把本地项目打包并发布到私服呢?按照如下步骤就可以轻松完成。

1.  在setting.xml文件中增加如下内容:

 
    
      
      nexus
      admin
      admin123
    
    
      nexus-snapshots
      admin
      admin123
    
	
      thirdparty
      admin
      admin123
    
  


2. 在项目的pom.xml文件中增加如下内容

  
	
	    nexus
	    local private nexus
	    http://192.168.xx.xx:8081/nexus/content/groups/public
	
	
	    nexus-snapshots
	    local private nexus snapshots
	    http://192.168.xx.xx:8081/nexus/content/groups/public-snapshots
	
   
 

3.  在项目的 maven bulider中的Goals输入如下内容

deploy:deploy-file -DgroupId=com.ivifi.tools -DartifactId=ivifi.tools -Dversion=1.0-SNAPSHOT -Dpackaging=jar -Dfile=D:\git\tools\visn.tools\target\ivifi.tools-1.0-SNAPSHOT.jar  -Durl=http://192.168.xx.xx:8081/nexus/content/repositories/thirdparty/ -DrepositoryId=thirdparty

你可能感兴趣的:(maven)