Even after this property is supplied, entire source code is considered for scanning.
If the same property is applied from external sample Gradle project, then it considers correct scope,
but from the actual project it ignores this property completely.
always lots of main-build related warnings occurring.
File ‘someFile.java’ is ignored. It is not located in project basedir C:\Users\abc\work\src1\main
( Note:- if I exclude every thing for scanning property ‘sonar.exclusions’,"**/*” , it still keeps giving this warnings
SonarScanner for Gradle reads many analysis values from your build environment, and I believe what you’ve set in your analysis parameters is being overridden once the scanner reads that data from the environment. Parameters passed on the analysis command line are read last of all, which is why that would work.
So you have a workaround. And I’m going to flag this for team attention, since the current behavior is clearly not what users expect.
External Project, consider any hello world gradle project’s build.gradle file from where we run sonar action with main project’s path supplied as properties.
main-build is the out of repo folder which contains all generated java files. which gives warnings.
this text “File ‘someFile.java’ is ignored. It is not located in project basedir C:\Users\abc\work\src1\main”
is the warning.
in sample project it works , but in actual project it gives problems.
Hello @Manish_Umrania, unfortunately, I don’t understand your second point and thus I’m unable to reproduce and investigate the issue.
Please provide us with a small project structured and configured according to the scenario that experiences the issue. The more details you can provide the better is.