-
Notifications
You must be signed in to change notification settings - Fork 40.4k
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
ThymeleafAutoConfiguration fails if thymeleaf-spring5 is not present #16079
Comments
I will work there |
Great! Thank you. Please let us know if you have any questions. |
oh i am late again :( i will be here next time! :) |
@kandebouya checking in to see if there is anything we can do to help. Please let us know. |
@kandebouya we haven't heard back from you and are available if you need help. If we don't hear from you by the end of the week, we'll let someone else have a crack at it. Thanks! |
@snicoll I can work on it if @kandebouya is not available |
Thanks @koziolk, you're third. @oguzyildirim is next if we don't hear from @kandebouya |
I will be 4th :) |
@snicoll If this issue is done (was trying to see if I can really do it or not and well luckily, I did), should we still wait for the turn or can we submit the PR? |
@dosdebug as you've indicated yourself, you are 4th so pushing the solution without giving a chance to others to try doesn't seem fair. Once the issue is done you can check if it matches your solution. |
@kandebouya we haven't heard from you for two weeks so I suggest that @oguzyildirim takes over now. @oguzyildirim, can you please confirm your interest? |
I'd love to take it up please let me know if my turn's up. |
In the interest of getting this fixed this week as we are releasing |
@snicoll Yes, I'm available. Will start working on this Today. |
Interested to work here. |
@koziolk how is it going? Reminder that we're releasing soon and I'd like to get that change in. |
@snicoll Good. I'm going to submit a pull request Today. |
This commit adds an extra check for the presence of thymeleaf-spring5 library on the classpath. Since now ThymeleafAutoConfiguration is considered only if both thymeleaf-spring5 and thymeleaf jars are present. spring-projectsgh-16079
@snicoll I've implemented a solution based on what @kazuki43zoo suggested in his comment. |
Closing in favour of PR #16341 |
Hi, this is a
first-timers-only
issue. This means we've worked to make it more legible to folks who either haven't contributed to our codebase before, or even folks who haven't contributed to open source before.If that's you, we're interested in helping you take the first step and can answer questions and help you out as you do. Note that we're especially interested in contributions from people from groups underrepresented in free and open source software!
If you have contributed before, consider leaving this one for someone new, and looking through our general
ideal-for-contribution
issues. Thanks!Background
Auto-configurations declare conditions to make sure that they back-off when conditions aren't met. For instance,
@ConditionalOnClass
allows to refer to classes that must be present on the classpath for an auto-configuration to be considered. Spring Boot will parse the bytecode using ASM to identify those classes and skip the auto-configuration altogether if one of them is not present.Problem
The thymeleaf auto-configuration support relies on the Spring integration module provided by the Thymeleaf project (currently
thymeleaf-spring5
). Unfortunately,ThymeleafAutoConfiguration
only checks for a class in the core thymelaf jar (thymeleaf
): if the core jar is present but the integration one isn't, the auto-configuration will be considered and fail:Solution
The conditions on
ThymeleafAutoConfiguration
should be refined so that we don't process it ifthymeleaf-spring5
is not on the classpath. A good solution for this is to extend@ConditionalOnClass
to also checks for the presence ofSpringTemplateEngine
.Steps to Fix
The text was updated successfully, but these errors were encountered: