From 77455ec3dc3c649e2ce68d9e8761c2b1cadf15e5 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Mon, 5 Aug 2013 13:46:53 -0700 Subject: [PATCH] Fix CLI test failures --- spring-boot-cli/pom.xml | 24 +++++++++++++++++++ .../compiler/ExtendedGroovyClassLoader.java | 1 + ...urationPropertiesBindingPostProcessor.java | 4 +++- 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/spring-boot-cli/pom.xml b/spring-boot-cli/pom.xml index 211a709360..9abf220005 100644 --- a/spring-boot-cli/pom.xml +++ b/spring-boot-cli/pom.xml @@ -41,6 +41,30 @@ ${project.version} tests test + + + org.springframework + spring-core + + + org.springframework + spring-context + + + + + org.springframework + spring-test + + + org.springframework + spring-core + + + org.springframework + spring-context + + org.javassist diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/ExtendedGroovyClassLoader.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/ExtendedGroovyClassLoader.java index 803d7e4e98..b0435de5eb 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/ExtendedGroovyClassLoader.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/ExtendedGroovyClassLoader.java @@ -40,6 +40,7 @@ import org.codehaus.groovy.control.SourceUnit; class ExtendedGroovyClassLoader extends GroovyClassLoader { private Map classResources = new HashMap(); + private CompilerConfiguration configuration; public ExtendedGroovyClassLoader(ClassLoader loader, CompilerConfiguration config) { diff --git a/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java b/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java index c6ce051d0c..c3c7820601 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java @@ -148,7 +148,9 @@ public class ConfigurationPropertiesBindingPostProcessor implements BeanPostProc this.validator = getOptionalBean(VALIDATOR_BEAN_NAME, Validator.class); if (this.validator == null && ClassUtils.isPresent(VALIDATOR_CLASS, this.beanClassLoader)) { - LocalValidatorFactoryBean validatorToUse = new LocalValidatorFactoryBean(); + LocalValidatorFactoryBean validatorToUse = (LocalValidatorFactoryBean) ClassUtils + .forName(LocalValidatorFactoryBean.class.getName(), + this.beanClassLoader).newInstance(); validatorToUse.setApplicationContext(this.applicationContext); validatorToUse.afterPropertiesSet(); this.validator = validatorToUse;