整个项目是基于 spring cloud 的
父项目的 build.gradle 配置:
group 'com.xxx.yyy'
version '0.1.0'
buildscript {
ext {
springBootVersion = '1.5.10.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath('se.transmode.gradle:gradle-docker:1.2')
}
}
subprojects {
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'docker'
apply plugin: 'org.springframework.boot'
sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceSets {
main {
java.srcDir "src"
}
}
repositories {
mavenCentral()
}
configurations {
all*.exclude module: 'spring-boot-starter-logging'
all*.exclude module: 'logback-classic'
}
dependencyManagement {
imports {
mavenBom 'org.springframework.cloud:spring-cloud-dependencies:Edgware.SR3'
}
}
dependencies {
compile('org.springframework.boot:spring-boot-starter')
compile('org.springframework.boot:spring-boot-starter-log4j2')
compile('org.springframework.boot:spring-boot-starter-test')
compile('com.fasterxml.jackson.dataformat:jackson-dataformat-yaml')
}
}
子项目的配置就比较简单了
子项目1:
group 'com.xxx.yyy'
version '0.1.0'
archivesBaseName = 'prj1'
dependencies {
compile('org.springframework.boot:spring-boot-starter-web')
// ...
}
子项目2:
group 'com.xxx.yyy'
version '0.1.0'
archivesBaseName = 'prj2'
dependencies {
compile project(":prj1")
}
在父项目目录下,执行 gradle build -x test
命令时
> Task :prj2:compileJava
ConsumerHelper.java:5: 错误: 程序包com.xxx.yyy.zzz不存在
请问这个是什么原因导致。。。
沧海一幻觉
相关分类