zoukankan      html  css  js  c++  java
  • 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”,根本是没有用的。原因可能是这里说的

  • 相关阅读:
    解决response在controller返回乱码的解决方式
    Injection of autowired dependencies failed;错误解决
    sql mybatis 使用concat乱码
    【算法基础】欧几里得gcd求最大公约数
    sql视图和表的区别
    在idea下创建maven
    Arrays.sort()自定义排序
    数组
    java 遍历数组
    抽象与接口
  • 原文地址:https://www.cnblogs.com/jcli/p/4536977.html
Copyright © 2011-2022 走看看