-
Notifications
You must be signed in to change notification settings - Fork 229
enhance gradle s2-quickstart to handle running in a web-plugin profile #1177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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.
plugin-core/plugin/grails-app/commands/grails.plugin.springsecurity/S2QuickstartCommand.groovy
Outdated
Show resolved
Hide resolved
| if (line.contains('doWithSpring()')) { | ||
| beans.each { Map bean -> | ||
| lines << ' ' + bean.definition | ||
| } | ||
| } |
Copilot
AI
Oct 5, 2025
There was a problem hiding this comment.
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.
…urity/S2QuickstartCommand.groovy Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…nfiguration in the yml instead
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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