Skip to content
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

App fails to start when it depends on thymeleaf-extras-springsecurity5 but does not have Spring Security on the classpath #28947

Closed
mdeinum opened this issue Dec 9, 2021 · 3 comments
Labels
status: superseded An issue that has been superseded by another type: bug A general bug

Comments

@mdeinum
Copy link
Contributor

mdeinum commented Dec 9, 2021

Currently the auto configuration of the SpringSecurityDialect is solely dependend on its own existence on the classpath, however if this was accidentily added without Spring Security the application fails to start.

There is now only an @ConditionalOnClass({ SpringSecurityDialect.class }) on the configuration class, it might be beneficial to add an additional check for Spring Security on there.

See https://stackoverflow.com/questions/70290743/how-to-temporary-disable-dependencies-in-spring-boots-pom-xml

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 9, 2021
@wilkinsona wilkinsona changed the title Make configuration of Thymeleaf SpringSecurityDialect dependend on Spring Security App fails to start when it depends on thymeleaf-extras-springsecurity5 but does not have Spring Security on the classpath Dec 9, 2021
@wilkinsona wilkinsona added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Dec 9, 2021
@wilkinsona wilkinsona added this to the 2.5.x milestone Dec 9, 2021
@wilkinsona
Copy link
Member

Thanks, @mdeinum. Somewhat surprisingly, the Spring Security dependencies are declared as provided in thymeleaf-extras-springsecurity5's pom even though they are required at runtime. Given that is the case, we should add a check for a Spring Security class too, backing off in its absence.

@terminux
Copy link
Contributor

Hi, I submitted a PR to fix this issue.#28967

@snicoll
Copy link
Member

snicoll commented Dec 10, 2021

Closing in favor of PR #28967

@snicoll snicoll closed this as completed Dec 10, 2021
@snicoll snicoll added the status: superseded An issue that has been superseded by another label Dec 10, 2021
@snicoll snicoll removed this from the 2.5.x milestone Dec 10, 2021
terminux added a commit to terminux/spring-boot that referenced this issue Dec 10, 2021
terminux added a commit to terminux/spring-boot that referenced this issue Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: superseded An issue that has been superseded by another type: bug A general bug
Projects
None yet
Development

No branches or pull requests

5 participants