Skip to content

Commit

Permalink
SonarQube 10.5 compatibility (#1028)
Browse files Browse the repository at this point in the history
Since SonarQube 10.5 the built-in java plugin is not downloaded in case a project does not have java sources.
Disablee sonar.plugins.downloadOnlyRequired on the analyzer AND and the server so we can download the java plugin and use its classes
  • Loading branch information
gtoison authored Jun 27, 2024
1 parent 9220507 commit e069edf
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ jobs:
SONAR_PLUGIN_API_GROUPID: org.sonarsource.api.plugin
SONAR_JAVA_VERSION: 7.30.1.34514
SONAR_SERVER_JAVA_VERSION: 17
- SONAR_SERVER_VERSION: 10.5.1.90531
SONAR_PLUGIN_API_VERSION: 10.7.0.2191
SONAR_PLUGIN_API_GROUPID: org.sonarsource.api.plugin
SONAR_JAVA_VERSION: 7.34.0.35958
SONAR_SERVER_JAVA_VERSION: 17
# https://mvnrepository.com/artifact/org.sonarsource.sonarqube/sonar-core
# https://mvnrepository.com/artifact/org.sonarsource.api.plugin/sonar-plugin-api
# https://mvnrepository.com/artifact/org.sonarsource.java/sonar-java-plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ void jspSlingAnalysis() throws Exception {
.setPom(FindbugsTestSuite.projectPom("jspc-sling"))
.setProperty("sonar.dynamicAnalysis", "false")
.setProperty("sonar.findbugs.confidenceLevel", "low")
.setProperty("sonar.plugins.downloadOnlyRequired", "false")
.setGoals("clean package sonar:sonar");
orchestrator.executeBuild(build);

Expand Down Expand Up @@ -62,6 +63,7 @@ void jspJettyAnalysis() throws Exception {
.setPom(FindbugsTestSuite.projectPom("jspc-jetty"))
.setProperty("sonar.dynamicAnalysis", "false")
.setProperty("sonar.findbugs.confidenceLevel", "low")
.setProperty("sonar.plugins.downloadOnlyRequired", "false")
.setGoals("clean package sonar:sonar");
orchestrator.executeBuild(build);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class FindbugsTestSuite {
.useDefaultAdminCredentialsForBuilds(true)
.setSonarVersion("LATEST_RELEASE[" + sonarVersion + "]")
.setOrchestratorProperty("orchestrator.artifactory.url", "https://repo1.maven.org/maven2")
.setServerProperty("sonar.plugins.downloadOnlyRequired", "true")
.setServerProperty("sonar.plugins.downloadOnlyRequired", "false")
.restoreProfileAtStartup(FileLocation.ofClasspath("/it/profiles/empty-backup.xml"))
.restoreProfileAtStartup(FileLocation.ofClasspath("/it/profiles/findbugs-backup.xml"))
.restoreProfileAtStartup(FileLocation.ofClasspath("/it/profiles/fbcontrib-backup.xml"));
Expand Down
1 change: 1 addition & 0 deletions src/test/java/org/sonar/plugins/findbugs/it/ScalaIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ void test() throws Exception {
.setPom(FindbugsTestSuite.projectPom("scala"))
.setProperty("sonar.dynamicAnalysis", "false")
.setProperty("sonar.findbugs.confidenceLevel", "low")
.setProperty("sonar.plugins.downloadOnlyRequired", "false")
//.setProperty("sonar.sources", "src/main/scala")
//.setProperty("sonar.java.binaries", "target/classes")
.setGoals("clean package sonar:sonar");
Expand Down

0 comments on commit e069edf

Please sign in to comment.