spring-projects / spring-projects/spring-security

Build: Standardize Gradle plugin application to plugins {} block across all modules

Open
#18,497 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage type: enhancement
Dominant language
Java
Stars
9.6k
Forks
6.3k
Avg merge
2d 11h
Merged PRs (30d)
52

Description

Expected Behavior

All project modules should consistently use the modern, declarative plugins { ... } block for applying plugins. This ensures consistency across the codebase, aligns with Gradle's best practices, and unifies how internal and external plugins are applied.

Current Behavior

Currently, the build scripts use a mix of the modern plugins {} DSL and the legacy apply plugin: syntax. Inconsistencies exist not only between modules but also regarding how specific plugins are applied.

For example:

  1. docs/build.gradle Uses the plugins block for security-kotlin but uses apply plugin for standard plugins like java.
plugins {   // Path : spring-security\docs\spring-security-docs.gradle
	id 'org.antora' version '1.0.0'
	id 'io.spring.antora.generate-antora-yml' version '0.0.1'
	id 'io.spring.convention.repository'
	id 'security-kotlin'
}

apply plugin: 'io.spring.convention.docs'
apply plugin: 'java'
  1. core/build.gradle Uses apply plugin for security-kotlin, which contradicts the usage in docs.
plugins {  // Path : spring-security\core\spring-security-core.gradle
    id 'security-nullability'
}

apply plugin: 'io.spring.convention.spring-module'
apply plugin: 'security-kotlin'
  1. Widespread Inconsistency Beyond these examples, this pattern of mixing legacy and modern styles—or lacking a unified style—is observed in other functional modules as well (e.g., acl, config, web, etc.). Some modules rely heavily on apply plugin, while others have partially migrated, leading to a fragmented build configuration.

Context

I noticed this inconsistency while reviewing the build scripts.

Inconsistent Style: The same plugin (security-kotlin) is applied differently across modules.

Mixed DSL: Legacy imperative style (apply plugin) is mixed with the declarative plugins block within the same files.

Standardizing this to the plugins {} block will improve readability and make the build logic more uniform and maintainable.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect the plugin declarations in docs/build.gradle and core/build.gradle first, then compare the corresponding build scripts in modules such as acl, config, and web. Identify every legacy apply plugin usage and determine which declarations can use the plugins {} block. Done means all project modules consistently apply internal and external plugins through the modern block without the mixed style described here.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.