dokaspar
dokaspar

Reputation: 8644

Why are deleted Maven modules not disappearing from SonarQube?

I use SonarQube to analyze two Maven projects A and B with several modules each (only one displayed here):

projectA
`- someModule

projectB

Since I moved someModule from project A into project B, I get an error like this during the analysis:

Module "myGroupId:someModule" is already part of project "myGroupId:projectA"

Project A clearly does not contain 'someModule' anymore. It doesn't even show up as a component in the Sonar GUI after a new analysis, however it's still listed under 'Project Configuration > Update Key'.

How is it possible to delete such an obsolete component without deleting the entire project?

As a work-around I now renamed the key 'projectA:someModule' to 'projectA:someModuleThatShouldNotExist', but I hope someone can suggest a better solution...

Upvotes: 2

Views: 633

Answers (2)

JGrant
JGrant

Reputation: 11

The linked issue which was created has been closed as "Won't Fix" so there is no solution to this other than deleting the original project.

This is really unfortunate as requiring deletion of the original project when you are trying to split it in phases but not update who knows how many dependent locations by retaining the original group/artifact names will result in the next scan of the original repo reflagging issues which may have been previously marked as "Won't fix" or similar status creating more noise and work for the sonar maintainers.

Upvotes: 1

The status that you are describing is weird: if you have deleted "someModule" from project A and managed to analyze successfully this project in SonarQube, then it should not show up in the UI any longer and you should be able to analyze it within project B.

But as you can see this module in 'Project Configuration > Update Key', then you might have a workaround:

  1. Update the key of that module in project A (just append "-off" to the key for instance)
  2. Run an analysis of project B with "someModule": this should work

Upvotes: 3

Related Questions