pinchbv / android-analyzer

Android Gradle plugin for faster Sonarqube integration in Android projects. Supports Detekt and Jacoco out of the box.
http://pinch.nl
GNU General Public License v3.0
91 stars 16 forks source link

Not authorized. Please check the properties sonar.login and sonar.password #13

Closed forming closed 5 years ago

forming commented 5 years ago

My project has multiple modules, when running the modules separately, e.g ./gradlew app-models:androidAnalyzer seems to work fine.

But when I try to run ./gradlew androidAnalyzer

The sonarqube fails and I receive an error:

Not authorized. Please check the properties sonar.login and sonar.password.

AndroideRob-zz commented 5 years ago

Thanks for opening an issue. This is expected behavior, as stated in the documentation. Please call the plugin separately for each module.

forming commented 5 years ago

Each time the task is being executed SonarQube assumes the report is for the whole project itself, so by running modules separately the data/charts are being distorted.

AndroideRob-zz commented 5 years ago

Currently, the plugin treats each module as a separate Sonarqube project, and gathering several Gradle modules in a single Sonarqube project is not supported. Do you think that would be a valuable feature?

forming commented 5 years ago

Ah, you're right, I was using the same applicationId and packageName when running modules separately.

I think it would be valuable, currently, you have to make do with a couple if not dozens of separate Sonarqube projects (for a larger Android project). It would be much easier to track progress and overall project state if the modules reports were aggregated to a single project.

AndroideRob-zz commented 5 years ago

I have integrated this in a project with 10 modules and I agree that it's easier if all of them go to a single Sonarqube project. If there is a single team working on the project, it's valuable.

However, if there are multiple teams taking care of the modules individually, then this sort of separation might be even valuable.

Thanks for your input, I am going to investigate how to combine multiple Gradle modules in a single Sonarqube project.