`
winzenghua
  • 浏览: 1370769 次
  • 性别: Icon_minigender_2
  • 来自: 广州
文章分类
社区版块
存档分类
最新评论

Maven2+Subversion+CruiseContril

阅读更多

1. Install CruiseControl 2.7.2

2. Install Maven 2.0.9

3. Install Subversion 1.4.6

4. Set path=”${Maven_Home}\bin;${Subversion_Home}\bin”

5. Set MAVEN2_HOME==”${Maven_Home}\”

6. F:\svnrepository>svnadmin create f:\svnrepository

7. F:\tmp>mvn archetype:create -DgroupId=org.aaron -DartifactId=abc

8.

F:\> mkdir tmp\project

F:\> cd tmp\project

F:\tmp\project> mkdir branches

F:\tmp\project> mkdir tags

F:\tmp\project> mkdir trunk

F:\Tmp\project> dir

Volume in drive F is GWCS60

Volume Serial Number is E472-052C

Directory of F:\tmp\project

12.09.2004 11:53 <DIR> .

12.09.2004 11:53 <DIR> ..

12.09.2004 11:53 <DIR> branches

12.09.2004 11:53 <DIR> tags

12.09.2004 11:53 <DIR> trunk

0 File(s) 0 bytes

5 Dir(s) 7?98?42?76 bytes free

F:\tmp\project>

9. abc文件夹下的所有东西都拷贝到F:\tmp\project\trunk下面

10. F:\tmp>svn import F:\tmp\project file:///f:/svnrepository -m "Initial import"

11. 创建CruiseControl的工作目录,结构如下

ccworkplace\

\logs

\project_name

\checkout

\project_name

\artifacts

\project_name

注:CruiseControl支持构建多个项目,每个项目涉及:logscheckoutartifacts。它们的作用分别是:记录build结果、checkout代码的工作目录、部件发布地。这个结构就是为了这三个目的而创建的,每一级下的project_name都是对应的

12. 修改%CruiseControl_Home%/ webapps/cruisecontrol/WEB-INF/web.xml

查找:context-param logDir;修改它的值:…/ccworkplace/logs 查找:ArtifactServletinit-param rootDir;修改它的值:…/ccworkplace/artifacts

13. 修改%CruiseControl_Home%/config.xml,内容

<cruisecontrol>

<property name="cruisedir" value="F:/ccworkplace"/>

<property name="logdir" value="${cruisedir}/logs"/>

<property name="checkoutdir" value="${cruisedir}/checkout"/>

<property name="artifactdir" value="${cruisedir}/artifacts"/>

<project name="Project">

<listeners>

<currentbuildstatuslistener file="${logdir}/${project.name}/status.txt"/>

</listeners>

<bootstrappers>

<svnbootstrapper localWorkingCopy="${checkoutdir}/${project.name}" />

</bootstrappers>

<modificationset quietperiod="30">

<svn RepositoryLocation="file:///F:/svnrepository/trunk"/>

</modificationset>

<schedule interval="30">

<maven2 mvnscript="E:/apache-maven-2.0.9/bin/mvn.bat"

pomfile="${checkoutdir}/${project.name}/pom.xml"

goal="scm:update clean site package"/>

</schedule>

<log dir="${logdir}/${project.name}">

<merge dir="${checkoutdir}/${project.name}/target/surefire-reports"/>

</log>

<publishers>

<onsuccess>

<artifactspublisher dest="${artifactdir}/${project.name}"

file="${checkoutdir}/${project.name}/target/abc-1.0-SNAPSHOT.jar"/>

</onsuccess>

</publishers>

</project>

</cruisecontrol>

14. 运行%CruiseControl_Home%/cruisecontrol.bat,因为cruisecontrol.bat已经自带了jetty,之后进入:http://localhost:8080/即可

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics