파일 인코딩에 실패합니다. 파일은 원래 UTF8로 저장되었습니다. UTF-8-BOM, UTF-8 및 ANSI를 사용하여 메모장 + +를 사용하여 파일을 변환했습니다. 모두 똑같은 문제를 던집니다.SonarTS 인해 모두 다음과 같은 오류와 함께 실패으로 VisualStudio 2015 년까지 저장 타이프 라이터 파일에 SonarTS을 실행하는 경우
이 문제가 발생한 사람이 있습니까?
전체 예외 :
ERROR: Error during SonarQube Scanner execution
java.lang.IllegalArgumentException: Unable to register token in file [moduleKey=..., relative=src/app.module.ts, basedir=C:\...]
at org.sonar.api.batch.sensor.cpd.internal.DefaultCpdTokens.addToken(DefaultCpdTokens.java:90)
at org.sonar.plugin.typescript.ExternalTypescriptSensor.saveCpd(ExternalTypescriptSensor.java:204)
at org.sonar.plugin.typescript.ExternalTypescriptSensor.analyze(ExternalTypescriptSensor.java:125)
at org.sonar.plugin.typescript.ExternalTypescriptSensor.execute(ExternalTypescriptSensor.java:103)
at org.sonar.batch.sensor.SensorWrapper.analyse(SensorWrapper.java:57)
at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:58)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:50)
at org.sonar.batch.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:83)
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:192)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:241)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:236)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:234)
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:226)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
at org.sonar.batch.task.ScanTask.execute(ScanTask.java:47)
at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:106)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)
at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:123)
at org.sonarsource.scanner.cli.Main.execute(Main.java:77)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.IllegalArgumentException: 42 is not a valid line offset for pointer. File [moduleKey=..., relative=src/app.module.ts, basedir=C:\...] has 41 character(s) at line 1
at org.sonar.api.internal.google.common.base.Preconditions.checkArgument(Preconditions.java:148)
at org.sonar.api.batch.fs.internal.DefaultInputFile.checkValid(DefaultInputFile.java:218)
at org.sonar.api.batch.fs.internal.DefaultInputFile.newPointer(DefaultInputFile.java:209)
at org.sonar.api.batch.fs.internal.DefaultInputFile.newRange(DefaultInputFile.java:240)
at org.sonar.api.batch.sensor.cpd.internal.DefaultCpdTokens.addToken(DefaultCpdTokens.java:88)
... 34 more
파일을 UTF-8로 저장할 때 (BOM없이) 동일한 방법으로 오류가 발생합니다. 당신과 비슷한 https://github.com/SonarSource/SonarTS/issues/266이 있습니다. Btw 더 많은 로그가 도움이 될 것입니다 –
네 그 같은 오류 메시지가 있습니다. 우리가 얻는 오류 메시지를 편집했습니다. 나는 UTF-8 형식을 사용해야한다고 가정하고있다. (BOM없이)? –
문제를 재현하는 TS 파일을 첨부 할 수 있습니까? –