Commit ef7390d3 authored by Dave Syer's avatar Dave Syer

Add extra @Conditional to be defensive in Social autoconfig

Older versions of Spring Social will not have the SocialConfigurerAdapter
so making social autoconfig conditional on that class makes sense (since it
all extends from it).

Fixes gh-986
parent 5557061b
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
package org.springframework.boot.autoconfigure.social; package org.springframework.boot.autoconfigure.social;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.bind.RelaxedPropertyResolver; import org.springframework.boot.bind.RelaxedPropertyResolver;
import org.springframework.context.EnvironmentAware; import org.springframework.context.EnvironmentAware;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
...@@ -30,6 +31,7 @@ import org.springframework.social.connect.ConnectionFactory; ...@@ -30,6 +31,7 @@ import org.springframework.social.connect.ConnectionFactory;
* @author Craig Walls * @author Craig Walls
* @since 1.1.0 * @since 1.1.0
*/ */
@ConditionalOnClass(SocialConfigurerAdapter.class)
abstract class SocialAutoConfigurerAdapter extends SocialConfigurerAdapter implements abstract class SocialAutoConfigurerAdapter extends SocialConfigurerAdapter implements
EnvironmentAware { EnvironmentAware {
......
...@@ -42,7 +42,7 @@ import org.springframework.web.servlet.view.BeanNameViewResolver; ...@@ -42,7 +42,7 @@ import org.springframework.web.servlet.view.BeanNameViewResolver;
* @since 1.1.0 * @since 1.1.0
*/ */
@Configuration @Configuration
@ConditionalOnClass({ ConnectController.class }) @ConditionalOnClass({ ConnectController.class, SocialConfigurerAdapter.class })
@AutoConfigureAfter(WebMvcAutoConfiguration.class) @AutoConfigureAfter(WebMvcAutoConfiguration.class)
public class SocialWebAutoConfiguration { public class SocialWebAutoConfiguration {
......
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