All Projects → porscheinformatik → sonarqube-licensecheck

porscheinformatik / sonarqube-licensecheck

Licence: Apache-2.0 license
SonarQube Licensecheck Plugin

Programming Languages

java
68154 projects - #9 most used programming language
Vue
7211 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to sonarqube-licensecheck

Jenkinsfiles
Examples for jenkins pipelines, comparing scripted and declarative syntax
Stars: ✭ 187 (+53.28%)
Mutual labels:  sonarqube
SimpleLicensing
A Go Based Licensing System for Digital Rights Management
Stars: ✭ 96 (-21.31%)
Mutual labels:  license-management
localhost-sonarqube
Analysing source code locally with SonarQube in a Docker environment.
Stars: ✭ 17 (-86.07%)
Mutual labels:  sonarqube
Hands On Devops
A hands-on DevOps course covering the culture, methods and repeated practices of modern software development involving Packer, Vagrant, VirtualBox, Ansible, Kubernetes, K3s, MetalLB, Traefik, Docker-Compose, Docker, Taiga, GitLab, Drone CI, SonarQube, Selenium, InSpec, Alpine 3.10, Ubuntu-bionic, CentOS 7...
Stars: ✭ 196 (+60.66%)
Mutual labels:  sonarqube
drupalci-sonar-jenkins
DEPRECATED - Drupal CI environment with SonarQube and Jenkins for Drupal Core code analysis.
Stars: ✭ 40 (-67.21%)
Mutual labels:  sonarqube
sonar-sql-plugin
SQL language (T-SQL, MySQL, Vertica and PostgreSQL dialects) plugin for SonarQube
Stars: ✭ 52 (-57.38%)
Mutual labels:  sonarqube
Sonar Scanner Cli
Scanner CLI for SonarQube and SonarCloud
Stars: ✭ 175 (+43.44%)
Mutual labels:  sonarqube
sonarqube-azure-setup
A guide for a serverless setup of Sonarqube on Azure with a managed SQL database
Stars: ✭ 15 (-87.7%)
Mutual labels:  sonarqube
sbt-sonar
An sbt plugin which provides an easy way to integrate Scala projects with SonarQube.
Stars: ✭ 62 (-49.18%)
Mutual labels:  sonarqube
sonar-auth-aad
Azure Active Directory Authentication for SonarQube
Stars: ✭ 59 (-51.64%)
Mutual labels:  sonarqube
Sonarlint Visualstudio
SonarLint extension for VisualStudio
Stars: ✭ 242 (+98.36%)
Mutual labels:  sonarqube
setup-sonar-scanner
Github Action which downloads and runs sonar-scanner cli with custom parameters to start Sonarqube scan.
Stars: ✭ 31 (-74.59%)
Mutual labels:  sonarqube
java-license-manager
OddSource Code Java License Manager
Stars: ✭ 22 (-81.97%)
Mutual labels:  license-management
Nxplorerjs Microservice Starter
Node JS , Typescript , Express based reactive microservice starter project for REST and GraphQL APIs
Stars: ✭ 193 (+58.2%)
Mutual labels:  sonarqube
sonar-puppet
SonarQube plugin for Puppet code.
Stars: ✭ 27 (-77.87%)
Mutual labels:  sonarqube
Sonartsplugin
SonarQube plugin for TypeScript files
Stars: ✭ 182 (+49.18%)
Mutual labels:  sonarqube
rate-my-cat
Sample application for the book "Mastering Software Testing with JUnit 5"
Stars: ✭ 23 (-81.15%)
Mutual labels:  sonarqube
zap-sonar-plugin
Integrates OWASP Zed Attack Proxy reports into SonarQube
Stars: ✭ 66 (-45.9%)
Mutual labels:  sonarqube
generator-mitosis
A micro-service infrastructure generator based on Yeoman/Chatbot, Kubernetes/Docker Swarm, Traefik, Ansible, Jenkins, Spark, Hadoop, Kafka, etc.
Stars: ✭ 78 (-36.07%)
Mutual labels:  sonarqube
eslint-plugin-license-header
Rules to validate the presence of license headers in source files.
Stars: ✭ 21 (-82.79%)
Mutual labels:  license-management

SonarQube License-Check

Sonarcloud Status

This SonarQube plugin ensures that projects use dependencies with compliant licenses. All dependencies and licenses can be viewed per projects and exported to Excel 2003 XML Format. This enables a simple governance of dependencies and licenses for the whole organization.

License

This software is licensed under the Apache Software License, Version 2.0

Table of Contents

Features

Analysis

The plugin scans for dependencies defined in your project including all transitive dependencies.

Currently, supported formats are:

  • Maven POM files - all dependencies with scope "compile" and "runtime" are checked
  • Gradle projects which use JK1 plugin
  • NPM package.json files - all dependencies (except "devDependencies") are checked
    • Note that transitive dependencies are not scanned unless licensecheck.npm.resolvetransitive is set to true.

      Transitive

Project Dashboard

The plugin contains a project dashboard showing a list of dependencies with version and a list of all used licences. Each table shows the status of the license (allowed, not allowed, not found). You can also export the data to Excel.

Project Dashboard

Compatibility

This plugin is compatible:

  • 5.x version with 8.9 LTS and <= 9.7.x
  • 4.x version with SonarQube 8.x
  • 3.x version with SonarQube >= 7.9 LTS and < 8.
  • 2.x version with SonarQube >= 6.5 and < 7.
  • 1.x versions with SonarQube >= 5.3 and < 6.

For all changes see CHANGELOG.md

Installation

Put the pre-built jar-file (from release downloads) in the directory $SONARQUBE_HOME/extensions/plugins and restart the server to install the plugin. Activate the rules of this plugin ("License is not allowed", "Dependency has unknown license") in your SonarQube quality profiles - otherwise the plugin is not executed.

