更新到 sonarqube 5.0 后,我们无法再在 Windows 上分析我们的多模块项目。
问题似乎是 PhasesSumUpTimeProfiler 类(org.sonar.batch.profiling)使用 moduleKey 作为文件名的一部分来存储转储文件,这可能有特殊字符。
String fileName = module.getKey() + "-profiler.properties";
现在的问题是模块键包含冒号 (:) 字符。有没有变通办法。我们如何将模块键更改为不与冒号字符连接。
Caused by: java.lang.IllegalStateException: Unable to store profiler output: D:\jenkins_slave\workspace\ci-build-win-fast-sonar-ssd-64\build\.sonar\profiling\ch.imagic:ims:acquisition-profiler.properties
at org.sonar.batch.profiling.PhasesSumUpTimeProfiler.dumpToFile(PhasesSumUpTimeProfiler.java:160)
at org.sonar.batch.profiling.PhasesSumUpTimeProfiler.onProjectAnalysis(PhasesSumUpTimeProfiler.java:123)
at org.sonar.batch.phases.ProjectAnalysisEvent.dispatch(ProjectAnalysisEvent.java:42)
at org.sonar.batch.phases.ProjectAnalysisEvent.dispatch(ProjectAnalysisEvent.java:25)
at org.sonar.batch.events.EventBus.doFireEvent(EventBus.java:49)
at org.sonar.batch.events.EventBus.fireEvent(EventBus.java:43)
at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:139)
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:222)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:235)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:230)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:228)
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:223)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:65)
at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:52)
at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:128)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:93)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:78)
at org.sonar.batch.bootstrap.BootstrapContainer.executeTask(BootstrapContainer.java:171)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:95)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
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)
... 63 more
Caused by: java.io.FileNotFoundException: D:\jenkins_slave\workspace\ci-build-win-fast-sonar-ssd-64\build\.sonar\profiling\ch.imagic:ims:acquisition-profiler.properties (Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
at org.sonar.batch.profiling.PhasesSumUpTimeProfiler.dumpToFile(PhasesSumUpTimeProfiler.java:156)
... 92 more