Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ekino/gradle-quality-plugin
Quality plugin applying some configuration for your builds (checkstyle, jacoco, sonarqube)
https://github.com/ekino/gradle-quality-plugin
checkstyle gradle jacoco java quality sonarqube
Last synced: 3 months ago
JSON representation
Quality plugin applying some configuration for your builds (checkstyle, jacoco, sonarqube)
- Host: GitHub
- URL: https://github.com/ekino/gradle-quality-plugin
- Owner: ekino
- License: mit
- Created: 2019-04-12T08:14:45.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-01-08T20:10:37.000Z (about 1 year ago)
- Last Synced: 2024-04-14T12:50:57.113Z (10 months ago)
- Topics: checkstyle, gradle, jacoco, java, quality, sonarqube
- Language: Kotlin
- Homepage: https://plugins.gradle.org/plugin/com.ekino.oss.gradle.plugin.quality
- Size: 333 KB
- Stars: 5
- Watchers: 21
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# gradle quality plugin
Quality gradle plugin for ekino projects
[![GitHub (pre-)release](https://img.shields.io/github/release/ekino/gradle-quality-plugin.svg)](https://github.com/ekino/gradle-quality-plugin/releases)
[![GitHub license](https://img.shields.io/github/license/ekino/gradle-quality-plugin.svg)](https://github.com/ekino/gradle-quality-plugin/blob/master/LICENSE.md)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ekino_gradle-quality-plugin&metric=alert_status)](https://sonarcloud.io/dashboard?id=ekino_gradle-quality-plugin)## Overview
This plugin configures:
* Check style (via [checkstyle](http://checkstyle.sourceforge.net/))
* Code coverage (via [Jacoco](http://www.jacoco.org/))
* Continuous code quality (via [SonarQube](https://www.sonarqube.org/))## Requirements
Gradle 7.6.1 and JDK 11 are required.
## Checkstyle configuration
This plugin checks that import had 3 groups in the below order:
* com
* java
* javaxand after that a latest group with static import
Be careful to configure your IDE code style with the same configuration to avoid errors.
You can override checkstyle version using a dedicated configuration.
Note: The default checkstyle.xml is compatible with 8.24 or later
```kotlin
checkstyle {
toolVersion = "8.41.1"
configFile = file("${project.rootDir}/config/checkstyle.xml")
}
```## Sonar Configuration
These values can be set in project properties:
* **SONARQUBE_URL**: Sonarqube server URL. Ex : `http://localhost:9000`
* **SONARQUBE_TOKEN**: login or authentication token of a SonarQube user with Execute Analysis permission on the project
* **sonarCoverageExclusions**: source files to exclude from code coverage (java extension, wildcard allowed, comma separator). Ex : `**/*Properties.java, **/*Constants.java`
* **sonarExclusions**: source files to exclude from analysis (java extension, wildcard allowed, comma separator). Ex : `**/*Properties.java, **/*Constants.java`Or you can set it in manuel mode on your CI pipeline (because you don't want that each developer publish to sonar)
## Usage
Add the plugin in your Gradle build script:
Groovy
```groovy
plugins {
id "com.ekino.oss.gradle.plugin.quality" version "2.1.0"
}
```Kotlin
```kotlin
plugins {
id("com.ekino.oss.gradle.plugin.quality") version "2.1.0"
}
```## For contributors
### Build
This will create the JAR and run the tests
./gradlew build
### Test on a local project
Add to your local project in the settings.gradle as described in [Gradle doc](https://docs.gradle.org/nightly/userguide/testing_gradle_plugins.html#verify-url-cmd-output)
includeBuild '[path/to/the/gradle/plugin]'### Publish
This will upload the plugin to Nexus repository
./gradlew build publish