Skip to content

Conversation

@davydotcom
Copy link
Contributor

@davydotcom davydotcom commented Oct 5, 2025

This will enhance the s2-quickstart to generate the beans in doWithSpring if performed within a web profile based plugin

It will also detect application.yml vs .groovy for configuration and inject a valid yaml config in place of the groovy one

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the s2-quickstart command to handle generating Spring Security beans within Grails plugins that use the web-plugin profile. The enhancement automatically detects when the command is run in a plugin environment and injects the required beans into the plugin's doWithSpring method instead of the traditional resources.groovy file.

  • Adds logic to detect plugin environment and locate the GrailsPlugin class file
  • Implements bean injection into the doWithSpring method for plugin-based projects
  • Updates documentation to explain plugin usage requirements

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
S2QuickstartCommand.groovy Adds plugin detection logic and bean injection methods for plugin environments
gettingStarted.adoc Documents the web-plugin profile requirement and new plugin functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +321 to +325
if (line.contains('doWithSpring()')) {
beans.each { Map bean ->
lines << ' ' + bean.definition
}
}
Copy link

Copilot AI Oct 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bean definitions are being added immediately after the doWithSpring() method declaration line, which will place them outside the method body. The logic should identify the opening brace of the doWithSpring method and add beans inside the method body.

Copilot uses AI. Check for mistakes.
davydotcom and others added 3 commits October 5, 2025 19:18
…urity/S2QuickstartCommand.groovy

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jdaugherty jdaugherty merged commit f7cea30 into 7.0.x Oct 15, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants