Gradle无法检索本地存储库

Gradle无法检索本地存储库,gradle,Gradle,我的build.gradle文件中有以下设置 repositories { mavenCentral() mavenLocal() maven { url '/Users/me/.m2/repository' } 目录下的库未导入到我的项目中。我用Maven创建了另一个项目,并导入了库。gradle设置中缺少什么 文件如下: buildscript { ext { springBootVersion = '1.3.5.RELEASE' }

我的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{
分机{
springBootVersion='1.3.5.RELEASE'
}
存储库{
mavenCentral()
mavenLocal()
马文{
url'/Users/vewu/.m2/repository'
}
}
依赖关系{
类路径(“org.springframework.boot:spring-boot-gradle插件:${springBootVersion}”)
}
}
应用插件:“java”
应用插件:“eclipse”
应用插件:“spring boot”
罐子{
baseName='sample'
版本='0.0.1-SNAPSHOT'
}
sourceCompatibility=1.8
targetCompatibility=1.8
存储库{
mavenCentral()

mavenLocal()//难道“/Users/me”不应该是您的主目录吗?如果是的话,这正是“mavenLocal()”所关注的。您至少声明了一些依赖项吗?继续这个主题,如何显示您的整个构建脚本,以及您所看到的错误,以及您所期望看到的?@DavidM.Karr Yes,“/Users/me”是我的主目录。我使用Mac ProBook。我不明白“mavenLocal()”看什么。我在问题中指出的问题是,依赖项不在项目库中。我将很快发布整个gradle生成文件。@AdamSkywalker当然,我在生成文件中声明依赖项。不是“/Users/me”应该是您的主目录吗?如果是,这正是“mavenLocal()”所关注的。您是否至少声明了一些依赖项?继续这个主题,如何显示您的整个构建脚本,以及您看到的错误,以及您希望看到的内容?@DavidM.Karr Yes,“/Users/me”是我的主目录。我使用Mac ProBook。不理解“mavenLocal()”的含义。我在问题中指出的问题是,依赖项不在项目库中。我将很快发布整个gradle生成文件。@AdamSkywalker当然,我在生成文件中声明依赖项。