配合文章学习:

用Spring MVC3 + Ant + Jenkins + SVN + Tomcat 做一个简单的持续集成例子:http://www.cnblogs.com/CloudTeng/archive/2012/02/25/2348055.html

注意文章中有点问题,我在回复中提到

我按照楼主的建立
ant build, ant tests, ant deploy 也构建失败
而 target 填写: build, tests, deploy 就构建成功了
是不是因为新版本的问题??我用的ant-1.9.2版 jenkins是1.523

注意的是:配置 参数 就是因为这个搞了一下午。
构建
Invoke Ant
     
  Targets
   
     
     
  Build File
   
     
  Properties
   
     
  Java Options
   
     

参考文章:用Spring MVC3 + Ant + Jenkins + SVN + Tomcat 做一个简单的持续集成例子:http://www.cnblogs.com/CloudTeng/archive/2012/02/25/2348055.html

到了第二天,

学习 JUnit 加入集成测试,要点步骤如下:

重点是注意 target是执行的步骤,也就是上面配置Invoke Ant填得名称;

其次是注意deploy的部分,因为我的项目结构比较特殊,

1.在src/config有配置文件,所以需要copy

2.在项目中使用了Myeclipse插件,提供了JUnit提供的jar和J2ee提供的jar,这就需要自动部署的时候,手动copy

3.在考虑是直接部署还是打成war包部署,最终还是决定打成war包吧 这样移植的时候就不需要打包的步骤了,也会减少出错的可能

注:打包之后copy ,tomcat会自动检测war被更新因而会重新解压,发布应用。这样就会使得,项目中要是出现上传的图片或者添加的文件数据,就会被直接干掉。这点感觉很不好,所以解决方法有可以选择不打war包,或者把上传的文件夹和项目脱离放置。

build.xml文件

