我在运行Sonarqube Intellij分析插件时会出现以下错误
14:40:35.544 INFO - Apply project exclusions
Exception in thread "main" 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.impl.BatchLauncherMain.execute(BatchLauncherMain.java:41)
at org.sonar.runner.impl.BatchLauncherMain.main(BatchLauncherMain.java:59)
Caused by: java.lang.IllegalArgumentException: 'sonar.projectDate' property cannot be older than the date of the last known quality snapshot on this project. Value: '2014-01-23T14:40:35-0700'. Latest quality snapshot: '2014-01-23'. This property may only be used to rebuild the past in a chronological order.
at
org.sonar.batch.ProjectConfigurator.checkCurrentAnalysisIsTheLatestOne(ProjectConfigurator.java:87)
at org.sonar.batch.ProjectConfigurator.configure(ProjectConfigurator.java:71)
at org.sonar.batch.DefaultProjectTree.doStart(DefaultProjectTree.java:72)
at org.sonar.batch.DefaultProjectTree.start(DefaultProjectTree.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
此线程讨论了Eclipse和Sonarqube -http://comments.gmane.org/gmane.comp.java.sonar.gener.general/31498。但是线程没有帮助。
我正在运行Intellij 13和Intellij v 1.0的Sonarqube插件。
我尝试卸载并重新安装插件。我尝试清除"用户缓存"。我不确定接下来要做什么。
声纳项目是CI链的一部分 - 因此该项目每天可能有多个构建。
谢谢
如果您正在运行本地和从CI服务器上构建,请检查计算机之间的时钟相对相对相同。如果您的CI服务器领先于本地计算机,并发布到Sonar(例如在办理登机手续),但是您也在本地运行的时间(过去是过去)并尝试发布到Sonar,那么可能是冲突的可能来源。
似乎这是4.1版本的Sonar
中的错误https://jira.codehaus.org/browse/sonar-5049。
有2个可能的解决方法:
- 将您的机器设置为与Sonar Server相同的时区
或
- 转到Eclipse首选项,Sonarqube,预览分析属性,添加一个名为
sonar.projectDate
的属性,将来像2024-01-01
这样的日期。(摘自https://jira.codehaus.org/browse/sonar-5049)。就本地分析引擎而言,您的本地日期将始终超过服务器的日期。