sonar-scannerがエラーを報告しましたエラー:SonarQubeサーバー[http:// localhost:9000]に到達できず、認証されていません。 A



Sonar Scanner Reported An Error Error



1.jenkins作業ディレクトリのプロジェクトの下にsonar-project.propertiesファイルを追加します。具体的な内容は以下のとおりです。



# must be unique in a given SonarQube instance sonar.projectKey=seleniumdemo # this is the name displayed in the SonarQube UI sonar.projectName=seleniumdemo sonar.projectVersion=1.0 # Path is relative to the sonar-project.properties file. Replace '' by '/' on Windows. # Since SonarQube 4.2, this property is optional if sonar.modules is set. # If not set, SonarQube starts looking for source code from the directory containing # the sonar-project.properties file. sonar.sources=src # Encoding of the source code. Default is default system encoding #sonar.sourceEncoding=UTF-8 #path to your project build output path sonar.java.binaries=target/classes

2.プロジェクトのサブディレクトリに入り、sonar-scannerコマンドを実行して、次のエラーを報告します。

情報:ユーザーキャッシュ:/Users/yp-tc-m-2935/.sonar/cache



エラー:SonarQubeサーバー[http:// localhost:9000]に到達できません

情報:------------------------------------------------ ------------------------

情報:実行の失敗



情報:------------------------------------------------ ------------------------

情報:合計時間:2.061秒

情報:最終メモリ:4M / 61M

情報:------------------------------------------------ ------------------------

エラー:SonarQubeスキャナーの実行中にエラーが発生しました

エラー:SonarQubeを実行できません

エラー:原因:サーバーからのブートストラップインデックスの取得に失敗しました

エラー:原因:localhost / 0:0:0:0:0:0:0:1:9000への接続に失敗しました

エラー:原因:接続が拒否されました(接続が拒否されました)

エラー:

エラー:-Xスイッチを使用してSonarQubeスキャナーを再実行し、完全なデバッグログを有効にします。

解決:

Sonarqubeがオンになっておらず、sonarqubeサービスが開始されており、この問題は報告されていません。

3.エラー:

情報:SonarQubeスキャナー3.3.0.1492

情報:Java 1.8.0_121 Oracle Corporation(64ビット)

情報:Mac OS X 10.13.4 x86_64

情報:ユーザーキャッシュ:/Users/yp-tc-m-2935/.sonar/cache

情報:SonarQubeサーバー7.8.0

情報:デフォルトロケール: 'zh_CN'、ソースコードエンコーディング: 'UTF-8'

警告:SonarQubeスキャナーでは、次のバージョンからJava11以降が必要になります

情報:グローバル設定をロードします

情報:------------------------------------------------ ------------------------

情報:実行の失敗

情報:------------------------------------------------ ------------------------

情報:合計時間:4.057秒

情報:最終メモリ:4M / 61M

情報:------------------------------------------------ ------------------------

エラー:SonarQubeスキャナーの実行中にエラーが発生しました

エラー:許可されていません。このプロジェクトを分析するには、認証が必要です。プロパティsonar.loginおよびsonar.passwordの値を指定してください。

エラー:

エラー:-Xスイッチを使用してSonarQubeスキャナーを再実行し、完全なデバッグログを有効にします。

数時間の調査の後、ソナースキャナーのsonar-scanner.properties構成ファイルのクソキーが大文字で書き込まれました。 。