Gradle quality plugin

Quality plugin applying some configuration for your builds (checkstyle, jacoco, sonarqube)

License

License

Categories

Categories

Gradle Build Tools
GroupId

GroupId

com.ekino.oss.gradle.plugin
ArtifactId

ArtifactId

gradle-quality-plugin
Last Version

Last Version

0.0.2
Release Date

Release Date

Type

Type

jar
Description

Description

Gradle quality plugin
Quality plugin applying some configuration for your builds (checkstyle, jacoco, sonarqube)
Project URL

Project URL

https://github.com/ekino/gradle-quality-plugin
Source Code Management

Source Code Management

https://github.com/ekino/gradle-quality-plugin

Download gradle-quality-plugin

How to add to project

<!-- https://jarcasting.com/artifacts/com.ekino.oss.gradle.plugin/gradle-quality-plugin/ -->
<dependency>
    <groupId>com.ekino.oss.gradle.plugin</groupId>
    <artifactId>gradle-quality-plugin</artifactId>
    <version>0.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.ekino.oss.gradle.plugin/gradle-quality-plugin/
implementation 'com.ekino.oss.gradle.plugin:gradle-quality-plugin:0.0.2'
// https://jarcasting.com/artifacts/com.ekino.oss.gradle.plugin/gradle-quality-plugin/
implementation ("com.ekino.oss.gradle.plugin:gradle-quality-plugin:0.0.2")
'com.ekino.oss.gradle.plugin:gradle-quality-plugin:jar:0.0.2'
<dependency org="com.ekino.oss.gradle.plugin" name="gradle-quality-plugin" rev="0.0.2">
  <artifact name="gradle-quality-plugin" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.ekino.oss.gradle.plugin', module='gradle-quality-plugin', version='0.0.2')
)
libraryDependencies += "com.ekino.oss.gradle.plugin" % "gradle-quality-plugin" % "0.0.2"
[com.ekino.oss.gradle.plugin/gradle-quality-plugin "0.0.2"]

Dependencies

runtime (1)

Group / Artifact Type Version
org.sonarsource.scanner.gradle : sonarqube-gradle-plugin jar 2.7

Project Modules

There are no modules declared in this project.

gradle quality plugin

Quality gradle plugin for ekino projects

GitHub (pre-)release GitHub license Quality Gate Status

Overview

This plugin configures:

Requirements

Gradle 6.0 and JDK 8 are required.

Checkstyle configuration

This plugin checks that import had 3 groups in the below order:

  • com
  • java
  • javax

and after that a latest group with static import

Be careful to configure your IDE code style with the same configuration to avoir errors.

You can override checkstyle version using a dedicated configuration.

Note: The default checkstyle.xml is compatible with 8.24 or later

checkstyle {
    toolVersion = "8.29"
    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

plugins {
    id "com.ekino.oss.gradle.plugin.quality" version "0.0.2"
}

Kotlin

plugins {
    id("com.ekino.oss.gradle.plugin.quality") version "0.0.2"
}

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 includeBuild '[path/to/the/gradle/plugin]'

Publish

This will upload the plugin to Nexus repository

./gradlew build publish
com.ekino.oss.gradle.plugin

Ekino

Versions

Version
0.0.2
0.0.1