I want to scan existing java code base using sonarqube scanner. How can I do it?

I am using maven scanner of sonarqube, for my test automation java code to capture bugs and code smells to improve code quality. We have existing code base and now we are integrating the sonarqube with it.
When I run a scan it only applies on new code introduced. But I want to scan existing code base as well.
How can I achieve this? Please suggest.

Hey there.

What version of SonarQube are you using?