Add missing classpath checks

Certain cache manager implementations are located in the
spring-context-support module that isn't pulled automatically.

As a result, the related cache auto-configurations should make sure that
the relevant CacheManager implementation is available.

See gh-2633
pull/2757/head
Stephane Nicoll 10 years ago
parent 9f1475d708
commit 3b99ba9d61

@ -40,7 +40,7 @@ import com.google.common.cache.CacheLoader;
* @since 1.3.0 * @since 1.3.0
*/ */
@Configuration @Configuration
@ConditionalOnClass(CacheBuilder.class) @ConditionalOnClass({CacheBuilder.class,GuavaCacheManager.class})
@ConditionalOnMissingBean(CacheManager.class) @ConditionalOnMissingBean(CacheManager.class)
@Conditional(CacheCondition.class) @Conditional(CacheCondition.class)
class GuavaCacheConfiguration { class GuavaCacheConfiguration {

@ -18,7 +18,6 @@ package org.springframework.boot.autoconfigure.cache;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import javax.cache.CacheManager; import javax.cache.CacheManager;
import javax.cache.Caching; import javax.cache.Caching;
import javax.cache.configuration.MutableConfiguration; import javax.cache.configuration.MutableConfiguration;
@ -49,7 +48,7 @@ import org.springframework.util.StringUtils;
* @since 1.3.0 * @since 1.3.0
*/ */
@Configuration @Configuration
@ConditionalOnClass(Caching.class) @ConditionalOnClass({Caching.class, JCacheCacheManager.class})
@ConditionalOnMissingBean(org.springframework.cache.CacheManager.class) @ConditionalOnMissingBean(org.springframework.cache.CacheManager.class)
@Conditional({ CacheCondition.class, @Conditional({ CacheCondition.class,
JCacheCacheConfiguration.JCacheAvailableCondition.class }) JCacheCacheConfiguration.JCacheAvailableCondition.class })

Loading…
Cancel
Save