Gradle无法检索本地存储库

时间:2016-06-16 18:43:18

标签: gradle

我的build.gradle文件中有以下设置

repositories {
    mavenCentral()
    mavenLocal()
    maven {
        url '/Users/me/.m2/repository'
    }

目录下的库未导入我的项目。我用Maven创建了另一个项目,并导入了库。 gradle设置中缺少什么?

这是文件:

buildscript {
ext {
    springBootVersion = '1.3.5.RELEASE'
}
repositories {
    mavenCentral()
    mavenLocal()
    maven {
        url '/Users/vewu/.m2/repository'
    }
}
dependencies {
    classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") 
}
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'spring-boot' 

jar {
  baseName = 'sample'
  version = '0.0.1-SNAPSHOT'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
  mavenCentral()
  mavenLocal()  // <-- I need to add this one
}


dependencies {
  compile('org.springframework.cloud:spring-cloud-starter-stream-kafka')
  compile('org.springframework.boot:spring-boot-starter-integration')
  compile 'mylibrary:mypackage:1.3.18'
  testCompile('org.springframework.boot:spring-boot-starter-test') 
}

  dependencyManagement {
  imports { 
    mavenBom "org.springframework.cloud:spring-cloud-dependencies:Brixton.RELEASE" 
  }
}


  eclipse {
  classpath {
     containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER')
     containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8'
  }
}

我只是认识到我还需要在buildscript之外的存储库块中添加mavenLocal()。

0 个答案:

没有答案
相关问题