问题
Does anyone know what's going on here?
Using Sonarqube v5.6 on a windows server, c# scanner v5.5.0.479
Seems to pick this up in multiple files, and not always the same files, which is the most concerning.
Anyone have any ideas?
16:46:03 INFO: Importing analysis results from E:\Jenkins\workspace\Job Build-UnitTest (PullRequests)\.sonar\output-cs
16:46:05 INFO: ------------------------------------------------------------------------
16:46:05 INFO: EXECUTION FAILURE
16:46:05 INFO: ------------------------------------------------------------------------
16:46:05 INFO: Total time: 3:36.304s
16:46:05 INFO: Final Memory: 53M/700M
16:46:05 INFO: ------------------------------------------------------------------------
16:46:05 ERROR: Error during SonarQube Scanner execution
16:46:05 java.lang.IllegalArgumentException: 30 is not a valid line offset for pointer. File [moduleKey=JOB:develop, relative=DataStructures/Interval.cs, basedir=E:\Jenkins\workspace\Job Build-UnitTest (PullRequests)] has 1 character(s) at line 132
16:46:05 at org.sonar.api.internal.google.common.base.Preconditions.checkArgument(Preconditions.java:148)
16:46:05 at org.sonar.api.batch.fs.internal.DefaultInputFile.checkValid(DefaultInputFile.java:218)
16:46:05 at org.sonar.api.batch.fs.internal.DefaultInputFile.newPointer(DefaultInputFile.java:209)
16:46:05 at org.sonar.api.batch.fs.internal.DefaultInputFile.newRange(DefaultInputFile.java:239)
16:46:05 at org.sonarsource.dotnet.shared.plugins.SensorContextUtils.toTextRange(SensorContextUtils.java:41)
16:46:05 at org.sonarsource.dotnet.shared.plugins.protobuf.IssuesImporter.importMessage(IssuesImporter.java:54)
16:46:05 at org.sonarsource.dotnet.shared.plugins.protobuf.IssuesImporter.importMessage(IssuesImporter.java:31)
16:46:05 at org.sonarsource.dotnet.shared.plugins.protobuf.AbstractProtobufImporter.accept(AbstractProtobufImporter.java:49)
16:46:05 at org.sonarsource.dotnet.shared.plugins.AbstractSensor.parseProtobuf(AbstractSensor.java:80)
16:46:05 at org.sonarsource.dotnet.shared.plugins.AbstractSensor.importResults(AbstractSensor.java:70)
16:46:05 at org.sonar.plugins.csharp.CSharpSensor.executeInternal(CSharpSensor.java:114)
16:46:05 at org.sonar.plugins.csharp.CSharpSensor.execute(CSharpSensor.java:85)
16:46:05 at org.sonar.batch.sensor.SensorWrapper.analyse(SensorWrapper.java:57)
16:46:05 at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:58)
16:46:05 at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:50)
16:46:05 at org.sonar.batch.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:83)
16:46:05 at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:192)
16:46:05 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
16:46:05 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
16:46:05 at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:241)
16:46:05 at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:236)
16:46:05 at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:226)
16:46:05 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
16:46:05 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
16:46:05 at org.sonar.batch.task.ScanTask.execute(ScanTask.java:47)
16:46:05 at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
16:46:05 at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
16:46:05 at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
16:46:05 at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:106)
16:46:05 at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
16:46:05 at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:62)
16:46:05 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
16:46:05 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
16:46:05 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
16:46:05 at java.lang.reflect.Method.invoke(Method.java:498)
16:46:05 at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
16:46:05 at com.sun.proxy.$Proxy0.execute(Unknown Source)
16:46:05 at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:240)
16:46:05 at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
16:46:05 at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:110)
16:46:05 at org.sonarsource.scanner.cli.Main.execute(Main.java:72)
16:46:05 at org.sonarsource.scanner.cli.Main.main(Main.java:60)
16:46:05 ERROR:
16:46:05 ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
16:46:05 ERROR: SonarQube scanner exited with non-zero code: 1
回答1:
This is a bug in the C# plugin. The fix is coming. Until then you can change the encoding of your files to UTF-8.
来源:https://stackoverflow.com/questions/41042943/sonarqube-c-sharp-scanner-exception-java-lang-illegalargumentexception-is-not