Skip to content

Vagrant Environment for a SonarQube based Source Code Analysis service

Notifications You must be signed in to change notification settings

rgl/sonarqube-windows-vagrant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This is a Vagrant Environment for a SonarQube based Source Code Analysis service.

This will:

Usage

Build and install the Windows 2019 Base Box.

Install the needed plugins:

vagrant plugin install vagrant-reload # https://github.com/aidanns/vagrant-reload

Then start this environment:

vagrant up

Excluding Projects from SonarQube Analysis

sonar.exclusions (and other paths) are relative to the project directory, as such, they can only exclude files inside a project. to exclude the project itself you have to use one of the following (before calling SonarScanner.MSBuild begin):

  1. Modify each .csproj file to have the following element:

    <PropertyGroup>
      <SonarQubeExclude>true</SonarQubeExclude>
    </PropertyGroup>
  2. Create a <Project>.csproj.user file (on the same directory as <Project>.csproj) with:

    <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      <PropertyGroup>
        <SonarQubeExclude>true</SonarQubeExclude>
      </PropertyGroup>
    </Project>
  3. Implement some global logic by placing a MSBuild snippet (e.g. a .targets file) inside the current user or the local machine MSBuild directories, that is, at one of:

    C:\Users\<User>\AppData\Local\Microsoft\MSBuild\15.0\Microsoft.Common.targets\ImportBefore
    C:\Program Files (x86)\MSBuild\15.0\Microsoft.Common.Targets\ImportBefore
    

    NB these directories are scanned before the <Project>.csproj.user file.

    NB before importing the files MSBuild sorts them by file name; e.g. to import a file last give it a, e.g. ZZZ prefix.

For more information see:

About

Vagrant Environment for a SonarQube based Source Code Analysis service

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published