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: ifle
  Reason:
    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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值