This plugin enables Jenkins to call Bitbucket Server Code Insights API.
https://docs.atlassian.com/bitbucket-server/rest/7.21.0/bitbucket-code-insights-rest.html
Just download the latest plugin from here.
Building this plugin requires Java 11+.
- Clone this repository.
- Move into the directory.
./mvnw clean package
- Upload
target/codeInsights.hpi
on Jenkins.
- Code analysis tool results will be shown on your PR diff view when you set code analysis tool settings (see Supporting code analysis tools).
- Coverage results will be shown on your PR diff view when you set JaCoCo settings. Furthermore, you can see the summary as a report.
Set up in your-jenkins/configure
.
Name | Description | required |
---|---|---|
bitbucketUrl |
URL of your Bitbucket. | Yes |
project |
Project name. | Yes |
reportKey |
Report Key of API (see document). | Yes |
username |
Your username of Bitbucket. | Yes |
password |
Your password of Bitbucket. | Yes |
SonarQubeUrl |
URL of your SonarQube Server. | No |
SonarQubeToken |
Token of your SonarQube account. | No |
SonarQubeUsername |
Username of your SonarQube account. | No |
SonarQubePassword |
Password of your SonarQube account. | No |
Set up in your Job settings page or give in Jenkinsfile
as parameter.
Name | Description | required | default |
---|---|---|---|
repositoryName |
Your repository name. | Yes | - |
srcPath |
Source path of your repository. | No | src/main/java |
commitId |
Commit Sha of target branch. You can use env.GIT_COMMIT as commitId in Jenkins Multibranch pipeline job. |
Yes | - |
baseBranch |
Base branch of your repository (e.g., origin/main ). |
No | origin/master |
checkstyleFilePath |
Relative path of Checkstyle result file from repository root (e.g., target/checkstyle-result.xml ). |
No | - |
spotBugsFilePath |
Relative path of SpotBugs result file from repository root (e.g., target/spotbugsXml.xml ). |
No | - |
pmdFilePath |
Relative path of PMD result file from repository root (e.g., target/pmd.xml ) |
No | - |
SonarQubeProjectKey |
Project key of SonarQube project. If you use SonarQube plugin in Jenkins, specify the same value as XXX of mvn sonar:sonar -Dsonar.projectKey=XXX |
No | - |
qodanaFilePath |
Relative path of Qodana result file from repository root (e.g., report/qodana.sarif.json ) |
No | - |
jacocoFilePath |
Relative Path of JaCoCo result file from repository root (e.g., target/site/jacoco/jacoco.xml ) |
No | - |
Currently, this plugin supports the following tools.
- Checkstyle
- SpotBugs
- PMD
- SonarQube
- JetBrains Qodana
The following tools are planned to be supported in the future.
- CodeQL
- Fortify
Currently, this plugin supports the following tools.
- JaCoCo
Licensed under MIT, see LICENSE
Please tell me via Issue!