【问题标题】:Getting error "Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8" while publishing code metrics on SonarQube from VSTS Build machine从 VSTS Build 机器在 SonarQube 上发布代码指标时出现错误“Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8”
【发布时间】:2020-08-26 21:35:36
【问题描述】:

在通过构建定义从 VSTS 构建机器发布 SonarQube 上的代码指标时出现错误“Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8”。

找到下面的 sonar-project.properties 文件,

sonar.projectBaseDir=$(Build.SourcesDirectory)/app
sonar.verbose=true
sonar.analysis.mode=publish
sonar.sourceEncoding=UTF-8
sonar.sources=$(Build.SourcesDirectory)/app
sonar.language=ts
sonar.ts.tslint.projectPath=tsconfig.json
sonar.ts.tslint.path=node_modules/tslint/bin/tslint
sonar.ts.tslint.typeCheck=true
sonar.exclusions=node_modules/**
sonar.ts.coverage.lcovReportPath=$(Build.SourcesDirectory)/app/coverage/lcov.info

错误是:

不知道这里有什么问题?

【问题讨论】:

  • 如果删除 sonar-project.properties 文件中的 sonar.sourceEncoding=UTF-8 行并重新构建会怎样?
  • 是的,我已经尝试过了,但仍然显示同样的错误。
  • 如果你在代理机器上手动执行SonarScanner.MSBuild.exe end会怎么样?

标签: sonarqube azure-pipelines


【解决方案1】:

您可以取消设置 JAVA_TOOL_OPTIONS 变量,它可以工作示例:

unset JAVA_TOOL_OPTIONS && /sonar-scanner/bin/sonar-scanner XXX

【讨论】:

    【解决方案2】:

    我在 Windows 上的 Android Studio IDE 中生成 APK 时遇到了同样的问题。原来JAVA_TOOL_OPTIONS Windows 环境变量 是由 Eclipse IDE 独立设置的。我不再需要 Eclipse,所以我删除了它:

    控制面板>系统>高级系统设置>高级>环境变量>在用户和系统中删除JAVA_TOOL_OPTIONS>重启。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-07-20
      • 2018-11-27
      • 1970-01-01
      • 1970-01-01
      • 2019-10-09
      • 1970-01-01
      • 1970-01-01
      • 2014-05-25
      相关资源
      最近更新 更多