Coder Social home page Coder Social logo

howtos's Introduction

Quick start SonarQube on Win-x86 machine with MS SQL Server Express (for ASP.NET project)

DISCLAIMER: I am not responsible for anything. Read the script before running it. Use it on your own risk.

  1. Installation

Run init.bat. This will create following important files and folders:

.
|--download
|
|--jb-commandline
|	|--inspectcode.exe
|
|--sonar-runner-2.4
|	|--bin
|	|	|--sonar-runner.bat
|	|--conf
|		|--sonar-runner.properties
|
|--sonarqube-4.3
	|--bin
	|	|--windows-x86-32
	|		|--StartSonar.bat
	|--conf
	|	|--sonar.properties
	|--extensions
	 	|--jdbc-driver
	 	|	|--mssql
	 	|		|--sqljdbc4.jar
	 	|--plugins
	 		|--sonar-csharp-plugin-3.0.jar
	 		|--sonar-javascript-plugin-1.6.jar
	 		|--sonar-resharper-plugin-1.0.jar
	 		|--sonar-stylecop-plugin-1.0.jar
	 		|--sonar-visual-studio-plugin-1.0.jar
	 		|--sonar-web-plugin-2.2.jar
	 		|--sonar-xml-plugin-1.1.jar

  1. Database configuration

Create Sonar database on your MS SQL Server

USE master;
GO
CREATE DATABASE sonar;
GO

Add user sonar/sonar and grant permissions

CREATE LOGIN sonar 
    WITH PASSWORD = 'sonar';	
USE sonar;
GO
CREATE USER sonar FOR LOGIN sonar 
    WITH DEFAULT_SCHEMA = dbo;	
GO
EXEC sp_addrolemember 'db_owner', 'sonar';
GO

Make sure to change default login and password

Edit sonarqube-4.3/conf/sonar.properties

Comment out H2 related lines:

#sonar.jdbc.url=jdbc:h2:tcp://localhost:9092/sonar

Change "Microsoft SQLServer" section and modify connection string:

sonar.jdbc.url: jdbc:sqlserver://localhost;databaseName=sonar;instanceName=SQLEXPRESS;selectMethod=cursor;
sonar.jdbc.driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
sonar.jdbc.validationQuery: select 1
sonar.jdbc.dialect= mssql

Edit sonar-runner-2.4/conf/sonar-runner.properties

Change "Microsoft SQLServer" section and modify connection string:

sonar.jdbc.url: jdbc:sqlserver://localhost;databaseName=sonar;instanceName=SQLEXPRESS;selectMethod=cursor;
sonar.jdbc.driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
sonar.jdbc.validationQuery: select 1
sonar.jdbc.dialect= mssql

Change "Global database settings" section

sonar.jdbc.username=sonar
sonar.jdbc.password=sonar
  1. Sonar configuration

Open cmd and navigate to current directory

Run _sonar-runner-2.4/bin/windows-x86-32/StartSonar.bat -X

Examine errors (if there's any) and deal with them

Open http://localhost:9000

Log in as admin/admin

Change default password

Configure paths for external tools

TODO...

  1. Project Configuration

Add sonar-project.properties one level up the .sln file

sonar.projectKey=org.company.projectname
sonar.projectName=Project Name
sonar.projectVersion=1.0
sonar.sourceEncoding=UTF-8

# Enable the Visual Studio bootstrapper
sonar.visualstudio.enable=true

# This property is set because it is required by the SonarQube Runner.
# But it is not taken into account because the location of the source
# code is retrieved from the .sln and .csproj files.
# Do not set it to "." as it may result in unexpected behaviour 
sonar.sources=src
sonar.exclusions=src/packages/**, **/_ReSharper.**, **/bin/**, **/obj/**

howtos's People

Contributors

bitnot avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.