Why does the Maven command “mvn sonar:sonar” work without any plugin configuration in my “pom.xml”?

梦想与她 提交于 2019-11-29 22:49:55

The reason is that the Sonar Maven Plugin is hosted at the Codehaus Mojo project and benefits from the groupId "org.codehaus.mojo". This allows to use the shortcut "sonar:sonar" instead of "org.codehaus.mojo:sonar-maven-plugin::sonar" (see the section "Configuring Maven to Search for Plugins" of the Maven documentation)

Sonar has its own set of plugins (e.g. maven-checkstyle-plugin) which it is running when being invoked. These plugins are automatically configured according to your project settings in your configured Sonar server.

The reasoning behind this to have a controlled configuration in your sonar instance.

The reason it is working automatically for you is that you are using the default values for your sonar server installation (localhost:9000).

This 'zero-configuration' approach is further detailed here: We had a dream : mvn sonar:sonar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!