Commit f21151e5 authored by Andy Wilkinson's avatar Andy Wilkinson

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
parent 4999d411
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment