Is it possible to disable the lint results check during the execution of the sonar task? My logs are filled with errors about missing lint results, but I don’t need them, as I’m using sonar only for coverage.
No issues information will be saved as the report file '/bitrise/src/{{redacted}}/build/reports/lint-results-debug.xml' can't be read.
java.io.FileNotFoundException: /bitrise/src/{{redacted}}/build/reports/lint-results-debug.xml (No such file or directory)
Analysis doesn’t look for lint reports by default. It sounds like your analysis configuration includes parameters for reports that don’t exist. You should take a look at properties with sonar.* names.
What plugins is your server running? It looks like this might be the default report path for the Sonar Android plugin. If none of your projects are passing in these reports, your best option is to just remove the plugin. If some are using it and you want to remove the log lines from the other projects’ analyses, I suppose you could try passing in an empty report…?
I’m not sure what to tell you. That really looks like it’s coming from the Sonar Android plugin. As I said, while you can import linter reports into your analysis, we don’t look for them by default. On the other hand, it’s fairly common for plugins to look for their reports by default.
I don’t have a Gradle background. I was unable to get started with this project.
* Where:
Build file '/home/anncampbell/testProjects/java/sonarissues/buildSrc/build.gradle.kts' line: 2
* What went wrong:
Plugin [id: 'org.gradle.kotlin.kotlin-dsl', version: '2.1.6'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:2.1.6')
Searched in the following repositories:
Gradle Central Plugin Repository
I tired looking at the project files, but they don’t seem to match up to what’s in the SonarQube docs about analyzing with Gradle.
I didn’t have any trouble running that on different machines. Maybe @Margarita_Nedzelska can help with that, as she seems to be able to run the sample?
It seems that lint-results-debug.xml has something to do with AndroidLint? We don’t import that (or look for reports) by default. There seems to be a sonar.androidLint.reportPaths property specified somewhere.
I suggest you start by adding sonar.scanner.dumpToFile=[path to file] to see the full list of analysis parameters passed in to the Scanner. From there you can sort out where on your side this one is coming from.
As far as I can see from the code here this property is added only if you have an AndroidLintTask and XML report output file is present.
I’m not an Android expert, so I think I need a bit more input here about your case:
Is it that you don’t use AndroidLint and that’s why you don’t have reports, but for some reason, the task is there and the property is automatically set or you’re actually using AndroidLint but you execute a sonar task before the AndroidLint report is generated and that’s why you get an error.
The problem is that (I think) all Android projects have a lint task present, however not everyone is running it.
Running lint is not obligatory, however, the plugin always sets the directory as the lint task is always present (which does not mean it has ever been run).
Same here. I am getting “Unable to import 1 Android Lint report file(s).” warning and would like to get rid of it. However ./gradlew sonar -x lint does not work and warning is still present.