idea+springboot+maven+testng+jen
废话不多说,直接上例子
1、首先是在idea上创建springboot的maven工程,完整的pom.xm如下






2、testng测试套件xml需要添加对reportng的监听

3、idea需要修改Edit Configurations的listeners的配置

4、以上修改完成之后,运行testng的测试套件,就会在下面的目录生成reportng的测试报告

5、下面来说一下jenkins的配置,以本地代码为例,git上的代码可使用源码管理进行配置
(1)需要使用到的插件


(2)jenkins系统管理中的配置




(3)job的配置




(4)jenkins2.2之后的版本打开reportng的html测试报告内容为空的解决办法
方法一:用java启动jenkins.war的可以在启动命令中加参数 -Dhudson.model.DirectoryBrowserSupport.CSP=
如: java -Dhudson.model.DirectoryBrowserSupport.CSP="sandbox; default-src 'unsafe-inline';" -jar jenkins.war
方法二:可以在jenkins的Jenkins Script Console(脚本命令行)里设置方法如下,jenkins重启后需要再次执行以下步骤:
在系统管理->脚本命令行,在里面输入System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "script-src 'unsafe-inline'"), 点击运行


附上邮件内容的文本,大家可以根据jenkins内置变量去做调整:
内置变量可参考:https://www.cnblogs.com/puresoul/p/4828913.html
Default Subject:构建通知:BUILD_NUMBER - $BUILD_STATUS!
Default Content:
(本邮件是程序自动下发的,请勿回复!)
项目名称:$PROJECT_NAME
构建编号:$BUILD_NUMBER
svn版本号:${SVN_REVISION}
构建状态:$BUILD_STATUS
触发原因:${CAUSE}
构建日志地址:<a href="{BUILD_URL}console</a>
构建地址:<a href="BUILD_URL</a>
变更集:${JELLY_SCRIPT,template="html"}
测试报告:<a href="{JOB_URL}HTML_20Report</a>