Skip to content

peacetrue/peacetrue-gradle

Repository files navigation

Overview

Introduction

The peacetrue-gradle-plugin is used to configure Java projects according to conventions and automatically prepare the test environment. The conventions are as follows:

  • Apply the JavaLibraryPlugin to all projects.

  • Configure the use of JUnitPlatform in all projects.

  • Add the test library org.junit.jupiter:junit-jupiter-engine in sub-projects.

  • Apply the JacocoPlugin to sub-projects.

  • If it is a multi-project repository, apply the TestReportAggregationPlugin and JacocoReportAggregationPlugin to the root project.

Note
A repository may contain one or more projects. If it contains only one project, the root project is considered a sub-project.

Background

Multiple Java projects often require similar configurations. Using a plugin can help standardize these configurations.

Prerequisites

Minimum supported versions:

  • Gradle: 7.6

  • Java: 1.8

Usage

From the mavenCentral (real-time):

build.gradle
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath "com.github.peacetrue.gradle:peacetrue-gradle-plugin:{latest-version}"
    }
}

apply plugin: "io.github.peacetrue.build-convention"

From the gradlePluginPortal (delayed, subject to approval):

build.gradle
plugins {
    id "io.github.peacetrue.build-convention" version "{latest-version}"
}

Or:

build.gradle
buildscript {
    repositories {
        gradlePluginPortal()
    }
    dependencies {
        classpath "io.github.peacetrue:peacetrue-gradle-plugin:{latest-version}"
    }
}

apply plugin: "io.github.peacetrue.build-convention"

Check the version badge at the top of the page for the latest version.

Contributors

Timeline

Initial commit on 2022-05-02, last commit on 2024-06-28.

Releases

No releases published

Packages

No packages published