我的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()。