问题遇到的现象和发生背景
gradle创建父子模块进行项目引用,不引用‘service’模块可以启动,引用则启动报找不到类
问题相关代码,请勿粘贴截图
‘app’模块gradle代码
repositories {
mavenCentral()
}
dependencies {
implementation project(':service')
}
‘service’模块gradle代码
repositories {
mavenCentral()
}
jar.enabled=true
bootJar.enabled=false
运行结果及报错内容
Description:
Field testService in com.tianliang.app.controller.HelloController required a bean of type 'com.tianliang.service.service.TestService' that could not be found.
Action:
Consider defining a bean of type 'com.tianliang.service.service.TestService' in your configuration.