I try to find a way to use 2 repositories on git in the same project, today the problem is, when a scan run, the sonar only mantains the result from the last scan.
I have a group on git, with a project for each microservice, i run the sonar in each microservice using gitlab-ci for each project, but i want to have only 1 project on sonar, is possible?
Technically speaking and as you mentioned: 1 scanner analysis = 1 project in SQ. So no it is not possible to have different analyses going to a single project in SQ.
The feature SQ has for this specific need is Applications: an application is basically an aggregation of projects. This is available in the Enterprise Edition.
The other way is to make sure your whole codebase is checked out first (your 2 projects), then start the analysis. Of course, this needs more work and maintenance on your build/pipeline.