Custom Gradle Plugin for Unified Static Code Analysis

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • gradle-code-style-plugin-example

    Custom Gradle Plugin for Unified Static Code Analysis

  • plugins { id 'java-gradle-plugin' id 'com.gradle.plugin-publish' version '1.1.0' } group = 'io.github.simonharmonicminor.code.style' sourceCompatibility = '8' repositories { mavenCentral() } ext { set('lombokVersion', '1.18.24') } dependencies { compileOnly "org.projectlombok:lombok:${lombokVersion}" annotationProcessor "org.projectlombok:lombok:${lombokVersion}" testImplementation 'org.junit.jupiter:junit-jupiter:5.7.2' } gradlePlugin { website = 'https://github.com/SimonHarmonicMinor/gradle-code-style-plugin-example' vcsUrl = 'https://github.com/SimonHarmonicMinor/gradle-code-style-plugin-example' plugins { gradleCodeStylePluginExample { id = 'io.github.simonharmonicminor.code.style' displayName = 'Gradle Plugin Code Style Example' description = 'Predefined Checkstyle and PMD rules' implementationClass = 'io.github.simonharmonicminor.code.style.CodingRulesGradlePluginPlugin' tags.set(['codestyle', 'checkstyle', 'pmd']) } } } tasks.named('test') { useJUnitPlatform() }

  • PMD

    An extensible multilanguage static code analyzer.

  • PMD and Checkstyle are static analysis tools that check your code on each project build. Gradle allows to apply them easily.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • monorepo.tools

    Your defacto guide on monorepos, and in depth feature comparisons of tooling solutions.

  • If your entire project (or even company) is the monorepository, then this setup is absolutely fine. You just need to put these configurations in the root build.gradle file to apply those plugins for every existing module. But what if your choice is polyrepository? What if you want to share the same code style within all the projects in the company that developers are working on (and all the ones the programmers will create in the future)? Well, you can tell them to simply copy and paste the plugins’ configuration. Anyway, that’s an error-prone approach. There is always a probability that somebody does some misconfiguration.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts