Build and Analyze a .net 4 project in Maven Sonar – Part 3

We have come to the final stages of the maven configuration. After we create settings.xml properly we are done with maven. It resides within M2_HOME/conf/.When you open the default settings.xml file, you will see that it has lot of lines and  most are commented. You just need to  add plugins at appropriate places. Keep other lines as they are. So the basic structure would be as following with dotnet and sonar plugins been added. Do necessary changes within plugins. Ex:- <galio.directory>, <sonar.jdbc.url> etc. Change them according to your installations and project properties.

<?xml version=”1.0″ encoding=”UTF-8″?>
<settings xmlns=”http://maven.apache.org/SETTINGS/1.0.0
          xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance
          xsi:schemaLocation=”http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd“>
 <profiles>
 <profile>
      <id>dotnet</id>
      <activation>
        <!– Optional activation by default –>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>

  <dotnet.4.0.sdk.directory>
  C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319</dotnet.4.0.sdk.directory>
             
        <!– Location of the Gallio installation –>
  <gallio.directory>
  C:\Program Files (x86)\Gallio</gallio.directory>

        <!– Location of StyleCop installation –>
        <stylecop.directory>
  C:\Program Files (x86)\Microsoft StyleCop 4.4.0.14</stylecop.directory>

        <!– Location of FxCop installation –>
        <fxcop.directory>
  C:\Program Files (x86)\Microsoft Fxcop 10.0</fxcop.directory>

        <!– Location of PartCover installation–>
        <partcover.directory>C:/Program Files (x86)/PartCover/PartCover .NET 4.0
  </partcover.directory>

        <!– Location of Source Monitor installation–>
  <sourcemonitor.directory>C:/Program Files (x86)/SourceMonitor
  </sourcemonitor.directory>
       
        <!– Location of Gendarme installation–>
  <gendarme.directory>C:/Program Files (x86)/Gendarme</gendarme.directory>
  
  <!– Location of NCover installation–>
  <ncover.directory>C:/Program Files/NCover</ncover.directory>
       
      </properties>
   </profile>
   <profile>
            <id>sonar</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
              
                <sonar.jdbc.url>jdbc:derby://localhost:1527/sonar;create=true
    </sonar.jdbc.url>
                <sonar.jdbc.driverClassName>org.apache.derby.jdbc.ClientDriver
    </sonar.jdbc.driverClassName>
                <sonar.jdbc.username>sonar</sonar.jdbc.username>
                <sonar.jdbc.password>sonar</sonar.jdbc.password>
    <sonar.host.url>http://localhost:9000</sonar.host.url&gt;
            </properties>
        </profile>
 </profiles>

</settings>

Next configuring sonar.properties file. After that we are done………………. 🙂