Commit 86d87f6b authored by Andy Wilkinson's avatar Andy Wilkinson

Deprecate support for Velocity

Support for Velocity has been deprecated in Spring Framework 4.3 with
the plan being to remove it in 5.0. This commit deprecates Spring
Boot's support in 1.4, with the plan being to remove it in 2.0.

Closes gh-5276
parent ad53f09e
...@@ -55,11 +55,14 @@ import org.springframework.web.servlet.view.velocity.VelocityConfigurer; ...@@ -55,11 +55,14 @@ import org.springframework.web.servlet.view.velocity.VelocityConfigurer;
* @author Andy Wilkinson * @author Andy Wilkinson
* @author Brian Clozel * @author Brian Clozel
* @since 1.1.0 * @since 1.1.0
* @deprecated In 1.4.0 following the deprecation of Velocity support in Spring Framework
* 4.3
*/ */
@Configuration @Configuration
@ConditionalOnClass({ VelocityEngine.class, VelocityEngineFactory.class }) @ConditionalOnClass({ VelocityEngine.class, VelocityEngineFactory.class })
@AutoConfigureAfter(WebMvcAutoConfiguration.class) @AutoConfigureAfter(WebMvcAutoConfiguration.class)
@EnableConfigurationProperties(VelocityProperties.class) @EnableConfigurationProperties(VelocityProperties.class)
@Deprecated
public class VelocityAutoConfiguration { public class VelocityAutoConfiguration {
private static final Log logger = LogFactory.getLog(VelocityAutoConfiguration.class); private static final Log logger = LogFactory.getLog(VelocityAutoConfiguration.class);
...@@ -88,6 +91,7 @@ public class VelocityAutoConfiguration { ...@@ -88,6 +91,7 @@ public class VelocityAutoConfiguration {
} }
} }
@Deprecated
protected static class VelocityConfiguration { protected static class VelocityConfiguration {
@Autowired @Autowired
...@@ -107,6 +111,7 @@ public class VelocityAutoConfiguration { ...@@ -107,6 +111,7 @@ public class VelocityAutoConfiguration {
@Configuration @Configuration
@ConditionalOnNotWebApplication @ConditionalOnNotWebApplication
@Deprecated
public static class VelocityNonWebConfiguration extends VelocityConfiguration { public static class VelocityNonWebConfiguration extends VelocityConfiguration {
@Bean @Bean
...@@ -122,6 +127,7 @@ public class VelocityAutoConfiguration { ...@@ -122,6 +127,7 @@ public class VelocityAutoConfiguration {
@Configuration @Configuration
@ConditionalOnClass(Servlet.class) @ConditionalOnClass(Servlet.class)
@ConditionalOnWebApplication @ConditionalOnWebApplication
@Deprecated
public static class VelocityWebConfiguration extends VelocityConfiguration { public static class VelocityWebConfiguration extends VelocityConfiguration {
@Bean @Bean
......
...@@ -28,7 +28,10 @@ import org.springframework.web.servlet.view.velocity.VelocityViewResolver; ...@@ -28,7 +28,10 @@ import org.springframework.web.servlet.view.velocity.VelocityViewResolver;
* *
* @author Andy Wilkinson * @author Andy Wilkinson
* @since 1.1.0 * @since 1.1.0
* @deprecated In 1.4.0 following the deprecation of Velocity support in Spring Framework
* 4.3
*/ */
@Deprecated
@ConfigurationProperties(prefix = "spring.velocity") @ConfigurationProperties(prefix = "spring.velocity")
public class VelocityProperties extends AbstractTemplateViewResolverProperties { public class VelocityProperties extends AbstractTemplateViewResolverProperties {
......
...@@ -29,7 +29,10 @@ import org.springframework.util.ClassUtils; ...@@ -29,7 +29,10 @@ import org.springframework.util.ClassUtils;
* *
* @author Andy Wilkinson * @author Andy Wilkinson
* @since 1.1.0 * @since 1.1.0
* @deprecated In 1.4.0 following the deprecation of Velocity support in Spring Framework
* 4.3
*/ */
@Deprecated
public class VelocityTemplateAvailabilityProvider public class VelocityTemplateAvailabilityProvider
implements TemplateAvailabilityProvider { implements TemplateAvailabilityProvider {
......
...@@ -45,7 +45,9 @@ import static org.mockito.BDDMockito.given; ...@@ -45,7 +45,9 @@ import static org.mockito.BDDMockito.given;
* *
* @author Andy Wilkinson * @author Andy Wilkinson
* @author Stephane Nicoll * @author Stephane Nicoll
*
*/ */
@SuppressWarnings("deprecation")
@RunWith(MockitoJUnitRunner.class) @RunWith(MockitoJUnitRunner.class)
public class EnableAutoConfigurationImportSelectorTests { public class EnableAutoConfigurationImportSelectorTests {
......
...@@ -54,6 +54,7 @@ import static org.hamcrest.Matchers.containsString; ...@@ -54,6 +54,7 @@ import static org.hamcrest.Matchers.containsString;
* @author Andy Wilkinson * @author Andy Wilkinson
* @author Stephane Nicoll * @author Stephane Nicoll
*/ */
@SuppressWarnings("deprecation")
public class VelocityAutoConfigurationTests { public class VelocityAutoConfigurationTests {
@Rule @Rule
......
...@@ -30,6 +30,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -30,6 +30,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* *
* @author Andy Wilkinson * @author Andy Wilkinson
*/ */
@SuppressWarnings("deprecation")
public class VelocityTemplateAvailabilityProviderTests { public class VelocityTemplateAvailabilityProviderTests {
private final TemplateAvailabilityProvider provider = new VelocityTemplateAvailabilityProvider(); private final TemplateAvailabilityProvider provider = new VelocityTemplateAvailabilityProvider();
......
...@@ -1577,7 +1577,7 @@ Spring Boot includes auto-configuration support for the following templating eng ...@@ -1577,7 +1577,7 @@ Spring Boot includes auto-configuration support for the following templating eng
* http://freemarker.org/docs/[FreeMarker] * http://freemarker.org/docs/[FreeMarker]
* http://docs.groovy-lang.org/docs/next/html/documentation/template-engines.html#_the_markuptemplateengine[Groovy] * http://docs.groovy-lang.org/docs/next/html/documentation/template-engines.html#_the_markuptemplateengine[Groovy]
* http://www.thymeleaf.org[Thymeleaf] * http://www.thymeleaf.org[Thymeleaf]
* http://velocity.apache.org[Velocity] * http://velocity.apache.org[Velocity] (deprecated in 1.4)
* http://mustache.github.io/[Mustache] * http://mustache.github.io/[Mustache]
TIP: JSPs should be avoided if possible, there are several TIP: JSPs should be avoided if possible, there are several
......
...@@ -482,7 +482,7 @@ and Hibernate. ...@@ -482,7 +482,7 @@ and Hibernate.
|Support for the Thymeleaf templating engine, including integration with Spring. |Support for the Thymeleaf templating engine, including integration with Spring.
|`spring-boot-starter-velocity` |`spring-boot-starter-velocity`
|Support for the Velocity templating engine. |Support for the Velocity templating engine. Deprecated in 1.4.
|`spring-boot-starter-web` |`spring-boot-starter-web`
|Support for full-stack web development, including Tomcat and `spring-webmvc`. |Support for full-stack web development, including Tomcat and `spring-webmvc`.
......
...@@ -30,6 +30,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; ...@@ -30,6 +30,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.ui.velocity.VelocityEngineUtils; import org.springframework.ui.velocity.VelocityEngineUtils;
@SpringBootApplication @SpringBootApplication
@Deprecated
public class SampleVelocityApplication implements CommandLineRunner { public class SampleVelocityApplication implements CommandLineRunner {
@Value("${application.message}") @Value("${application.message}")
......
...@@ -33,6 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -33,6 +33,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/ */
@RunWith(SpringJUnit4ClassRunner.class) @RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(SampleVelocityApplication.class) @SpringApplicationConfiguration(SampleVelocityApplication.class)
@SuppressWarnings("deprecation")
public class SampleVelocityApplicationTests { public class SampleVelocityApplicationTests {
@ClassRule @ClassRule
......
...@@ -26,7 +26,10 @@ import org.springframework.web.servlet.view.velocity.VelocityViewResolver; ...@@ -26,7 +26,10 @@ import org.springframework.web.servlet.view.velocity.VelocityViewResolver;
* *
* @author Phillip Webb * @author Phillip Webb
* @since 1.2.5 * @since 1.2.5
* @deprecated In 1.4.0 following the deprecation of Velocity support in Spring Framework
* 4.3
*/ */
@Deprecated
public class EmbeddedVelocityViewResolver extends VelocityViewResolver { public class EmbeddedVelocityViewResolver extends VelocityViewResolver {
private String toolboxConfigLocation; private String toolboxConfigLocation;
......
...@@ -40,6 +40,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -40,6 +40,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* *
* @author Phillip Webb * @author Phillip Webb
*/ */
@SuppressWarnings("deprecation")
public class EmbeddedVelocityToolboxViewTests { public class EmbeddedVelocityToolboxViewTests {
private static final String PATH = EmbeddedVelocityToolboxViewTests.class.getPackage() private static final String PATH = EmbeddedVelocityToolboxViewTests.class.getPackage()
......
...@@ -34,6 +34,7 @@ import static org.assertj.core.api.Assertions.assertThat; ...@@ -34,6 +34,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* *
* @author Phillip Webb * @author Phillip Webb
*/ */
@SuppressWarnings("deprecation")
public class EmbeddedVelocityViewResolverTests { public class EmbeddedVelocityViewResolverTests {
@Test @Test
......
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