博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
linux环境中设置jacoco覆盖率
阅读量:7083 次
发布时间:2019-06-28

本文共 4678 字,大约阅读时间需要 15 分钟。

cd /alidata1/admin/za-themispkill -9 -f za-themis#CATALINA_HOME=/root/za-tomcat#CATALINA_BASE=/root/za-tomcatexport JAVA_OPTS="-server -Xms2g -Xmx2g -XX:NewSize=1g -XX:MaxNewSize=1g -XX:PermSize=512m -XX:MaxPermSize=512m -XX:+UseConcMarkSweepGC -XX:CMSFullGCsBeforeCompaction=5 -XX:+UseCMSCompactAtFullCollection -XX:+CMSParallelRemarkEnabled -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -XX:+DisableExplicitGC-XX:+UseCompressedOops -XX:+DoEscapeAnalysis -XX:MaxTenuringThreshold=10-Dhsf.http.enable=true -Dhsf.server.ip=10.253.104.74-Dpandora.qos.port=8081-Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=7092-Djava.rmi.server.hostname=10.253.104.74-javaagent:./jacoco-0.8.0/lib/jacocoagent.jar=includes=*,output=tcpserver,port=17297,address=10.253.104.74-Dhsf.server.port=8082 -Dhsf.http.port=8083 -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8184 -Dproject.name=za-themis"./bin/startup.shtail ./logs/catalina.out

 

ant build.xml文件:

<?xml version="1.0"?>

-<project default="jacoco" xmlns:jacoco="antlib:org.jacoco.ant" name="PPAUTO">

<!--Jacoco的安装路径-->

<property name="jacocoantPath" value="./jacoco-0.8.0/lib/jacocoant.jar"/>

<!--最终生成.exec文件的路径,Jacoco就是根据这个文件生成最终的报告的-->

<property name="jacocoexecPath" value="./jacoco.exec"/>

<!--生成覆盖率报告的路径-->

<property name="reportfolderPath" value="./report/"/>

<!--远程tomcat服务的ip地址-->

<property name="server_ip" value="10.253.104.74"/>

<!--前面配置的远程tomcat服务打开的端口,要跟上面配置的一样-->

<property name="server_port" value="17297"/>

<!--za-themis.源代码路径-->

<property name="za-themispath" value="/root/.jenkins/workspace/za-qa-jacocoThemis/za-themis/"/>

<property name="za-themisbizpath" value="/root/.jenkins/workspace/za-qa-jacocoThemis/za-themis-biz/"/>

<property name="za-themiscommonpath" value="/root/.jenkins/workspace/za-qa-jacocoThemis/za-themis-common/"/>

<property name="za-themisenginepath" value="/root/.jenkins/workspace/za-qa-jacocoThemis/za-themis-engine/"/>

<property name="za-themisdaopath" value="/root/.jenkins/workspace/za-qa-jacocoThemis/za-themis-dao/"/>

<!--za-themis.class文件路径-->

<property name="za-themisClasspath" value="/root/.jenkins/workspace/za-qa-jacocoThemis/za-themis/target/classes/com/zhongan/themis"/>

<property name="za-themisbizClasspath" value="/root/.jenkins/workspace/za-qa-jacocoThemis/za-themis-biz/target/classes/com/zhongan/themis"/>

<property name="za-themiscommonClasspath" value="/root/.jenkins/workspace/za-qa-jacocoThemis/za-themis-common/target/classes/com/zhongan/themis"/>

<property name="za-themisdaoClasspath" value="/root/.jenkins/workspace/za-qa-jacocoThemis/za-themis-dao/target/classes/com/zhongan/themis"/>

<property name="za-themisengineClasspath" value="/root/.jenkins/workspace/za-qa-jacocoThemis/za-themis-engine/target/classes/com/zhongan/themis"/>

<!--让ant知道去哪儿找Jacoco-->

 

-<taskdef resource="org/jacoco/ant/antlib.xml" uri="antlib:org.jacoco.ant">

<classpath path="${jacocoantPath}"/>

</taskdef>

<!--dump任务: 根据前面配置的ip地址,和端口号, 访问目标tomcat服务,并生成.exec文件。-->

 

-<target name="dump">

<jacoco:dump append="true" port="${server_port}" destfile="${jacocoexecPath}" reset="false" address="${server_ip}"/>

</target>

<!--jacoco任务: 根据前面配置的源代码路径和.class文件路径, 根据dump后,生成的.exec文件,生成最终的html覆盖率报告。-->

 

-<target name="report">

<delete dir="${reportfolderPath}"/>

<mkdir dir="${reportfolderPath}"/>

-<jacoco:report>

-<executiondata>

<file file="${jacocoexecPath}"/>

</executiondata>

-<structure name="JaCoCo Report">

-<group name="za-themis">

-<classfiles>

<fileset dir="${za-themisClasspath}"/>

</classfiles>

-<sourcefiles encoding="utf-8">

<fileset dir="${za-themispath}"/>

</sourcefiles>

</group>

-<group name="za-themis-biz">

-<classfiles>

<fileset dir="${za-themisbizClasspath}"/>

</classfiles>

-<sourcefiles encoding="utf-8">

<fileset dir="${za-themisbizpath}"/>

</sourcefiles>

</group>

-<group name="za-themis-common">

-<classfiles>

<fileset dir="${za-themiscommonClasspath}"/>

</classfiles>

-<sourcefiles encoding="utf-8">

<fileset dir="${za-themiscommonpath}"/>

</sourcefiles>

</group>

-<group name="za-themis-engine">

-<classfiles>

<fileset dir="${za-themisengineClasspath}"/>

</classfiles>

-<sourcefiles encoding="utf-8">

<fileset dir="${za-themisenginepath}"/>

</sourcefiles>

</group>

-<group name="za-themis-dao">

-<classfiles>

<fileset dir="${za-themisdaoClasspath}"/>

</classfiles>

-<sourcefiles encoding="utf-8">

<fileset dir="${za-themisdaopath}"/>

</sourcefiles>

</group>

</structure>

<html encoding="utf-8" destdir="${reportfolderPath}"/>

</jacoco:report>

</target>

</project>

转载地址:http://awmml.baihongyu.com/

你可能感兴趣的文章
Spring配置文件总结
查看>>
CodeForces 388A Fox and Box Accumulation (模拟)
查看>>
bzoj 4830: [Hnoi2017]抛硬币 [范德蒙德卷积 扩展lucas]
查看>>
MySQL具体解释(21)------------缓存參数优化
查看>>
8款基于Jquery的WEB前端动画特效
查看>>
客户端接收发邮件时,出现“无法连接到服务器
查看>>
关于Unity中UI中的Mask组件、Text组件和布局
查看>>
nodemon是个好东西
查看>>
C/C++拾遗(一):关于数组的指针和数组元素首地址的一道经典题
查看>>
《AndroidStudio每日一贴》5. 怎样高速查看某个方法/注解的定义?
查看>>
Gradle入门学习---认识buildeTypes和dependencies
查看>>
iOS开发 - 二维码的生成与读取
查看>>
.Net中的缓存依赖配置
查看>>
让你提前认识软件开发(14):程序中的算法
查看>>
Objective-C - 改变NSMutableArray的特定元素
查看>>
截止2016年5月之前双色球数据统计
查看>>
jQuery插件AjaxFileUpload实现ajax文件上传时老是运行error方法 问题原因
查看>>
STM32 ADC 采样 频率的确定
查看>>
使用Selenium来抓取动态加载的页面
查看>>
设计模式实战应用之五:工厂方法模式
查看>>