title: Gradle : Doesnt resolve Spring dependency from Maven Repository
body: <p>I am trying to setup a new Java project using Gradle as the build tool. For this post, lets assume that the project needs to use Hibernate <code>[hibernate-core]</code> and Spring <code>[spring-core]</code>.</p>
  
  <p>build.gradle</p>
  
  <pre><code>def localMavenRepo = "file://opt/m2/repository"
  
  allprojects {
      apply plugin: "java"
  
      repositories {
          maven {
             url localMavenRepo
          }
      }
  
      dependencies {
          compile     "org.hibernate:hibernate-core:3.5.0-CR-2"
          compile     "org.springframework:spring-core:3.0.5-RELEASE"
      }
  }
  </code></pre>
  
  <p>When I run <code>gradle-build</code> I get the following:</p>
  
  <blockquote>
    <p>FAILURE: Build failed with an exception.</p>
    
    <ul>
    <li><p>What went wrong: </p>
    
    <p>Could not resolve all dependencies for configuration ':testRuntime'.</p>
    
    <p>Could not find group:org.springframework, module:spring-core, version:3.0.5-RELEASE.   </p>
    
    <p>Required by:
      :gradle_spring_bug:unspecified</p></li>
    </ul>
  </blockquote>
  
  <p>The puzzling part is that it finds the <code>hibernate-core</code> artifact in the repository but not the <code>spring-core</code> one. </p>
  
  <p>I am thinking that perhaps the Spring jar itself is to blame. </p>
  
  <p>Here is what I have tried so far:</p>
  
  <ol>
  <li><p>Change the Maven repository. I am at work at the moment and we using a Maven Proxy repository. I have tried both local and remote repositories. Problem still exists.</p></li>
  <li><p>Change the Spring version. I have tried different versions of the <code>spring-core</code> dependency (<code>3.0.1-RELEASE, 3.0.3-RELEASE</code>). Problem still exists.</p></li>
  <li><p>Change the Spring artifact. I have tried the <code>org.springframework.spring-jdbc</code> and <code>org.springframework.security.spring-security-cas-client</code> artifacts as well. Problem still exists.</p></li>
  <li><p>Verify that it is Spring by trying different artifacts. I have tried 'junit', 'hibernate-core', 'hibernate-validator', 'javaee-web-api'. Some with different versions. Pointing them to either local or remote repositories and they all work.</p></li>
  </ol>
  
  <p>What I haven't tried yet:</p>
  
  <ol>
  <li><p>Change the version of Gradle
  I am using the latest version of Gradle <code>1.0-rc-3</code></p></li>
  <li><p>Try the Maven central repo
  Need to configure my proxy but that's my next step. However, I am not too optimistic that it will work.</p></li>
  </ol>
  
  <p>Would be great if somebody with the latest version of Gradle could try it out and let me know if they are experiencing the same issue. </p>
  
  <p>EDIT</p>
  
  <p>SOLVED : Double check version declaration. Spring 3.0.5-RELEASE doesn't exist. It's 3.0.5.RELEASE.</p>
  
  <p>P.S - Don't have enough points to answer my own question within less than 8 hours. </p>