Prior to 6.4, the only constraint was that files had to be physical children of their parent modules. Modules were only a logical concept. Sensors were able to query files by relative path to their module.
With the introduction of global Sensors in 6.4, we started to also index files by relative path to project baseDir. This indexing is wrong when files are outside of project basedir. This may result in NullPointerException in global Sensors (see attached reproducer SONAR-9835-sample-cpp.zip, run analysis from the 'root' folder).
A check was added in 6.6-M1 to avoid this NPE, leading to strongly enforce that all indexed modules/folders/files are located under the project baseDir:
However, this change has an unexpected side effect: some Maven projects using a flat layout are no more compatible:
Running: mvn sonar:sonar -f parent/pom.xml used to work, but will now fail saying that path/to/module1 should be relative to project basedir (which is path/to/parent).
Note: MSBuild projects are unaffected, because the scanner for MSBuild compute the project baseDir as the nearest ancestor of all projects of the solution.
- revert the change, and try to support in global Sensors files that are outside project baseDir (having InputFile.relativePath() returning something like '../anotherDir/Foo.cpp')
- change the scanner for Maven (and possibly Gradle) to ensure project baseDir is an ancestor of all modules paths of the reactor (similar to what is done in the scanner for MSBuild)