问题
I have a project with an aggregator POM and several submodules:
com.example:root
|- com.example:module-a
|- com.example:module-b
|- com.example:module-c
It was decided that module-b needs to be a separate project, so the directory module-b was split off into a separate git repository.
Now we have 2 projects:
com.example:root
|- com.example:module-a
|- com.example:module-c
com.example:module-b
com.example:root was analyzed for a long time with SonarQube. I use the maven goal sonar:sonar.
Now when I analyze com.example:module-b with SonarQube, I get this error:
2016.02.16 13:03:24 ERROR [o.s.s.c.t.CeWorkerCallableImpl] Failed to execute task AVLqLZdJf9ZlZw0WwFfK
org.sonar.api.utils.MessageException: Validation of project failed:
o The project "com.example:project-b" is already defined in SonarQube but as a module of project "com.example:root". If you really want to stop directly analysing project "com.example:root", please first delete it from SonarQube and then relaunch the analysis of project "com.example:project-b".
2016.02.16 13:03:24 ERROR [o.s.s.c.t.CeWorkerCallableImpl] Executed task | project=com.example:project-b | id=AVLqLZdJf9ZlZw0WwFfK | time=302ms
The thing is, yes, in the past com.example:project-b was indeed a module of com.example:root, but it isn't any more now. I also don't want to stop analyzing com.example:root and I don't want to delete it and loose all history and all other modules.
How do I solve this?
回答1:
We have SonarQube 5.1.2. This is how I would try to fix this issue with our version. If this exact procedure doesn't work, maybe it will give you ideas for solving the problem and then we'll refine the answer.
- Log into SonarQube
- View the multi-module project
- In the project menu, click Settings --> Update Key
- Find
module-bin the list of keys, and provide an alternative name - maybemodule-b-old - Run multi-module analysis to see if that still works
- Run
module-banalysis to see if that works now.
There is also a Reset link; not sure what that does.
来源:https://stackoverflow.com/questions/35433891/sonarqube-how-to-analyze-project-that-used-to-be-submodule-of-another-project