title: Spring Boot CrudRepository Erasure Clash
body: <p>I have a need for a repository that simply persists records to the databases, so i wrote a custom generic base repository that extends <code>CrudRepository</code> but only implements the save method, as described <a href="https://stackoverflow.com/questions/11107136/creating-a-read-only-repository-with-springdata">here</a>.</p>
  
  <pre><code>@NoRepositoryBean
  public interface PersistingRepository&lt;T, ID extends Serializable&gt; extends CrudRepository&lt;T, ID&gt; {
     T save(T item);
  }
  </code></pre>
  
  <p>However, my compiler complains that "save(T) in 'PersistingRepository' clashes with 'save(S)' in 'org.springframework.data.repository.CrudRepository'; both method have the same erasure, yet neither overrides the other"</p>
  
  <p>Researching the problem led me to these SO posts: <a href="https://stackoverflow.com/questions/41431556/jparepository-and-crudrepository-error">this</a> and <a href="https://stackoverflow.com/questions/30459151/name-clash-even-though-im-not-using-both-interfaces">this</a>, which place the blame on dependency issues between <code>spring-data-commons</code> and <code>spring-data-jpa</code>. Updating my <code>spring-boot-starter-parent</code> version to <code>1.5.7.RELEASE</code> results in those dependencies being updated to the most recent RELEASE available on MavenCentral (commons: 1.13.7, jpa: 1.11.7), but the erasure class persists.</p>
  
  <p>So my question is how can this dependency conflict be resolved?</p>