Skip to content

Conversation

@chrylis
Copy link
Contributor

@chrylis chrylis commented Aug 24, 2022

The FreeMarkerAutoConfiguration logs a warning about missing templates even if the entire auto-configuration class is disabled via properties. I am using FreeMarker internally for non-Web reasons, but its presence triggers spurious warnings from the auto-configuration even after adding spring.freemarker.enabled: false.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 24, 2022
@philwebb
Copy link
Member

The spring.freemarker.enabled property is somewhat poorly named. It's actually documented as "Whether to enable MVC view resolution for this technology".

I don't think we can apply the fix that you suggest because we have FreeMarkerNonWebConfiguration which will apply even if spring.freemarker.enabled is false and calls factory.setTemplateLoaderPaths(this.properties.getTemplateLoaderPath()); (via AbstractFreeMarkerConfiguration).

Setting spring.freemarker.check-template-location to false should stop the warning.

@philwebb philwebb closed this Aug 25, 2022
@philwebb philwebb added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 25, 2022
@chrylis
Copy link
Contributor Author

chrylis commented Aug 25, 2022

This behavior conflicts with general behavior of other enabled properties, which is to shut off the relevant auto-configuration bean registrations entirely. I'm aware that this is a backward-compatibility issue, but I suggest that for Boot 3 the property spring.freemarker.enabled should actually prevent Boot from registering any beans related to FreeMarker; as it is, I'd have to actively exclude the base auto-configuration class itself.

@philwebb philwebb added the for: team-meeting An issue we'd like to discuss as a team to make progress label Aug 25, 2022
@bclozel bclozel removed the for: team-meeting An issue we'd like to discuss as a team to make progress label Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: declined A suggestion or change that we don't feel we should currently apply

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants