'Is there a way to integrate sonarlint plugin in pom.xml

I want to add sonarlint plugin to my project. When I build with maven, the plugin should be automatically enabled without my intervention. Is there a way I could do it?



Solution 1:[1]

SonarLint is a local plugin that can be embedded in your IDE. In the plugin setting you can put the "Automatically trigger analysis" in order to have feedback while writing.
In order to perform continuous integration you should use SonarQube, it is possible to integrate it with Jenkins or Codemagic and also with Maven. It is possible to add SonarQube to your pull requests as well.
You can see the doc here

You can find more information about the difference between SonarLint and SonarQube here

Solution 2:[2]

Sound like you want the sonarscanner for maven.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 raffaele spinoni
Solution 2 Johan Nordlinder