Skip to end of metadata
Go to start of metadata

As it used to be the case for the .NET Plugins, Maven can be used to launch Sonar analyses on your C# code base.
If you are familiar with maven, you can also use the maven-dotnet-plugin in order to compile and package dotnet projects. If you already use CI tools such as Jenkins or Hudson on java maven projects, you can use the maven-dotnet-plugin to handle dotnet projects the same way

The POM file

Simplest "pom.xml" file for Maven

Above, a very simple pom.xml file that can be used instead of the sonar-project.properties of sonar java runner. If you want to use maven compile and run the tests of your visual studio solution, you also need to declare the maven-dotnet-plugin. Please take a look at the examples provided on the maven-dotnet-plugin site.

The settings file

You need to configure somewhere the location of the external tools used by Sonar such as FxCop, Gendarme or StyleCop. The C# plugins options pages describes the properties needed in the settings.xml. Below an xml fragment describing a maven profile you could add in your settings.xml file :

You can also use property keys used by the maven dotnet plugin. Feel free to take a look at the examples on the maven dotnet plugins.

Labels
  • None