{转}maven+continuum安装与配置

为什么80%的码农都做不了架构师?>>>   hot3.png

 

一、下载

1.  maven:

项目管理工具,可以进行项目的编译、测试、布置、发布等

下载路径:http://apache.etoak.com/maven/binaries/apache-maven-2.2.1-bin.zip

2.  continuum:

基本实现的功能:

定时(也可能手动)从SVN中下载项目进行编译,并生成编译后的报告给指定人员,生成的报告内容有:

1.       commit人、commit时间

2.       编译环境

3.       maven运行后的结果:包括编译、运行testcase、打包、布置等等的信息(可自定义配置)

4.       运行是否成功

5.       online report

下载路径:http://apache.etoak.com/continuum/binaries/apache-continuum-1.2.3-bin.zip

 

二、安装maven

1.  解压apache-maven-2.2.1-bin.zip至其一目录,如:D:\Developer\maven,目录结构如下:

 

2.  设置环境变量:

M2_HOME= D:\Developer\maven

PATH=% M2_HOME%\bin;%path%

3.  测试是否安装成功:mvn –v

 

三、安装continuum

1.  解压apache-continuum-1.2.3-bin.zip至其一目录,如:D:\Developer\continuum,目录结构如下:

 

2.  安装SVN客户端(CollabNetSubversion-client-1.6.9-1.win32.exe)

3.  修改配置文件:

a)         修改D:\Developer\continuum\conf\jetty.xml,将validation_mail部分修改为:

       

<New id="validation_mail" class="org.mortbay.jetty.plus.naming.Resource">    
<Arg>mail/Session</Arg><Arg><New class="org.mortbay.naming.factories.MailSessionReference"><Set name="user">zhaoxy1@china-channel.com</Set><Set name="password">******</Set><Set name="properties"><New class="java.util.Properties"><Put name="mail.smtp.host">mail.china-channel.com</Put><Put name="mail.from">zhaoxy1@china-channel.com</Put><Put name="mail.smtp.auth">true</Put><Put name="mail.debug">false</Put></New></Set></New></Arg></New>
 

b)         修改

D:\Developer\continuum\apps\continuum\WEB-INF\classes\META-INF\plexus\application.xml,修改from-mailboxfrom-name部分:

<from-mailbox>zhaoxy1@china-channel.com</from-mailbox>
<from-name>zhaoxy1</from-name>
 

4.  运行continuum

D:\Developer\continuum\bin\continuum.bat console

也可以将其安装至windows服务中,在开机时自动启动:D:\Developer\continuum\bin\continuum.bat install

D:\Developer\continuum\bin\continuum.bat start

5.  进入continuum

访问网站:http://localhost:8080/continuum/

log详见: D:\Developer\continuum\logs\continuum.log

第一次使用需设置管理员帐号与密码

四、配置SVN commit后自动发邮件:

新增脚本:post-commit.bat,写入发邮件的代码,可参考以下:

http://hi.baidu.com/anydb/blog/item/4112d01aac5db4be4aedbc24.html

五、测试

1.  编写maven测试项目:

cd workspace

mvn archetype:create -DgroupId=com.oreilly -DartifactId=my-app

2.  修改pom.xml文件,红色部分为continuum的配置:

<project
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.mycompany.app</groupId><artifactId>my-app</artifactId><packaging>jar</packaging><version>1.0-SNAPSHOT</version><name>my-app</name><url>http://maven.apache.org</url><developers><developer><id>zhaoxunyong</id><name>zhaoxunyong</name><email>zhaoxunyong@139.com</email><url>http://mail.139.com</url><organization>Sonatype</organization><organizationUrl>http://www.35.cn</organizationUrl><roles><role>developer</role></roles><timezone>-6</timezone></developer></developers><ciManagement><system>continuum</system><url>http://192.168.0.10:8080/continuum</url><notifiers><notifier><type>mail</type><sendOnError>true</sendOnError><sendOnFailure>true</sendOnFailure><sendOnSuccess>true</sendOnSuccess><sendOnWarning>true</sendOnWarning><address>zhaoxy1@china-channel.com</address></notifier></notifiers></ciManagement><scm><connection>scm:svn:http://192.168.0.10:81/svn/my-app</connection></scm><dependencies><dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>3.8.1</version><scope>test</scope></dependency></dependencies><build><filters><filter>src/main/filters/filter.properties</filter></filters><resources><resource><directory>src/main/resources</directory><filtering>true</filtering></resource></resources></build><properties><my.filter.key>key!</my.filter.key></properties>
</project>
 

