# SonarQube Community Edition 使用 SonarQube CNES Report Plugin 匯出 PDF 報告 ###### tags: `SonarQube` > [name=Daniel Huang][time=Fri, Dec 1, 2023 3:04 PM][color=#7af43d] [TOC] ## 前言 目前使用的 SonarQube 是 **Community Edition 9.9 LTS**,預設並不支援 PDF 報告的產製。 如果要有紙本報告只能透過 Plugin (外掛/擴充功能) 來幫忙。 最一開始找到的是 [Ivan Chang 在 iThome 上所分享的 SonarQube 如何產生 PDF 分析報告](https://ithelp.ithome.com.tw/articles/10313246) 這篇文章,拜讀完文章後發現 SonarQube 的版本不同 (文章內介紹的是 8.7 ),裡面介紹的外掛已不支援,只能轉而尋找其他外掛。 ## SonarQube CNES Report [SonarQube CNES Report](https://github.com/cnescatlab/sonar-cnes-report) 是由 [CNES CAT LAB](https://cnescatlab.github.io/) 所維護的報告文件產製套件,算是目前有在定期更新的第三方套件。 >  > > 圖片截取自 [Doc: Plugin version matrix](https://docs.sonarsource.com/sonarqube/9.9/instance-administration/plugin-version-matrix/) 雖然 SonarQube 的官方文件上顯示它尚未支援 9.9 LTS 的版本,但其實 CAT Lab Github 上的 [README](https://github.com/cnescatlab/sonar-cnes-report#compatibility-matrix) 已經有清楚寫明各 SonarQube 版本支援的情況,讀者可以直接根據自己使用的 SonarQube 版本,選擇對應的 Release jar。  ## 使用方法 1. 把從 Release 下載的 jar 放到 SonarQube 下的 `\extensions\plugins\` 資料夾中。 2. 重啟 SonarQube 服務。 3. 如果有安裝成功,在畫面上方的 ToolBar 的 More 按鈕中,會出現 CNES Report 這個選項。 4. 點選 CNES Report 選項,會出現以下的畫面,可根據需求選擇產製的專案、分支、語系,以及要產出的報告類型。點選 Generate 就可以產生報告。  產出的報告會用壓縮檔打包,如果匯出的選項全選的話,其內容大概是這樣:  以 Word 格式的報告來說,產出的格式看起來滿簡陋的,有需要的話可以直接編輯修改。  或者,直接修改 Administration 的 CNES Report 頁籤中的 Template 路徑,將客製的 Template 路徑填入。但這部分我還沒有實際測試過,有需要的讀者可以自行試試看~  --- 以上就是今天的分享,希望能幫助到有需要的人。 對於文章內容有疑問也歡迎留言一起討論,謝謝!
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up