Conversation
4b04d75 to
2afe830
Compare
There was a problem hiding this comment.
Pull request overview
This PR upgrades the plugin to support Sonarqube 26.1, which requires Java 21. The changes include updating the Java version from 17 to 21 across build configurations, migrating from deprecated org.apache.commons.lang to org.apache.commons.lang3, replacing URL with URI in test code, and modernizing code to use Java 21 features like pattern matching in switch expressions.
Changes:
- Updated Java version from 17 to 21 in build configurations and CI workflows
- Migrated from
org.apache.commons.langtoorg.apache.commons.lang3 - Modernized Java code to use switch expressions with pattern matching
- Updated copyright years to 2026 across multiple files
Reviewed changes
Copilot reviewed 25 out of 26 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| build.gradle | Updated Sonarqube version to 26.1.0.118079 and Java version to 21 |
| Dockerfile | Changed base image from jdk17 to jdk21 and fixed plugin path references |
| .github/workflows/build.yml | Updated Java version matrix and conditions from 17 to 21 |
| .github/workflows/codeql-analysis.yml | Updated Java version from 17 to 21 |
| .env | Updated Sonarqube and plugin versions |
| gradle.properties | Updated plugin version to 26.1.0-SNAPSHOT |
| src/main/java/.../BaseFormatterFactory.java | Refactored if-else chain to switch expression with pattern matching |
| src/main/java/.../CommunityBranchLoaderDelegate.java | Converted if-else to switch expression for branch type handling |
| Multiple Java source files | Updated imports from org.apache.commons.lang to lang3 and copyright years |
| src/test/java/.../GithubPullRequestDecoratorTest.java | Changed from URL to URI.create().toURL() |
| sonarqube-webapp-addons/src/branches/ | Updated component imports and refactored to use consolidated components |
| sonarqube-webapp | Updated subproject commit reference |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ENV SONAR_WEB_JAVAADDITIONALOPTS="-javaagent:/opt/sonarqube/extensions/plugins/sonarqube-community-branch-plugin-${PLUGIN_VERSION}.jar=web" | ||
| ENV SONAR_CE_JAVAADDITIONALOPTS="-javaagent:/opt/sonarqube/extensions/plugins/sonarqube-community-branch-plugin-${PLUGIN_VERSION}.jar=ce" |
There was a problem hiding this comment.
The paths have been changed to absolute paths starting with /opt/sonarqube/ instead of relative paths starting with ./. Verify that the working directory during execution is not /opt/sonarqube, as this would make the absolute paths incorrect. If the container runs from a different directory, these absolute paths may fail to locate the plugin JAR.
| <NewCodeDefinitionSpecificGroup | ||
| analysis={analysis} | ||
| ariaLabelledBy="specific-definition-label" |
There was a problem hiding this comment.
The ariaLabelledBy prop references an element with id 'specific-definition-label', but no such element is visible in the provided diff. Verify that this id exists in the rendered DOM to ensure proper accessibility.
|
When using this plugin compiled with Java 21, scans executed from Maven at Java 17 fail with: E.g. the plugin code directly plays some role in the scanner run and when compiled with Java 21, scanner also needs to run at Java 21. Can this plugin be improved in this regard? As per SonarSource, Java 17 can be still used at the client side (scanners), it's only deprecated. Only server side requires Java 21 now. For now I've recompiled the plugin with Java 17 using Sonar server 25.12 libraries as compilation fails with Java 17 & 26.1 server libraries. It works well so far. |
Thanks for the feedback. There's nothing in the plugin that requires Java 21, so I'll rollback the Java 21 part of the changes to retain Java 17 for now. |
2afe830 to
486f253
Compare
|
I built this repo locally using JDK 21 and copy .jar generated. I updated my compose.yaml, but when I running my pipeline generate this error: There are some recommendation? |
|
It's working now. |
486f253 to
1678eba
Compare
|
I have another question. I have the same problem this link when running my pipeline. It's limitation by SonarQube or problem with configuration in my devops or limitation this pluging? Thank you for your attention! |
I think this is a problem with your configuration, but without some replication steps I can't confirm that. |
49b4ceb to
f4549c0
Compare
Upgrades the plugin to use Sonarqube 26.1 back-end and front-end. Whilst server-side is built using Java 21 for this version of Sonarqube, scanner-side still support Java 17, so the project is being kept on Java 17 compilation target for now.
f4549c0 to
bc066c4
Compare
|




Upgrades the plugin to use Sonarqube 26.1 components. As this version of
Sonarqube requires Java 21, the build image has been upgraded to use
Java 21, and the plugin updated to fix deprecation warnings from the
upgrade and to use Java 21 features.