Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kengotoda/sonarqube-rule-xml-generator

A maven plugin to generate sonarqube rule XML from findbugs.xml
https://github.com/kengotoda/sonarqube-rule-xml-generator

findbugs maven maven-plugin sonarqube sonarqube-plugin spotbugs

Last synced: 20 days ago
JSON representation

A maven plugin to generate sonarqube rule XML from findbugs.xml

Awesome Lists containing this project

README

        

# SonarQube rule.xml generator

[![Build Status](https://travis-ci.com/KengoTODA/sonarqube-rule-xml-generator.svg?branch=master)](https://travis-ci.com/KengoTODA/sonarqube-rule-xml-generator)
[![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=jp.skypencil.sonarqube%3Arule-xml-maven-plugin&metric=alert_status)](https://sonarcloud.io/dashboard?id=jp.skypencil.sonarqube%3Arule-xml-maven-plugin)

This is a Maven plugin to generate `rule.xml` which is necessary to [create SonarQube plugin](https://docs.sonarqube.org/display/DEV/Build+Plugin).

## How to use

Create a multi module Maven project, which has a submodule for SpotBugs plugin and another submodule for SonarQube plugin.

In SonarQube plugin submodule, execute `generate` goal at `generate-resources` phase. For instance:

```xml

jp.skypencil.sonarqube
rule-xml-maven-plugin
0.1.2

../spotbugs-plugin/src/main/resources/findbugs.xml
../spotbugs-plugin/src/main/resources/messages.xml
${project.build.outputDirectory}/rule.xml



generate-resources

generate




```

## Logic to decide severity

* If bug pattern's category is STYLE, MALICIOUS_CODE, I18N or EXPERIMENTAL, its severity is **INFO**
* Otherwise its severity is **MAJOR**

## Logic to decide tag

* If bug pattern's category is PERFORMANCE, CORRECTNESS or MULTI-THREADING, it's tagged with **bug**
* You can specify comma-separated list of custom tag by `` parameter, e.g. `foo,bar`