1

How can I download mybatis-spring by using gradle? Because I got message below message when I use "gradle eclipse". "Could not resolve all dependencies for configuration ':classpath'. > Could not find org.mybatis:mybatis-spring:1.2.2."

This is my build.gradle file.

buildscript {
    repositories {
        mavenLocal()
    }
    dependencies {
        classpath("org.mybatis:mybatis-spring:1.2.2")
    }
}

apply plugin: 'java'
apply plugin: 'eclipse'


jar {
    baseName = 'mylib'
    version =  '0.1.0'
}

repositories {
    mavenCentral()
}

repositories {
    mavenCentral()
}

dependencies {
    compile("org.mybatis:mybatis-spring:1.2.2")
    testCompile("junit:junit:4.11")
}

task wrapper(type: Wrapper) {
    gradleVersion = '1.8'
}
jalopaba
  • 8,039
  • 2
  • 44
  • 57
Roger Chan
  • 1,293
  • 2
  • 11
  • 24

1 Answers1

0

I bet that you will fix it using mavenCentral() instead of mavenLocal() inside your buildscript section. You probably don't have the dependency in your local maven repo.

Just as a reminder (it is a bit strange you need mybatis-spring dependency for the script itself), buildscript dependencies are for the script itself (See 59.5. External dependencies for the build script section in gradle's manual, or Gradle buildscript dependencies).

Community
  • 1
  • 1
jalopaba
  • 8,039
  • 2
  • 44
  • 57