unable to resolve class XXX

> Task :HelloWorld_Web:compileGroovy
startup failed:
E:\GradleDemoManyModules\ExampleHelloWorld\HelloWorld_Web\src\main\groovy\cn\dmahz\web\HelloWorldApi.groovy: 4: unable to resolve class cn.dmahz.service.HelloService
 @ line 4, column 1.
   import cn.dmahz.service.HelloService
   ^

E:\GradleDemoManyModules\ExampleHelloWorld\HelloWorld_Web\src\main\groovy\cn\dmahz\web\HelloWorldApi.groovy: 5: unable to resolve class cn.dmahz.service.impl.HelloServiceImpl
 @ line 5, column 1.
   import cn.dmahz.service.impl.HelloServiceImpl
   ^

2 errors

 

 

在build.gradle文件里添加以下内容,即可解决问题

    bootJar {
        enabled = false
    }

    jar {
        enabled = true
    }

 

 
posted @ 2021-03-14 11:59  星小梦  阅读(2099)  评论(0编辑  收藏  举报