我正在使用Intellij IDEA 2017.2.4
和Gradle 4.0.1
我有几个Spring Boot服务。而且我面临运行它们的问题,由于缺少依赖关系,它们可能会以随机方式启动而失败。Intellij IDEA不解决Gradle依赖关系
我有build.gradle
父项目:
buildscript {
repositories {
mavenCentral()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
maven { url "https://plugins.gradle.org/m2/" }
mavenLocal()
}
dependencies {
classpath("io.spring.gradle:dependency-management-plugin:$dependencyManagementPluginVersion")
classpath("org.springframework.boot:spring-boot-gradle-plugin:$springBootVersion")
}
}
allprojects {
apply plugin: 'java'
apply plugin: 'idea'
group = '***'
version = '***'
}
subprojects {
sourceCompatibility = 1.8
targetCompatibility = 1.8
processResources {
filesMatching('**/*.yml') {
expand(project.properties)
}
}
apply plugin: 'io.spring.dependency-management'
dependencyManagement {
imports {
mavenBom("org.springframework.cloud:spring-cloud-dependencies:$springCloudVersion")
mavenBom("org.springframework.boot:spring-boot-dependencies:$springBootVersion")
}
dependencies {
dependency "com.google.cloud:google-cloud-storage:$googleCloudStorageVersion"
...
dependency "org.junit.jupiter:junit-jupiter-api:$junitVersion"
}
}
}
和一个小孩项目build.gradle
:
apply plugin: 'org.springframework.boot'
repositories {
mavenCentral()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
mavenLocal()
}
dependencies {
compile('org.springframework.boot:spring-boot-starter-data-jpa')
...
testCompile('com.h2database:h2')
}
在某些情况下lombok
依赖遗漏,在其他javax
依赖。它表明依赖不存在。
但之后我按01并再次它的工作原理建立。
也许有人遇到同样的问题,有它的一些解决方案?
你能在这里发表您'build.gradle'文件,好吗? –
@AndriiAbramov有一些基本的东西,没有什么特别的 –