Skip to content

Commit

Permalink
Deprecate support for Velocity
Browse files Browse the repository at this point in the history
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 spring-projectsgh-5276
  • Loading branch information
wilkinsona committed Mar 7, 2016
1 parent ad53f09 commit 86d87f6
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,14 @@
* @author Andy Wilkinson
* @author Brian Clozel
* @since 1.1.0
* @deprecated In 1.4.0 following the deprecation of Velocity support in Spring Framework
* 4.3
*/
@Configuration
@ConditionalOnClass({ VelocityEngine.class, VelocityEngineFactory.class })
@AutoConfigureAfter(WebMvcAutoConfiguration.class)
@EnableConfigurationProperties(VelocityProperties.class)
@Deprecated
public class VelocityAutoConfiguration {

private static final Log logger = LogFactory.getLog(VelocityAutoConfiguration.class);
Expand Down Expand Up @@ -88,6 +91,7 @@ public void checkTemplateLocationExists() {
}
}

@Deprecated
protected static class VelocityConfiguration {

@Autowired
Expand All @@ -107,6 +111,7 @@ protected void applyProperties(VelocityEngineFactory factory) {

@Configuration
@ConditionalOnNotWebApplication
@Deprecated
public static class VelocityNonWebConfiguration extends VelocityConfiguration {

@Bean
Expand All @@ -122,6 +127,7 @@ public VelocityEngineFactoryBean velocityConfiguration() {
@Configuration
@ConditionalOnClass(Servlet.class)
@ConditionalOnWebApplication
@Deprecated
public static class VelocityWebConfiguration extends VelocityConfiguration {

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
*
* @author Andy Wilkinson
* @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")
public class VelocityProperties extends AbstractTemplateViewResolverProperties {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
*
* @author Andy Wilkinson
* @since 1.1.0
* @deprecated In 1.4.0 following the deprecation of Velocity support in Spring Framework
* 4.3
*/
@Deprecated
public class VelocityTemplateAvailabilityProvider
implements TemplateAvailabilityProvider {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@
*
* @author Andy Wilkinson
* @author Stephane Nicoll
*
*/
@SuppressWarnings("deprecation")
@RunWith(MockitoJUnitRunner.class)
public class EnableAutoConfigurationImportSelectorTests {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
* @author Andy Wilkinson
* @author Stephane Nicoll
*/
@SuppressWarnings("deprecation")
public class VelocityAutoConfigurationTests {

@Rule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
*
* @author Andy Wilkinson
*/
@SuppressWarnings("deprecation")
public class VelocityTemplateAvailabilityProviderTests {

private final TemplateAvailabilityProvider provider = new VelocityTemplateAvailabilityProvider();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1577,7 +1577,7 @@ Spring Boot includes auto-configuration support for the following templating eng
* http://freemarker.org/docs/[FreeMarker]
* http://docs.groovy-lang.org/docs/next/html/documentation/template-engines.html#_the_markuptemplateengine[Groovy]
* http://www.thymeleaf.org[Thymeleaf]
* http://velocity.apache.org[Velocity]
* http://velocity.apache.org[Velocity] (deprecated in 1.4)
* http://mustache.github.io/[Mustache]

TIP: JSPs should be avoided if possible, there are several
Expand Down
2 changes: 1 addition & 1 deletion spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ and Hibernate.
|Support for the Thymeleaf templating engine, including integration with Spring.

|`spring-boot-starter-velocity`
|Support for the Velocity templating engine.
|Support for the Velocity templating engine. Deprecated in 1.4.

|`spring-boot-starter-web`
|Support for full-stack web development, including Tomcat and `spring-webmvc`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.springframework.ui.velocity.VelocityEngineUtils;

@SpringBootApplication
@Deprecated
public class SampleVelocityApplication implements CommandLineRunner {

@Value("${application.message}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
*/
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(SampleVelocityApplication.class)
@SuppressWarnings("deprecation")
public class SampleVelocityApplicationTests {

@ClassRule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
*
* @author Phillip Webb
* @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 {

private String toolboxConfigLocation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
*
* @author Phillip Webb
*/
@SuppressWarnings("deprecation")
public class EmbeddedVelocityToolboxViewTests {

private static final String PATH = EmbeddedVelocityToolboxViewTests.class.getPackage()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
*
* @author Phillip Webb
*/
@SuppressWarnings("deprecation")
public class EmbeddedVelocityViewResolverTests {

@Test
Expand Down

0 comments on commit 86d87f6

Please sign in to comment.