Sonar升級至5.3或更高版本後,CI平臺中的登錄權限也發生了變更,並且sonar.login和sonar.password的API即將棄用,取而代之的是Server authentication token,以下是獲取authentication token的過程和CI上的配置
- 獲取Sonar平臺中的authentication token
1、使用Admin賬號登錄Sonar
Force user authentication這個選項選擇“是”
2、使用通用賬號登錄Sonar
登錄後右上角點擊用戶名稱,選擇我的賬號,進入個人賬號設置
選擇安全頁,在Generate Tokens中輸入一個名稱,如:test,然後點擊Generate,生成一個token
圖中標註的一段字符串即authentication token,複製
3、登錄Jenkins,進入全局配置頁
將authentication token複製到這裏