apache / apache/grails-core

Grails7, Spring Security UI Plugin, generating Auth GSP doesn't work

Open
#15,843 7 comments 0 reactions 0 assignees View on GitHub
relates-to:spring-security
Dominant language
Groovy
Stars
2.9k
Forks
975
Avg merge
1d 22h
Merged PRs (30d)
92

Description

### Expected Behavior

As per documentation, 11. Customization, I tried to generate login page GSP,
`grails s2ui-override auth`

### Actual Behaviour

but i get errors.
`Error Command [s2ui-override] error: class path resource [classpath*:META-INF/templates/views/login/auth.gsp] cannot be opened because it does not exist (Use --stacktrace to see the full trace)`

and

`| Error Command [s2ui-override] error: class path resource [classpath*:META-INF/templates/views/login/auth.gsp] cannot be opened because it does not exist (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
java.io.FileNotFoundException: class path resource [classpath*:META-INF/templates/views/login/auth.gsp] cannot be opened because it does not exist
at org.grails.io.support.ClassPathResource.getInputStream(ClassPathResource.java:152)
at org.grails.io.support.SpringIOUtils.copy(SpringIOUtils.java:214)
at org.grails.cli.profile.commands.io.FileSystemInteractionImpl.copy(FileSystemInteractionImpl.groovy:146)
at org.grails.cli.profile.commands.io.FileSystemInteractionImpl.copy(FileSystemInteractionImpl.groovy)
at org.grails.cli.profile.commands.script.GroovyScriptCommand.copy(GroovyScriptCommand.groovy:62)
at s2ui-override.run(s2ui-override.groovy:68)
at org.grails.cli.profile.commands.script.GroovyScriptCommand.handle(GroovyScriptCommand.groovy:156)
at org.grails.cli.profile.AbstractProfile.handleCommand(AbstractProfile.groovy:475)
at org.grails.cli.GrailsCli.handleCommand(GrailsCli.groovy:365)
at org.grails.cli.GrailsCli.handleCommand(GrailsCli.groovy:339)
at org.grails.cli.GrailsCli.execute(GrailsCli.groovy:277)
at org.grails.cli.GrailsCli.main(GrailsCli.groovy:169)
at org.apache.grails.cli.DelegatingShellApplication.main(DelegatingShellApplication.groovy:45)

| Error Command [s2ui-override] error: class path resource [classpath*:META-INF/templates/views/login/auth.gsp] cannot be opened because it does not exist`

### Steps To Reproduce

1. create Grails 7 app with plugins spring security and spring security UI
2. Use this command to generate login GSP
grails s2ui-override auth

### Environment Information

java=21.0.9-zulu
gradle=8.14.3
groovy=4.0.29
grails=7.0.2

### Example Application

https://github.com/arjangch/grails-project-helper/tree/main/example3

### Version

grails 7

Contributor guide

Open the contributing guide

Research direction

Start by reproducing `grails s2ui-override auth` in the linked example application and inspect the `s2ui-override.groovy` entry point from the stack trace. Check how it resolves `META-INF/templates/views/login/auth.gsp` and whether that resource is present in the Spring Security UI plugin. Done means the command completes and generates the login GSP without the missing-resource error.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy, spring
Domain
authentication, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.