- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我有一个 Jenkins Job,它在由多个模块组成的 Maven 项目上运行 SonarRunner。当我配置 SonarRunner 以导入 Cobertura 覆盖率报告时,构建失败。
SonarQube Runner 2.4
Java 1.7.0_55 Oracle Corporation (64-bit)
Windows 7 6.1 amd64
INFO: Error stacktraces are turned on.
INFO: Runner configuration file: C:\Jenkins\tools\hudson.plugins.sonar.SonarRunnerInstallation\Sonar_Runner\conf\sonar-runner.properties
INFO: Project configuration file: NONE
INFO: Default locale: "en_US", source code encoding: "windows-1252" (analysis is platform dependent)
INFO: Work directory: C:\Jenkins\workspace\Sprint3\Application\.sonar
INFO: SonarQube Server 4.3
11:07:44.407 INFO - Load batch settings
11:07:44.609 INFO - User cache: C:\.sonar\cache
11:07:44.625 INFO - Install plugins
11:07:44.765 INFO - Install JDBC driver
11:07:44.781 WARN - H2 database should be used for evaluation purpose only
11:07:44.781 INFO - Create JDBC datasource for jdbc:h2:tcp://localhost/sonar
11:07:45.951 INFO - Initializing Hibernate
11:07:47.885 INFO - Load project settings
11:07:47.963 INFO - Apply project exclusions
11:07:48.229 INFO - ------------- Scan JmsUtils
11:07:48.229 INFO - Load module settings
11:07:49.508 INFO - Loading technical debt model...
11:07:49.523 INFO - Loading technical debt model done: 15 ms
11:07:49.523 INFO - Loading rules...
11:07:49.789 INFO - Loading rules done: 266 ms
11:07:49.804 INFO - Configure Maven plugins
11:07:49.976 INFO - Compare to previous analysis (2014-05-21)
11:07:50.007 INFO - Compare over 30 days (2014-04-21, analysis of 2014-05-08 15:55:35.699)
11:07:50.007 INFO - No quality gate is configured.
11:07:50.147 INFO - Base dir: C:\Jenkins\workspace\Sprint3\Application\JmsUtils
11:07:50.147 INFO - Working dir: C:\Jenkins\workspace\Sprint3\Application\.sonar\WSM_Application_JmsUtils
11:07:50.147 INFO - Source dirs: C:\Jenkins\workspace\Sprint3\Application\JmsUtils\src\main\java
11:07:50.147 INFO - Test dirs: C:\Jenkins\workspace\Sprint3\Application\JmsUtils\src\test\java
11:07:50.147 INFO - Binary dirs: C:\Jenkins\workspace\Sprint3\Application\JmsUtils\target\classes
11:07:50.147 INFO - Source encoding: windows-1252, default locale: en_US
11:07:50.147 INFO - Index files
11:07:50.350 INFO - 4 files indexed
11:07:50.428 INFO - Quality profile for java: WSM way with Findbugs - Server Code
11:07:50.444 INFO - Sensor JavaSquidSensor...
11:07:50.491 INFO - Java Main Files AST scan...
11:07:50.506 INFO - 2 source files to be analyzed
11:07:50.740 INFO - 2/2 source files analyzed
11:07:50.756 INFO - Java Main Files AST scan done: 265 ms
11:07:50.756 INFO - Java bytecode scan...
11:07:50.787 WARN - Class 'javax/jms/Session' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/Connection' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/JMSException' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/JMSException' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/JMSException' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/JMSException' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/JMSException' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/JMSException' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'org/apache/log4j/Logger' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/JMSException' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/JMSException' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/JMSException' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/JMSException' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/JMSException' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/Session' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/MessageProducer' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/JMSException' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/Message' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'org/apache/log4j/Logger' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/ConnectionFactory' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/Connection' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/Session' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/Session' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/Session' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'org/apache/log4j/Logger' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'org/apache/log4j/Logger' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/JMSException' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/JMSException' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'mil/navy/aif/domain/AuditRecord' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'mil/navy/aif/domain/AuditRecord' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'mil/navy/aif/domain/AuditRecord' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'mil/navy/aif/domain/AuditRecord' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'mil/navy/aif/domain/AuditRecord' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'mil/navy/aif/domain/AuditRecord' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/JMSException' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'org/apache/log4j/Logger' is not accessible through the ClassLoader.
11:07:50.803 WARN - Class 'org/apache/log4j/Logger' is not accessible through the ClassLoader.
11:07:50.803 INFO - Java bytecode scan done: 47 ms
11:07:50.803 INFO - Java Test Files AST scan...
11:07:50.803 INFO - 2 source files to be analyzed
11:07:50.849 INFO - Java Test Files AST scan done: 46 ms
11:07:50.849 INFO - 2/2 source files analyzed
11:07:50.849 INFO - Package design analysis...
11:07:50.865 INFO - Package design analysis done: 16 ms
11:07:50.881 INFO - Sensor JavaSquidSensor done: 437 ms
11:07:50.881 INFO - Sensor QProfileSensor...
11:07:50.881 INFO - Sensor QProfileSensor done: 0 ms
11:07:50.881 INFO - Sensor FindbugsSensor...
11:07:50.896 INFO - Execute Findbugs 2.0.3...
11:07:52.269 INFO - Findbugs output report: C:\Jenkins\workspace\Sprint3\Application\.sonar\WSM_Application_JmsUtils\findbugs-result.xml
The following classes needed for analysis were missing:
javax.jms.Session
javax.jms.Connection
org.apache.log4j.Logger
javax.jms.ConnectionFactory
javax.jms.Message
javax.jms.MessageProducer
mil.navy.aif.domain.AuditRecord
javax.jms.JMSException
javax.jms.Topic
javax.jms.Destination
11:07:54.609 INFO - Execute Findbugs 2.0.3 done: 3698 ms
11:07:54.609 INFO - Sensor FindbugsSensor done: 3728 ms
11:07:54.609 INFO - Sensor JaCoCoItSensor...
11:07:54.609 INFO - Project coverage is set to 0% as no JaCoCo execution data has been dumped: C:\Jenkins\workspace\Sprint3\Application\JmsUtils\target\jacoco-it.exec
11:07:54.672 INFO - Sensor JaCoCoItSensor done: 63 ms
11:07:54.672 INFO - Sensor JaCoCoOverallSensor...
11:07:54.672 INFO - Sensor JaCoCoOverallSensor done: 0 ms
11:07:54.672 INFO - Sensor CoberturaSensor...
11:07:54.687 INFO - parsing C:\Jenkins\workspace\Sprint3\Application\JmsUtils\target\site\cobertura\coverage.xml
11:07:54.765 INFO - Sensor CoberturaSensor done: 93 ms
11:07:54.765 INFO - Sensor CpdSensor...
11:07:54.765 INFO - SonarEngine is used for java
11:07:54.765 INFO - Cross-project analysis disabled
11:07:54.812 INFO - Sensor CpdSensor done: 47 ms
11:07:54.812 INFO - Sensor InitialOpenIssuesSensor...
11:07:54.890 INFO - Sensor InitialOpenIssuesSensor done: 78 ms
11:07:54.890 INFO - Sensor ProfileEventsSensor...
11:07:54.906 INFO - Sensor ProfileEventsSensor done: 16 ms
11:07:54.906 INFO - Sensor ProjectLinksSensor...
11:07:54.906 INFO - Sensor ProjectLinksSensor done: 0 ms
11:07:54.906 INFO - Sensor VersionEventsSensor...
11:07:54.921 INFO - Sensor VersionEventsSensor done: 15 ms
11:07:54.921 INFO - Sensor FileHashSensor...
11:07:54.921 INFO - Sensor FileHashSensor done: 0 ms
11:07:54.921 INFO - Sensor SurefireSensor...
11:07:54.921 INFO - parsing C:\Jenkins\workspace\Sprint3\Application\JmsUtils\target\surefire-reports
11:07:54.937 INFO - Sensor SurefireSensor done: 16 ms
11:07:54.937 INFO - Sensor JaCoCoSensor...
11:07:54.937 INFO - Project coverage is set to 0% as no JaCoCo execution data has been dumped: C:\Jenkins\workspace\Sprint3\Application\JmsUtils\target\jacoco.exec
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 11.513s
Final Memory: 21M/674M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
at org.sonar.runner.api.Runner.execute(Runner.java:100)
at org.sonar.runner.Main.executeTask(Main.java:70)
at org.sonar.runner.Main.execute(Main.java:59)
at org.sonar.runner.Main.main(Main.java:53)
Caused by: org.sonar.api.utils.SonarException: Can not add twice the same measure on org.sonar.api.resources.File@318c8090[key=src/main/java/mil/navy/wsm/jmsutils/Auditor.java,deprecatedKey=mil.navy.wsm.jmsutils.Auditor,path=src/main/java/mil/navy/wsm/jmsutils/Auditor.java,dir=mil/navy/wsm/jmsutils,filename=Auditor.java,language=Java]: org.sonar.api.measures.Measure@7f4c8759[id=<null>,metricKey=lines_to_cover,metric=Metric[id=38,formula=<null>,key=lines_to_cover,description=Lines to cover,type=INT,direction=1,domain=Tests,name=Lines to cover,qualitative=false,userManaged=false,enabled=true,origin=JAV,worstValue=<null>,bestValue=<null>,optimizedBestValue=false,hidden=false,deleteHistoricalData=false],value=28.0,data=<null>,description=<null>,alertStatus=<null>,alertText=<null>,tendency=<null>,date=<null>,variation1=<null>,variation2=<null>,variation3=<null>,variation4=<null>,variation5=<null>,url=<null>,characteristic=<null>,requirement=<null>,personId=<null>,persistenceMode=FULL]
at org.sonar.batch.index.Bucket.addMeasure(Bucket.java:95)
at org.sonar.batch.index.DefaultIndex.addMeasure(DefaultIndex.java:209)
at org.sonar.batch.DefaultSensorContext.saveMeasure(DefaultSensorContext.java:168)
at org.sonar.plugins.jacoco.JaCoCoSensor$UnitTestsAnalyzer.saveMeasures(JaCoCoSensor.java:86)
at org.sonar.plugins.jacoco.AbstractAnalyzer.readExecutionData(AbstractAnalyzer.java:151)
at org.sonar.plugins.jacoco.AbstractAnalyzer.analyse(AbstractAnalyzer.java:107)
at org.sonar.plugins.jacoco.JaCoCoSensor.analyse(JaCoCoSensor.java:61)
at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:79)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:70)
at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:131)
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:178)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:199)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:194)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:192)
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:187)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:56)
at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:44)
at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:82)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.bootstrap.BootstrapContainer.executeTask(BootstrapContainer.java:175)
at org.sonar.batch.bootstrap.BootstrapContainer.doAfterStart(BootstrapContainer.java:163)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:92)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:74)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
... 9 more
ERROR:
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
Build step 'Invoke Standalone Sonar Analysis' marked build as failure
Finished: FAILURE
以下是我在 Jenkins 中为 SonarRunner 分析配置的项目属性:
sonar.projectKey=WSM:Application
sonar.projectName=Application
sonar.projectVersion=1.0.2.4-SNAPSHOT
sonar.sources=src/main/java
sonar.binaries=target/classes
sonar.tests=src/test/java
sonar.junit.reportsPath=target/surefire-reports
sonar.java.coveragePlugin=cobertura
sonar.cobertura.reportPath=target/site/cobertura/coverage.xml
sonar.modules=JmsUtils,MsgGenerationUtils,WsmCopyAsNew,WsmGeomCreator,WsmGoldMsgParser,WsmJpa,WsmMsgGenerator
如果我删除 sonar.java.coveragePlugin
和 sonar.cobertura.reportPath
属性,构建会成功,但是我不会有任何覆盖率指标。
我认为问题的发生是因为 Cobertura 和 JaCoCo 试图测量相同的文件时存在冲突。您可以在堆栈跟踪中看到错误涉及 JaCoCo 传感器。我根本不想使用 JaCoCo。
Jenkins 版本:1.560
Jenkins Sonar 插件版本:2.1
Sonar 版本:4.3
Sonar Cobertura 插件版本:1.6.1
Sonar Java 插件版本:2.2
最佳答案
2.2 版的解决方法。就是要设置
sonar.jacoco.reportMissing.force.zero=False
在 sonar-project.properties 中。
关于java - org.sonar.api.utils.SonarException : Can not add twice the same measure on org. sonar.api.resources.File,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23791921/
我不知道该在标题中添加什么内容,但我有以下代码: @Controller public class WorkdayAddController { @Autowired private WorkdayR
已编辑:我需要用户按其全局进度 [order by avg(progression) DESC] 以及按进度排序的详细信息行进行排序。 示例: USER 1 campaign 1 progressio
我知道这是一个更“沉重”的问题,但我认为它也很有趣。它是 of my previous questions about compiler functions 的一部分, 但回过头来我解释得非常糟糕,许
我有一个函数(表单中的事件处理程序)结构如下: Dim errMsg as String = "" CheckIfValidUser(..., errMsg) If errMsg.Length > 0
我正在为客户正在举办的事件创建注册表。基本的用户详细信息被提交到第三方系统(即姓名、电子邮件等),但其余字段需要通过电子邮件发送给客户。 我需要这样的事情发生: 列出项目 用户填写表单 jquery
我有一个ClassLoader,它从源文件加载由JavaCompiler编译的类。但是当我更改源文件、保存它并重新编译它时,ClassLoader 仍然加载该类的第一个版本。 ClassLoad
我有一个使用 Kotlin 编写的 RecognitionListener 的项目。语音转文本功能一直很成功,从未出现任何问题。 从上周开始,它的 onResult 函数开始被调用两次。该项目没有进行
大家好(和圣诞快乐) 希望有人能回答我的问题,那将是一个美好的圣诞节 礼物。 我的 UIViewController 一个表,在表部分区域中有一个分段控件。看起来像这样 每次用户单击分段控件时,我都会
我正在制作一个程序,输入三个数字,然后计算一些不同的东西(每个东西都必须有自己的函数)。该程序首先告诉用户他们的选择并等待他们的输入。执行任何情况后,程序将再次打印菜单,除非它将使用默认情况,然后它将
我的 Android 应用程序有一个自定义接收器,如下所示: public class CustomReceiver extends BroadcastReceiver{ String URL; St
我有一系列带日期的事件,如下所示: 事件 1,2014 年 1 月 1 日 事件 2,2014 年 1 月 2 日 事件 3,2014 年 1 月 3 日 假设我想要按时间顺序排列的最近两个事件。如果
我对 jQuery“切换”方法有一个神秘的问题。我单击它一次,但它会设置两次动画。你自己去看看吧! Demo 页面源码贴在下面,(解决后链接会消失) html: About us S
我对Python完全陌生,当我遇到这个问题时,我正在尝试线程模块:-线程由于某种原因运行两次,我不知道为什么。我到处寻找,但没有找到任何答案。希望我能在这里得到一些帮助 import time fro
先决条件:无障碍对讲开启。 问题:当从软键盘向编辑文本输入字符时,字符被读出两次。(我想一次是通过键盘,一次是通过编辑文本)。 最佳答案 问题:视力正常的用户不能很好地理解/理解盲人用户需要的信息类型
我的问题是,当我再次对相同的值进行评分时,它不会响应第二次..这意味着当我第一次评分为“4”时,我不能将其评分为“4”第二次..只有当我评价其他值而不是'4'时它才会响应。 这是我尝试过的(我的代码中
我必须设计一个问卷系统。我们一直在讨论很多事情,包括如何持有答案,以及如何持有可能的答案。现在,尽管我不同意,但我还是屈服于我的同事。我只想知道您对此的看法以及原因。对我来说,两次保存相同的信息是一个
我将 Angular2 与路由一起使用,我的页面在初始加载时显示重复内容。单击任何链接(Page1 或 Page2)后,一切正常(不再有重复内容)。为什么我在初始加载时得到重复的内容以及我需要什么才能
我用KTX。。我有以下代码:。为什么它显示了两次?我该如何解决这个问题呢?。。预计“点击开始游戏”的标签只会显示一次。。我试着删除了代码。但它还是发生了。。然后,我尝试删除Add(LoadingSta
现象说明 maven的java项目,测试用例和main所在的源码文件均符合缺省写法和格式,但是在使用mvn clean sonar:sonar进行编译时提示can't be indexed twi
我使用 React 创建了一个简单的 Meteor 应用程序。它使用名为 client 的文件夹中的三个文件(没有其他文件)。在控制台中,应用程序打印出: withTracker rendering
我是一名优秀的程序员,十分优秀!