StackOverflowError at DefaultInputComponent.equals

I figured it out after attaching my debugger. I have a multi-module Maven project, and in the root POM I had set the property <sonar.projectKey>foo</sonar.projectKey>, which then propagated into the sub-modules, of course. When WorkDirectoriesInitializer.cleanAllWorkingDirs went to recurse through the project, it calculated a key for each module, but it did this by reading the sonar.projectKey property. Because this had the same value for every module, the recursion never completed and the stack overflowed.

The fix in my case (which I found on StackOverflow, of course) was to add <sonar.moduleKey>${project.artifactId}</sonar.moduleKey> to the root POM, which evaluates to a different value for each sub-module and thereby allows the recursion to complete.

3 Likes