【问题标题】:sonar-maven-plugin fails with GC overhead limit exceededsonar-maven-plugin 失败,超过 GC 开销限制
【发布时间】:2019-01-18 00:56:22
【问题描述】:

我们使用 sonar-maven-plugin 扫描项目,并在各自的 Jenkins 阶段解决这个错误

...
14:46:19 [INFO] Sensor JaCoCoSensor
14:46:19 [WARNING] You are not using the latest JaCoCo binary format version, please consider upgrading to latest JaCoCo version.
14:46:19 [INFO] Analysing D:\jenkins\workspace\example-master-TD7G6HW7YEVZGI5SB6KAKUAC2HNRPENMLFLUMZSUIJN4VX6DGSKQ\..\target\jacoco.exec
14:47:06 Exception in thread "xxxx" java.lang.OutOfMemoryError: GC overhead limit exceeded
14:47:06    at java.util.ArrayList.iterator(ArrayList.java:840)
14:47:06    at com.persistit.TimelyResource.prune(TimelyResource.java:303)
14:47:06    at com.persistit.Persistit.pruneTimelyResources(Persistit.java:2499)
14:47:06    at com.persistit.Persistit.cleanup(Persistit.java:1531)
14:47:06    at com.persistit.CleanupManager.poll(CleanupManager.java:157)
14:47:06    at com.persistit.CleanupManager.runTask(CleanupManager.java:88)
14:47:06    at com.persistit.IOTaskRunnable.run(IOTaskRunnable.java:144)
14:47:06    at java.lang.Thread.run(Thread.java:748)
...

【问题讨论】:

    标签: java sonarqube jacoco jacoco-maven-plugin sonar-maven-plugin


    【解决方案1】:

    将 sonar.jacoco.reportPath 属性添加到 pom.xml(第 6 行)后问题得到解决:

    <properties>
       <java.version>1.8</java.version>
       <maven.compiler.source>1.8</maven.compiler.source>
       <maven.compiler.target>1.8</maven.compiler.target>
       <!-- this is defined in spring-core-env and fits for multi module project. Scanner fails for single module projects! -->
       <sonar.jacoco.reportPath>${project.basedir}/target/jacoco.exec</sonar.jacoco.reportPath>
    </properties>
    

    这可以通过https://wiki.jenkins.io/display/JENKINS/JaCoCo+Plugin 的cmets 找到

    【讨论】:

      猜你喜欢
      • 2018-08-18
      • 2015-10-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-12
      • 1970-01-01
      相关资源
      最近更新 更多