sonarqube-gradle-plugin: Wrong base directory derived for sub-projects two levels deep

1,265 views
Skip to first unread message

thipo...@gmail.com

unread,
Apr 28, 2016, 3:49:05 AM4/28/16
to SonarQube
Hi,

I have a multi-project with the following structure:

:very:bestappever
:bestappever-distrib

The SonarQubePlugin gives

:sonarqube
09:35:05.139 INFO  - Load global repositories
09:35:05.252 INFO  - Load global repositories (done) | time=114ms
09:35:05.254 INFO  - Server id: 20160428045618
09:35:05.256 INFO  - User cache: C:\Users\tk09\.sonar\cache
09:35:05.265 INFO  - Install plugins
09:35:05.401 INFO  - Install JDBC driver
09:35:05.414 INFO  - Create JDBC datasource for jdbc:mysql://10.48.213.38:3306/sonar
09:35:06.456 INFO  - Initializing Hibernate
:sonarqube FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':sonarqube'.
> The base directory of the module ':very:bestappever' does not exist: C:\Workarea\verybestappever\very\:very:bestappever

You may note, that the full path of project ':very:bestappever' is inserted at the wrong place.

This may be related to https://jira.sonarsource.com/browse/SONARGRADL-12 from which I've adopted the bestappever example by moving the :bestappever project to :very:bestappever.

I don't seem to have enough access rights to create JIRA tickets, but I'd be happy to provide a ZIP file with a minimal example demonstrating this behaviour.

Meanwhile I'd be grateful for any hints about  work-arounds.

Thanks and regards,

Thipor

thipo...@gmail.com

unread,
Apr 28, 2016, 4:11:34 AM4/28/16
to SonarQube, thipo...@gmail.com

Julien HENRY

unread,
Apr 28, 2016, 5:08:35 AM4/28/16
to SonarQube, thipo...@gmail.com
Hi Thipor,

I don't reproduce your issue with:
  - Gradle 2.4
  - SonarQube 4.5.6

Can you tell me your version of SonarQube and Gradle?

Also can please run
gradle sonarqube -DsonarRunner.dumpToFile=out.txt
on your sample project and send the resulting file out.txt to me.

++

Julien

Thipor Kong

unread,
Apr 28, 2016, 5:28:33 AM4/28/16
to Julien HENRY, SonarQube
Hi Julien,

thank you very much for the quick response!

I'm using Gradle 2.12 and sonar-core-plugin 5.1.1. Attached please find the out.txt and Gradle INFO-level output in run.txt.

Thanks,

Thipor

sonar-issue.zip

Thipor Kong

unread,
Apr 28, 2016, 7:33:20 AM4/28/16
to SonarQube, julien...@sonarsource.com, thi...@kong.name
Hi,

I have tracked down the issue to the following code line in SonarQube 5.1.1:

https://github.com/SonarSource/sonarqube/blob/5.1.1/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectReactorBuilder.java#L147


While moduleId contains the full path of the child project, the keys in the map currentModuleProperties have been stripped of parent-project path portion.

This appears to be fixed in 5.4

https://github.com/SonarSource/sonarqube/blob/branch-5.4/sonar-batch/src/main/java/org/sonar/batch/scan/ProjectReactorBuilder.java#L162



But how is it possible to select version 5.4 of SonarQube for use with the sonarqube-gradle-plugin?

Thanks and regards,

Thipor

Julien HENRY

unread,
Apr 28, 2016, 7:42:40 AM4/28/16
to Thipor Kong, SonarQube, thi...@kong.name
Hi Thipor,

The problem is not on SonarQube side. This is a stupid regression in the Scanner for Gradle. I have created a ticket:

I'll release a 2.0.1 version in a few minutes.

Thanks for catching this!

Julien

Julien HENRY

unread,
Apr 28, 2016, 8:01:07 AM4/28/16
to Thipor Kong, SonarQube, thi...@kong.name
Please test version 2.0.1 it should fix your issue.

++

Julien

thipo...@gmail.com

unread,
Apr 28, 2016, 12:26:06 PM4/28/16
to SonarQube, thipo...@gmail.com, thi...@kong.name
Looks good! Thanks you very much for the help and the very quick responses!
Reply all
Reply to author
Forward
0 new messages