Jenkins搭建的几个坑记下
生活随笔
收集整理的這篇文章主要介紹了
Jenkins搭建的几个坑记下
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
坑一
安裝cobertura插件后,一定要在工程代碼的pom.xml文件里添加如下插件配置:
<plugin><groupId>org.codehaus.mojo</groupId><artifactId>cobertura-maven-plugin</artifactId><version>2.2</version><configuration><formats><format>xml</format></formats></configuration><executions><execution><phase>package</phase><goals><goal>cobertura</goal></goals></execution></executions></plugin>官方原文說明如下
You can either, enable "cobertura" analysis in your 'pom.xml' files or just tell Jenkins to run "cobertura" goal.
If you don't want to change your pom files, just add the goal 'cobertura:cobertura' to your Maven project in Jenkins.
這個說法以我的英文水平理解,完全是坑啊,因為我只是在Jenkins里配置了"cobertura"goal,根本沒有效啊。
坑二
在jdk7下運行的Jenkins,會報如下錯:
java.lang.VerifyError: Expecting a stackmap frame at branch target 245 Exception Details:Location:xx.xx.xx.A.class()V @220: ifleReason:Expected stackmap frame at this location.Bytecode:原因就是這個cobertura對jdk7支持不友好,解決方法還是在你的工程pom.xml文件里配置如下:
<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-surefire-plugin</artifactId><version>2.12</version><configuration><argLine>-XX:-UseSplitVerifier</argLine></configuration></plugin>網上很多說在Jenkins的配置面板里配置“Global MAVEN_OPTS”的值為“-XX:-UseSplitVerifier”,根本是沒有用的。原因可能是這里說的。
轉載于:https://www.cnblogs.com/jcli/p/4536977.html
總結
以上是生活随笔為你收集整理的Jenkins搭建的几个坑记下的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ASP.NET 配置log4net日志功
- 下一篇: 一般源码安装添加的GD库 是不支持 jp