3.  上传maven项目:

 

4.  配置发邮件部分

 

 

5.  配置schedules,具体设置如linux下的cron

6.  Build:系统会将build结果以mail方式通知对应的人员

 

具体内容如下:

Online report : http://localhost:8080/continuum/buildResult.action?buildId=69&projectId=36

 

Build statistics:

  State: Ok

  Previous State: Ok

  Started at: 星期一 1 三月 2010 15:56:01 +0800

  Finished at: 星期一 1 三月 2010 15:56:10 +0800

  Total time: 9s

  Build Trigger: Schedule

  Build Number: 13

  Exit code: 0

  Building machine hostname: myserver

  Operating system : Windows 2003(Service Pack 2)

  Java Home version :

          java version "1.6.0_14"

          Java(TM) SE Runtime Environment (build 1.6.0_14-b08)

          Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode, sharing)

       

  Builder version :

          Apache Maven 2.2.1 (r801777; 2009-08-07 03:16:01+0800)

          Java version: 1.6.0_14

          Java home: D:\Java\jdk1.6\jre

          Default locale: zh_CN, platform encoding: GBK

          OS name: "windows 2003" version: "5.2" arch: "x86" Family: "windows"

   

****************************************************************************

SCM Changes:

****************************************************************************

Changed: zhaoxy1 @ 星期一 1 三月 2010 15:54:08 +0800

Comment:

Files changed:

  /src/main/java/com/mycompany/app/App.java ( 24 )

 

****************************************************************************

Dependencies Changes:

****************************************************************************

No dependencies changed

 

 

****************************************************************************

Build Definition:

****************************************************************************

POM filename: pom.xml

Goals: clean install  

Arguments: --batch-mode --non-recursive

Build Fresh: false

Always Build: false

Default Build Definition: true

Schedule: DEFAULT_SCHEDULE

Profile Name: maven

Description: Default Maven 2 Build Definition

 

****************************************************************************

Test Summary:

****************************************************************************

Tests: 1

Failures: 0

Errors: 0

Success Rate: 100

Total time: 0.047 s.

 

 

****************************************************************************

Output:

****************************************************************************

[INFO] Scanning for projects...

[INFO] ------------------------------------------------------------------------

[INFO] Building my-app

[INFO]    task-segment: [clean, install]

[INFO] ------------------------------------------------------------------------

[INFO] [clean:clean {execution: default-clean}] [INFO] Deleting directory D:\continuum\data\working-directory\36\target

[INFO] [resources:resources {execution: default-resources}] [WARNING] File encoding has not been set, using platform encoding GBK, i.e. build is platform dependent!