<?xml version="1.0" encoding="UTF-8"?>
<!-- ============================================= Auto unittest task and deploy applicationAuthor: WinnidSince: 20130723                                         ============================================= -->
<project name="Meaningful-Framework" basedir="." default="profect"><description> - Meaningful Framework 2.0 - </description><property file="build.properties"/><property name="appserver.deploy.name" value="mf2"/><property name="project.src" value="src"/><property name="project.test" value="test"/><property name="project.web" value="WebRoot"/><property name="project.lib" value="${project.web}/WEB-INF/lib"/><property name="project.lib.ant" value="${project.web}/WEB-INF/lib-ant"/><property name="project.build" value="${project.web}/WEB-INF"/><property name="build.src" value="${project.build}/classes" /><property name="build.testcase" value="${project.build}/testcases" /><property name="ant.report" value="${project.build}/report" /><!-- - - - - - - - - - - - - - - - - - set the depends jar files                      - - - - - - - - - - - - - - - - - --><path id="master-classpath"><fileset dir="${project.lib}" includes="**/*.jar"/><fileset dir="${project.lib.ant}" includes="**/*.jar"/><fileset dir="${appserver.lib}"><include name="servlet*.jar"/></fileset></path><!-- - - - - - - - - - - - - - - - - - target(1): folder init                      - - - - - - - - - - - - - - - - - --><target name="init"><mkdir dir="${ant.report}"/><mkdir dir="${build.src}"/><mkdir dir="${build.testcase}"/></target><!-- - - - - - - - - - - - - - - - - - target(2.1): build src                      - - - - - - - - - - - - - - - - - --><target name="build src" depends="init" description="Compile main source tree java files"><javac srcdir="${project.src}" destdir="${build.src}"encoding="utf-8" debug="on" deprecation="on" optimize="on" failοnerrοr="true" includeantruntime="on"><classpath refid="master-classpath"/></javac><echo>build src complete!</echo></target><!-- - - - - - - - - - - - - - - - - - target(2.2): build test                      - - - - - - - - - - - - - - - - - --><target name="build test" depends="build src" description="Compile testcase source tree java files"><javac srcdir="${project.src}" destdir="${build.src}"encoding="utf-8" debug="on" deprecation="on" optimize="on" failοnerrοr="true" includeantruntime="on"><classpath refid="master-classpath"/></javac><echo>build test complete!</echo></target><!-- - - - - - - - - - - - - - - - - - target(2): build                   - - - - - - - - - - - - - - - - - --><target name="build" depends="build src, build test" /><!-- ======================================== target(3): auto test all test case and output report file                      ===================================== --><target name="junit and report" depends="build"><junit printsummary="on" fork="true" showoutput="true"><classpath><path refid="master-classpath"/><pathelement path="${build.src}"/><pathelement path="${build.testcase}"/></classpath><formatter type="xml" /><batchtest todir="${ant.report}"><fileset dir="${build.testcase}"><include name="**/*Test*.*" /></fileset></batchtest></junit><junitreport todir="${ant.report}"><fileset dir="${ant.report}"><include name="TEST-*.xml" /></fileset><report format="frames" todir="${ant.report}" /></junitreport></target><!-- ======================================== target(4.1): deploy                  ===================================== --><target name="deploy" depends="junit and report" description="Deploy application"><!-- copy 项目文件  --><copy todir="${appserver.deploy.path}/${appserver.deploy.name}" preservelastmodified="true"><fileset dir="${project.web}"><include name="**/*.*"/><exclude name="**/lib-ant/*.*" /></fileset></copy><!-- copy 项目ant中的jar  --><copy todir="${project.web}/WEB-INF/lib" includeemptydirs="false"><fileset dir="${project.lib.ant}"><include name="**/*.jar"/></fileset></copy><!-- copy 项目src中的config  --><copy todir="${appserver.deploy.path}/${appserver.deploy.name}/WEB-INF/classes" includeemptydirs="false"><fileset dir="${project.src}"><exclude name="**/*.java" /></fileset></copy></target><!-- ======================================== target(4.2): deploy war                 ===================================== --><target name="deploywar" depends="junit and report" description="Deploy application as a WAR file"><!-- copy 项目src中的config  --><copy todir="${project.web}/WEB-INF/classes" includeemptydirs="false"><fileset dir="${project.src}"><exclude name="**/*.java" /></fileset></copy><!-- copy 项目ant中的jar  --><copy todir="${project.web}/WEB-INF/lib" includeemptydirs="false"><fileset dir="${project.lib.ant}"><include name="**/*.jar"/></fileset></copy><!-- 项目文件打war包  --><war destfile="${appserver.deploy.name}.war"webxml="${project.web}/WEB-INF/web.xml"><fileset dir="${project.web}"><include name="**/*.*"/><exclude name="**/lib-ant/*.*" /></fileset></war><!-- copy war包 到Tomcat  --><copy todir="${appserver.deploy.path}" preservelastmodified="true"><fileset dir="."><include name="*.war"/></fileset></copy></target><target name="clean" description="Deletes compiled and generated code"><!-- <delete dir="${project.build}"/><delete dir="${ant.report}"/> --></target><target name="profect" depends="init, build, junit and report, deploywar, clean"/>
</project>

参考文件  一个完整的JENKINS下的ANT BUILD.XML文件   http://www.blogjava.net/paulwong/archive/2012/02/08/369617.html

中间出现了很多错误,内存也有溢出的时候,因为我用的是奔4的机子内存1.5。。。。

EasyAnt 看不懂的新插件,貌似不能集成到现在用的项目中,而且更新时间是2010年,哎。。。

下面 还要继续学习的是 build.xml更加自动化。主要是findbug!!!

另外Jenkins有强大的插件集成,目前还在学习中。

但是由于下一个项目,是要用Android框架,所以开始探索

Jenkins学习笔记(十一)如何构建和测试Android app

下面 还要继续学习的是 build.xml更加自动化。

