Reputation: 7894
Does ehcache 3.8.1 no longer automatically pick up the configuration settings in an ehcache.xml file at the source root directory?
Upvotes: 3
Views: 3285
Reputation: 1523
Yes, it's looks so, now it needs to be done using a XML file by configuringe a CacheManager at creation time, according to this schema definition.
XML programmatic parsing
If you are obtaining your CacheManager through the JSR-107 API, what follows is done automatically when invoking
javax.cache.spi.CachingProvider.getCacheManager(java.net.URI, java.lang.ClassLoader)
final URL myUrl = getClass().getResource("/configs/docs/getting-started.xml");
XmlConfiguration xmlConfig = new XmlConfiguration(myUrl);
CacheManager myCacheManager = CacheManagerBuilder.newCacheManager(xmlConfig);
myCacheManager.init();
org.ehcache.config.builders.CacheManagerBuilder.newCacheManager(org.ehcache.config.Configuration)
allows you to create your CacheManager instance using the Configuration from the XmlConfiguration
Reference - http://www.ehcache.org/documentation/3.8/xml.html
Upvotes: 4