整個項目是基于 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不存在
請問這個是什么原因導致。。。
添加回答
舉報
0/150
提交
取消