Jenkins,Ant 配置学习笔记相关推荐

  1. Jenkins持续集成学习笔记(2020.11.22)

    Jenkins持续集成学习笔记(2020.11.22) 前言: (官网) 以前很久学习过Jenkins持续集成进行快速部署项目进行测试, 最近换工作了, 发现新公司有用到, 现在来复习一下 官网介绍: ...

  2. webpack:js、css、es6装载与压缩配置-学习笔记

    文章目录 webpack:js.css.es6装载与压缩配置-学习笔记 css文件打包 loader执行顺序 loader与plugin区别 less css抽取 js,css压缩处理 依赖包降级处理 ...

  3. vue项目打包与配置-学习笔记

    文章目录 vue项目打包与配置-学习笔记 前端打包 打包的代码如何运行 打包指定不同的环境变量(开发,测试) 打包手动配置文件 打包压缩,大文件处理 gzip进一步压缩 打包app 打包部署模式 vu ...

  4. linux 安装jeakens_Chapter 2. OpenSSL的安装和配置学习笔记

    Chapter 2. OpenSSL的安装和配置学习笔记 2.1 在linux上面安装OpenSSL 我还是做点No paper事情比较在行,正好和老师的课程接轨一下. 以前尝试过在Windows上面 ...

  5. 华为登录认证配置学习笔记

    以华为S5700-28C-HI交换机为例,配置登录认证学习笔记一: (一).无需任何密码通过控制端口登录 [switchA]user-interface con 0 [switchA-ui-conso ...

  6. Git命令配置学习笔记

    Git 笔记 Git是分布式版本控制系统 集中式VS分布式: 集中式版本控制系统,版本库集中存放在中央服务器,必须要联网才能工作,没有历史版本库. 分布式版本控制系统,版本控制系统没有"中央 ...

  7. SQL Server CE服务器端和客户端安装配置学习笔记

    SQL Server 2005 CE开发环境介绍: 最近学习使用SQL Server 2005 Compact Edition进行数据存储,在学习的过程中发现,使用SQL Server2005 man ...

  8. MySQL概述 -- 安装配置 -- 学习笔记

    前言 在我们讲解SpringBootWeb基础知识(请求响应案例)的时候,我们讲到在web开发中,为了应用程序职责单一,方便维护,我们一般将web应用程序分为三层,即:Controller.Servi ...

  9. mysql主从配置笔记_MySQL主从配置学习笔记

    ● 本打算买个云数据,为我的新项目做点安全保障.阿里云,腾讯云转了一圈,两个字太贵.不就数据有备份吗,既然这样那我不如自己来做备份. ● 家里有2个树莓派直接把mysql备份到他们上就好了,网上有教程 ...

最新文章

  1. 移动游戏市场爆发背后的游戏引擎战局
  2. java中function实现_Java中的functor实现
  3. java rmi 使用管道_使用Java RMI时要记住的两件事
  4. keil5按F12调不出头文件中函数
  5. 一览众山小的上一句是什么,怎么理解一览众山小的意思?
  6. JavaScript高级程序设计 DOM事件处理 读书笔记
  7. EF 4.1 一些操作
  8. P1048 采药 洛谷Oj
  9. Android 手机抓包工具 Packet Capture
  10. 蓝桥杯2019c语言b组试题,2020年7月B组C++蓝桥杯真题试水
  11. 【学习笔记】python实现excel数据处理
  12. 如何使用SiteSucker下载HTML源文件?下载html源文件的两种方法
  13. 屠龙之技 作者:长铗
  14. spboot开发的jar包开机自启
  15. ABAP LVC DEMO程序
  16. docker 测试mysql_Mac上使用Docker快速启动MySQL测试
  17. 有些jpg图在IE浏览器中打不开
  18. MacBookPro你真的会使用吗?
  19. cmath中常用的函数
  20. 电流传感器测试系统1000A/us级上升沿

热门文章

  1. SSN 社会安全号码
  2. SPARK+LIVY
  3. input标签拾遗--引申TIY实例(下)
  4. oracle怎么替换,Oracle 11g RAC 如何添加,替换,移除,迁移 OCR
  5. 多大的数据量称得上大数据
  6. 微信读书APP协议阅读 2021-2-26
  7. 手机应用开发者需注意的20个事项
  8. Tolua#添加云风的PBC插件
  9. 武汉学院计算机分数线,2021年武汉学院投档线及各省最低录取分数线统计表
  10. C语言查课系统的报告,河南工业大学C语言库管理系统课程报告