Dont’t auto-configure FreeMarker and Velocity without context-support
Boot’s auto-configuration for FreeMarker and Velocity relies on Spring’s support for them that’s packaged in spring-context-support. Only auto-configure them if their respective Spring classes are on the classpath Fixes #940
This commit is contained in:
@@ -44,13 +44,14 @@ import org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver;
|
||||
|
||||
/**
|
||||
* {@link EnableAutoConfiguration Auto-configuration} for FreeMarker.
|
||||
*
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
* @author Dave Syer
|
||||
* @since 1.1.0
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnClass(freemarker.template.Configuration.class)
|
||||
@ConditionalOnClass({ freemarker.template.Configuration.class,
|
||||
FreeMarkerConfigurationFactory.class })
|
||||
@AutoConfigureAfter(WebMvcAutoConfiguration.class)
|
||||
@EnableConfigurationProperties(FreeMarkerProperties.class)
|
||||
public class FreeMarkerAutoConfiguration {
|
||||
|
||||
@@ -47,12 +47,12 @@ import org.springframework.web.servlet.view.velocity.VelocityViewResolver;
|
||||
|
||||
/**
|
||||
* {@link EnableAutoConfiguration Auto-configuration} for Velocity.
|
||||
*
|
||||
*
|
||||
* @author Andy Wilkinson
|
||||
* @since 1.1.0
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnClass(VelocityEngine.class)
|
||||
@ConditionalOnClass({ VelocityEngine.class, VelocityEngineFactory.class })
|
||||
@AutoConfigureAfter(WebMvcAutoConfiguration.class)
|
||||
@EnableConfigurationProperties(VelocityProperties.class)
|
||||
public class VelocityAutoConfiguration {
|
||||
|
||||
Reference in New Issue
Block a user