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”,根本是没有用的。原因可能是这里说的

  • 相关阅读:
    P2730 魔板 Magic Squares
    P2124 奶牛美容
    4. Median of Two Sorted Arrays(Array; Divide-and-Conquer)
    3.Longest Substring Without Repeating Characters(string; HashTable)
    2.Add Two Numbers (List)
    1.Two Sum (Array; HashTable)
    C++中的浅拷贝、深拷贝、智能指针
    C++ 静态数据成员和静态成员函数
    C & C++ 宏与const
    C++指针与引用
  • 原文地址:https://www.cnblogs.com/jcli/p/4536977.html
Copyright © 2011-2022 走看看