title: Incompatible Spring dependencies (NoSuchMethodError when AnnotationRepositoryConfigurationSource constructor is called)
body: <p>I can't start my Spring Boot application anymore after adding persistence. The error is:</p>
  
  <pre><code>java.lang.NoSuchMethodError: org.springframework.data.repository.config.AnnotationRepositoryConfigurationSource.&lt;init&gt;(Lorg/springframework/core/type/AnnotationMetadata;Ljava/lang/Class;Lorg/springframework/core/io/ResourceLoader;Lorg/springframework/core/env/Environment;Lorg/springframework/beans/factory/support/BeanDefinitionRegistry;)V
  at org.springframework.boot.autoconfigure.data.AbstractRepositoryConfigurationSourceSupport$1.&lt;init&gt;(AbstractRepositoryConfigurationSourceSupport.java:68) ~[spring-boot-autoconfigure-1.5.7.RELEASE.jar:1.5.7.RELEASE]
  </code></pre>
  
  <p>I tracked this down to the changes in <em>spring-data-commons</em> where <em>AnnotationRepositoryConfigurationSource</em> resides and an additional constructor argument was added in version 1.13.5, and version 1.13.7 with the same constructor signature should be used by <em>spring-boot-starter-data-jpa</em> in version 1.5.7. And we only use Spring Boot dependencies with version number 1.5.7.</p>
  
  <p>So then I built the dependency tree and strangely found <em>spring-data-commons</em> in version 1.13.4, not 1.13.7 (third to last line):</p>
  
  <pre><code>...(snippet)
  [INFO] +- com.name.project:project-subproject8:jar:1.0.0-SNAPSHOT:compile
  [INFO] |  \- org.springframework.boot:spring-boot-starter-data-jpa:jar:1.5.7.RELEASE:compile
  [INFO] |     +- org.springframework.boot:spring-boot-starter-jdbc:jar:1.5.4.RELEASE:compile
  [INFO] |     |  +- org.apache.tomcat:tomcat-jdbc:jar:8.5.15:compile
  [INFO] |     |  |  \- org.apache.tomcat:tomcat-juli:jar:8.5.15:compile
  [INFO] |     |  \- org.springframework:spring-jdbc:jar:4.3.9.RELEASE:compile
  [INFO] |     +- org.hibernate:hibernate-core:jar:5.0.12.Final:compile
  [INFO] |     |  +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
  [INFO] |     |  +- antlr:antlr:jar:2.7.7:compile
  [INFO] |     |  +- org.jboss:jandex:jar:2.0.0.Final:compile
  [INFO] |     |  +- dom4j:dom4j:jar:1.6.1:compile
  [INFO] |     |  \- org.hibernate.common:hibernate-commons-annotations:jar:5.0.1.Final:compile
  [INFO] |     +- org.hibernate:hibernate-entitymanager:jar:5.0.12.Final:compile
  [INFO] |     +- javax.transaction:javax.transaction-api:jar:1.2:compile
  [INFO] |     +- org.springframework.data:spring-data-jpa:jar:1.11.4.RELEASE:compile
  [INFO] |     |  +- org.springframework.data:spring-data-commons:jar:1.13.4.RELEASE:compile
  [INFO] |     |  \- org.springframework:spring-orm:jar:4.3.9.RELEASE:compile
  [INFO] |     \- org.springframework:spring-aspects:jar:4.3.9.RELEASE:compile
  ...
  </code></pre>
  
  <p>Going up the tree you can see that <em>spring-data-jpa</em> is included in version 1.11.4, whereas, according to <a href="https://docs.spring.io/spring-boot/docs/1.5.7.RELEASE/reference/html/appendix-dependency-versions.html" rel="nofollow noreferrer">Spring Boot Dependency Appendix</a>, it should be version 1.11.7. This seems to cause the error. But we don't depend on <em>spring-data-jpa</em> directly via our pom files.</p>
  
  <p>So I don't know how this older version got into the dependency tree.
  The pom of <em>spring-boot-starter-data-jpa</em> doesn't indicate any version numbers.</p>