整個(gè)項(xiàng)目是基于 spring cloud 的
父項(xiàng)目的 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')
}
}
子項(xiàng)目的配置就比較簡(jiǎn)單了子項(xiàng)目1:
group 'com.xxx.yyy'
version '0.1.0'
archivesBaseName = 'prj1'
dependencies {
compile('org.springframework.boot:spring-boot-starter-web')
// ...
}
子項(xiàng)目2:
group 'com.xxx.yyy'
version '0.1.0'
archivesBaseName = 'prj2'
dependencies {
compile project(":prj1")
}
在父項(xiàng)目目錄下,執(zhí)行 gradle build -x test 命令時(shí)
> Task :prj2:compileJava
ConsumerHelper.java:5: 錯(cuò)誤: 程序包c(diǎn)om.xxx.yyy.zzz不存在
請(qǐng)問這個(gè)是什么原因?qū)е?。?!?
添加回答
舉報(bào)
0/150
提交
取消