将项目生成maven模板(构件)并且上传到googlecode

===========项目生成maven模板 start=======================
call mvn eclipse:clean
call mvn clean
call mvn archetype:create-from-project  
cd target/generated-sources/archetype
call mvn install  -DcreateChecksum=true  
cd ../../../
call mvn eclipse:eclipse
REM OK
:end
pause
将上述内容保存为bat,并且在项目根目录下执行
===============项目生成maven模板 end====================


============安装nexus服务器 start================
下载 nexus(http://www.sonatype.org/nexus/),安装并且启动.   .

默认管理员  admin/admin123
登录系统后  把release目录(仓库)由[Disable Redeploy]切换成[Allow Redeploy].
note*  
Maven区别对待release版本的构件和snapshot版本的构件,snapshot为开发过程中的版本,实时,但不稳定,release版本则比较稳定。Maven会根据你项目的版本来判断将构件分发到哪个仓库。
==============安装nexus服务器 end================


=============准备maven配置 start=====================
在maven的setting.xml中添加 
-----------------
  <server>  
     <id>nexus-releases</id>  
    <username>deployment</username>    
  <password>deployment123</password>  
  </server>  
  <server>  
 
  <id>nexus-snapshots</id>    
  <username>deployment</username>  
    <password>deployment123</password>  
  </server>  

-----------------

===============准备maven配置 end====================

================配置构件的pom.xml start=========================
切换到项目的[\target\generated-sources\archetype]目录  ,在该目录下的pom.xml文件中新增

-----------------

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

-----------------

==============配置构件的pom.xml end================

把nexus的[\sonatype-work\nexus\storage]下的release目录svn到 google code上.
以后就可以方便的用该模板快速的生成项目了.

example  :
mvn archetype:generate -B -DarchetypeGroupId=com.cyjt.ipms  -DarchetypeArtifactId=bus-web-archetype -DarchetypeVersion=1.0 -DarchetypeRepository=http://myfirst-cmcc.googlecode.com/svn/repository/ -DgroupId=com.company.project -DartifactId=srs -Dversion=1.0




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值