Configuration

After booting the SonarQube Server with the License-Check Plugin be found in the tab Administration or also in the Configuration -> LicenseCheck drop down menu.

Configuration via Administration Tab

  • Within the General Settings and License Check you find the settings for the plugin.
  • Within the general settings the plugin can be manually enabled or disabled. By default, it is enabled.
    • Under "Dependency Mapping" you can map a dependency name/key (with regex) to a license, e.g. ^asm:asm$ to "BSD-3-Clause"

    • Under "License Mapping" you can map a license name (with regex) to a license, e.g. .*Apache.*2.* to "Apache-2.0".

      License Configuration1

    • Under "Licenses" you can allow or disallow licenses globally and add/edit the list of known licenses.

      License Configuration2

    • Under "Project Licenses" you can allow and disallow licenses for a specific project.

      License Configuration2

Configuration via License Menu

Administration -> Configuration(dropdown) -> License Check

alternative License Configuration1

  • Under "Licenses" you can allow or disallow licenses globally and add/edit the list of known licenses.

    alternative License Configuration2

    alternative License Configuration3

  • Under "Project Licenses" you can allow and disallow licenses for a specific project.

    alternative License Configuration4

    alternative License Configuration5

  • Under "Dependency Mapping" you can map a dependency name/key (with regex) to a license, e.g. ^asm:asm$ to "BSD-3-Clause"

    alternative License Configuration6

    alternative License Configuration7

  • Under "License Mappings" you can map a license name (with regex) to a license, e.g. .*Apache.*2.* to "Apache-2.0".

    alternative License Configuration8

    alternative License Configuration9

Activation rules in Quality Profile

You have to activate the new rules in a (new) quality profile, for each supported language (Groovy, Kotlin, Java, JavaScript, TypeScript) And you have to use this profile for your project.

  1. Step 1

    activate 1

  2. Step 2

    activate 2

  3. Step 3

    activate 3

  4. Step 4

    activate 4

  5. Step 5

    activate 5

  6. Step 6

    activate 6

  7. Step 7

    activate 7

Execution

When a project is analyzed using the mvn sonar:sonar in command line the extension is started automatically.

Please make sure to have all dependencies installed before launching the SonarQube analysis. So your complete build should look something like this:

mvn -B org.jacoco:jacoco-maven-plugin:prepare-agent install org.jacoco:jacoco-maven-plugin:report
mvn -B sonar:sonar

Supported Languages

Groovy, Kotlin, Java, JavaScript, TypeScript

Supported Project Types

Maven

Maven works if your project/module has a pom.xml on its root level (running with Maven, Gradle or SonarScanner).

NPM

NPM works if your project/module has a package.json on its root level (running with Maven, Gradle or SonarScanner).

Gradle

Gradle project should use JK1 plugin https://github.com/jk1/Gradle-License-Report

Note: Please check above link for instructions or follow as mentioned below

Step1: Update build.gradle file with following code for using JK1 plugin

import com.github.jk1.license.filter.LicenseBundleNormalizer
import com.github.jk1.license.render.JsonReportRenderer

plugins {
  id 'com.github.jk1.dependency-license-report' version '1.13'
}

licenseReport {
    allowedLicensesFile = new File("$projectDir/src/main/resources/licenses/allowed-licenses.json")
    renderers = new JsonReportRenderer('license-details.json', false)
    filters = [new LicenseBundleNormalizer()]
}

Step 2: Update build.gradle file with following code for using SonarQube plugin

plugins {
    id 'org.sonarqube' version "3.0"
}

jar {
    enabled = true
}

sonarqube {
    properties {
        property "sonar.host.url", "http://localhost:9000"
    }
}

Step 3: run following command to generate your report license-details.json in build/reports/dependency-license

> gradle generateLicenseReport

Step 4: run following command for SonarQube

> gradle sonarqube

Configuration via Sonar API

You can also use the Sonar API to configure the plugin.

Plugin Activation

  • Get the setting

    curl -X GET -v -u USERNAME:PASSWORD "http://localhost:9000/api/settings/values?keys=licensecheck.activation"
    
  • Enable

    curl -X POST -v -u USERNAME:PASSWORD "http://localhost:9000/api/settings/set?key=licensecheck.activation&value=true"
    
  • Disable

    curl -X POST -v -u USERNAME:PASSWORD "http://localhost:9000/api/settings/set?key=licensecheck.activation&value=false"
    

Global License Settings

  • Get the setting
    curl -X GET -v -u USERNAME:PASSWORD "http://localhost:9000/api/settings/values?keys=licensecheck.license-set"
    

Project License Settings

  • Get the setting
curl -X GET -v -u USERNAME:PASSWORD "http://localhost:9000/api/settings/values?keys=licensecheck.project-license-set"

License Mapping

  • Get the setting

    curl -X GET -v -u USERNAME:PASSWORD "http://localhost:9000/api/settings/values?keys=licensecheck.license-mapping"
    

Dependency Mapping

  • Get the setting

    curl -X GET -v -u USERNAME:PASSWORD "http://localhost:9000/api/settings/values?keys=licensecheck.dep-mapping"
    

NPM Transitive setting

  • Get the setting

    curl -X GET -v -u USERNAME:PASSWORD "http://localhost:9000/api/settings/values?keys=licensecheck.npm.resolvetransitive"
    
  • Enable

    curl -X POST -v -u USERNAME:PASSWORD "http://localhost:9000/api/settings/set?key=licensecheck.npm.resolvetransitive&value=true"
    
  • Disable

    curl -X POST -v -u USERNAME:PASSWORD "http://localhost:9000/api/settings/set?key=licensecheck.npm.resolvetransitive&value=false"
    
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].