Is there a way to avoid building a project with warnings?

I am using Eclipse IDE with SonarLint plugin for a maven Java project. And I have bonded that project to the SonarQube. When I analyze the code with sonarLint it shows several issues. But when I build the project it will build successfully even it has SonarLint issues.

Is there any way to avoid building the project successfully until all the issues found by SonarLint?

Hi @Sachithra_Weerathung

It is very tempting to break the build when some quality issues are found. But in our experience this is very often unpractical and often lead to developer writing ugly things to “fool the tool”. SonarLint/SonarQube should help the developer, not prevent him from doing his job.
More concretely, and even if we are putting a lot of effort in our rules, it is always possible to have false positive. In this case, the workflow is to go to SonarQube and mark the issue as “won’t fix/false positive” so that the issue stop appearing in both tools. If you break the build as soon as an issue is found, this workflow is not possible.

If you want to put a strong barrier somewhere, I recommend to use release/merge gates.