title: How can I configure Ehcache 3 + spring boot + java config without xml?
body: <p>I use <code>Ehcache 2 + spring boot</code>. Here is my config:</p>
  
  <pre><code>@Bean
  public CacheManager cacheManager() {
      return new EhCacheCacheManager(ehCacheCacheManager().getObject());
  }
  
  @Bean
  public EhCacheManagerFactoryBean ehCacheCacheManager() {
      EhCacheManagerFactoryBean cmfb = new EhCacheManagerFactoryBean();
      cmfb.setConfigLocation(new ClassPathResource("ehcache.xml"));
      cmfb.setShared(true);
      return cmfb;
  }
  
  ehcache.xml - in resources.
  </code></pre>
  
  <p>Now I want to use <code>Ehcache 3 + spring boot</code> and <strong>Java config</strong> instead <strong>xml</strong> but I haven't found any example for this. My questions:</p>
  
  <p>1) <em>Why almost all examples are based on <strong>xml</strong>? How can this be better than <strong>java config</strong>?</em></p>
  
  <p>2) <em>How can I configure <strong>Ehcache 3</strong> using <strong>java config</strong> in <strong>spring boot</strong> without using <strong>xml</strong>?</em></p>