[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!

[INFO] Copying 1 resource

[INFO] [compiler:compile {execution: default-compile}] [INFO] Compiling 1 source file to D:\continuum\data\working-directory\36\target\classes

[INFO] [resources:testResources {execution: default-testResources}] [WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!

[INFO] skip non existing resourceDirectory D:\continuum\data\working-directory\36\src\test\resources

[INFO] [compiler:testCompile {execution: default-testCompile}] [INFO] Compiling 1 source file to D:\continuum\data\working-directory\36\target\test-classes

[INFO] [surefire:test {execution: default-test}] [INFO] Surefire report directory: D:\continuum\data\working-directory\36\target\surefire-reports

 

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

 T E S T S

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

Running com.mycompany.app.AppTest

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.046 sec

 

Results :

 

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

 

[INFO] [jar:jar {execution: default-jar}] [INFO] Building jar: D:\continuum\data\working-directory\36\target\my-app-1.0-SNAPSHOT.jar

[INFO] [install:install {execution: default-install}] [INFO] Installing D:\continuum\data\working-directory\36\target\my-app-1.0-SNAPSHOT.jar to C:\Documents and Settings\Administrator\.m2\repository\com\mycompany\app\my-app\1.0-SNAPSHOT\my-app-1.0-SNAPSHOT.jar

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESSFUL

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 7 seconds

[INFO] Finished at: Mon Mar 01 15:56:10 CST 2010 [INFO] Final Memory: 12M/26M [INFO] ------------------------------------------------------------------------

 

****************************************************************************

 

转载于:https://my.oschina.net/piorcn/blog/310552

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/264438.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

六种方法,做一名更好的开发者

六种方法&#xff0c;做一名更好的开发者2008-12-13 23:381. 交谈 尽可能多地跟其他软件开发者交谈&#xff1b;培养个人关系&#xff1b;跟意见与你相左的人交流&#xff1b;跟经验更丰富的人交流&#xff1b;跟阅历丰富的人交流。多到Groups 中去&#xff0c;尤其是交谈…

.net Excel导出出现乱码及excel打开出现错误提示

测试人员测试发现。导出excel出现乱码以及出现文件可正常导出、后几次导出却异常。 使用的系统浏览器&#xff1a; 其他360浏览器、谷歌浏览器均正常。 出现情况如下&#xff1a; 查资料发现&#xff0c;之前导出代码编写的 Response.AppendHeader("Content-Disposition&q…

stract oracle,ORACLE 字符串聚合函数 strCat

源码如下&#xff1a;create or replace type strcat_type as object(currentstr varchar2(4000),currentseprator varchar2(8),static function ODCIAggregateInitialize(sctx IN OUT strcat_type) return number,member function ODCIAggregateIterate(self IN OUT strcat_ty…

您请求的报表需要更多信息...

ASP.NET水晶报表心得: 我建立好的的报表,在本机测试通过,可是一发布就出现这个提示:"您请求的报表需要更多信息...".这个问题郁闷死我了,困扰了我好一阵,说句心里话,还没有解决,在网上了也搜索了,但是没有解决我所遇到的问题,我采取了一个折中的办法去处理. 首先说一…

rsync推拉模型及结合inotify实现推模型自动同步

一、前言 无论使用什么操作系统下&#xff0c;都经常有同步文件的需求&#xff0c;不管发生在本地&#xff0c;还是发生在本地和远程主机之间。那么应该怎么做呢&#xff1f; 使用拷贝类的命令&#xff0c;本地使用cp命令&#xff0c;复制到远程主机使用scp这样的命令&#xff…

数据库设计:三范式

第一范式:确保每列的原子性. 如果每列(或者每个属性)都是不可再分的最小数据单元(也称为最小的原子单元),则满足第一范式. 例如:顾客表(姓名、编号、地址、……)其中"地址"列还可以细分为国家、省、市、区等。第二范式:在第一范式的基础上更进一层,目标是确保表…

oracle to pgsql,PostgresToOracle

PostgresToOracle官方版是一款十分专业和实用的PostgreSQL数据库迁移到Oracle工具&#xff0c;PostgresToOracle官方版功能出色&#xff0c;操作便捷&#xff0c;能够轻松快捷的帮助大家将PostgreSQL数据导入到oracle数据中&#xff0c;导入之后可以进行数据编辑&#xff0c;此…

资源下载列表

赵昱的博客&#xff1a;http://blog.zhaoyu.me/ 新托福考位助手&#xff1a;1.0.0 Beta2 | Download &#xff1a;新托福考位助手 (601) | 更新记录 Icyplayer Library C#&#xff1a;1.0.0 | Download&#xff1a;Icyplayer Library C# (522) | 更新记录 转载于:https://www…

Struts2中的OGNL详解

2019独角兽企业重金招聘Python工程师标准>>> 首先了解下OGNL的概念&#xff1a; OGNL是Object-Graph Navigation Language的缩写&#xff0c;全称为对象图导航语言&#xff0c;是一种功能强大的表达式语言&#xff0c;它通过简单一致的语法&#xff0c;可以任意存取…

oracle exacc,【学习笔记】Oracle 11GR2新特性Adaptive Cursor Sharing(ACS)

天萃荷净Oracle研究中心学习笔记&#xff1a;分享一篇关于Oracle 11.2.0.1 11Gr2数据库最新版本中最新特性Adaptive Cursor Sharing(ACS)深入研究笔记。本站文章除注明转载外&#xff0c;均为本站原创&#xff1a; 转载自love wife & love life —Roger 的Oracle技术博客本…

鼠标屏幕取词-技术

二、小故事串起来&#xff0c;就是秘密所在 别以为刚才那几个小故事都是杂乱无章地堆在一起&#xff0c;只要你把它们看明白了&#xff0c;那取词的秘密也就大白于天下了。让我们看看词霸在几个小故事中各扮演了什么角色…… 1.获得鼠标当前位置 通过HOOK机制钩住系统中的鼠标消…

C# 之 HttpResponse 类

Response 对象&#xff0c;派生自HttpResponse 类&#xff0c;该类封装来自 ASP.NET 操作的 HTTP 响应信息。存在于System.Web命名空间下。 注&#xff1a;MIME(Multipurpose Internet Mail Extensions)多用途互联网邮件扩展类型就是设定某种扩展名的文件用一种应用程序来打开的…

oracle时间类型插入,oracle 插入时间字符串 Date类型

和MysqL不同&#xff0c;MysqL 可以直接插入 时间字符串的&#xff0c;UPDATE HR_EFF_EVALUATORSET LEVEL_ 2,ROLE_NAME_ 他评,ASSESS_ROLE_ 具体人员,ASSESS_WAY_ 10,WEIGHT_ 百分制,NOTE_ 欧敏测试,PLAN_ID_ 110001231000002,STATUS_ 0,CREATE_TIME_TO_DATE(2016-12-…

esper(4-3)-Non-Overlapping Context

语法 create context context_name start start_condition end end_condition 如&#xff1a; // 9点到17点此context才可用&#xff08;以引擎的时间为准&#xff09;。如果事件进入的事件不在此范围内&#xff0c;则不受该context影响 create context NineToFive start (0,…

牢骚贴

如果你不是在科研机构工作&#xff0c;抑或你不是自己做自己的项目&#xff0c;那么或许你会有我一样的情况。 老总要的是效率、效率、效率。。。。。。还是效率。他不管你用了什么oo或者设计技巧&#xff0c;他要的是在最短的时间完成项目&#xff0c;至于这个项目的可维护性、…

11个实用的CSS学习工具

为什么80%的码农都做不了架构师&#xff1f;>>> 1. 盒子模型的幻灯片 通过3D转换效果产生的互动的幻灯片。按向左或向右箭头键切换&#xff0c;全屏观看会有更好的效果。 2. CSS Diner 通过一个简单的小游戏让你学习CSS selector&#xff0c;输入正确的selector来完…

linux什么用户什么任务,Linux 用户

查看所有用户cat /etc/passwd查看linux下用户组cat /etc/group用cat /etc/passwd |cut -f 1 -d :系统默认用户 http://zhidao.baidu.com/question/133424460Linux 用户user和用户组group管理 概念主要讲在Linux 系统中用户和用户组管理的概念,相关命令&#xff1b;对单用户多任…

使用字符缓冲流读取数据

package text;import java.io.BufferedReader;import java.io.FileReader;import java.io.IOException; public class Buff5 { public static void main(String[] args) {          BufferedReader bosnull;          try {//      …

Google 节日徽标全集 (1999-2009) (下)

这是 Google 节日徽标全集的第三部分&#xff0c;也是最后一部分&#xff0c;包含 Google 2006 至 2009 年 2 月全部节日徽标。需要指出的是&#xff0c;这些徽标均来自 Google 国际站点&#xff0c;也就是 www.google.com&#xff0c;Google 在众多本地站点上还有大量本土化的…

HBuilder:最快的Web开发IDE

HBuilder&#xff1a;最快的Web开发IDE http://www.csdn.net/article/2014-02-07/2818326-HBuilder-the-fastest-web-ide发表于2014-02-11 10:38| 26194次阅读| 来源CSDN| 59 条评论| 作者CSDN移动前端开发HBuilder数字天堂王安Web开发HTML5DCloud摘要&#xff1a;HBuilder是DC…