将gradle版本升级到
gradlew war
后运行4.10.3
时,在执行compileGroovyPages
任务期间开始出现以下错误:dashboard_gsp.groovy: 2: unable to resolve class com.abnd.CarStatusEnum
@ line 2, column 1.
import com.abnd.CarStatusEnum
^
在运行构建的同一项目中,类
com.abnd.CarStatusEnum
的位置为src/main/groovy/com/abnd/CarStatusEnum
,并且在gradle版本3.4.1中成功完成gradlew war
任务。但是,当我将gradle版本升级到4.10.3时,我开始出现此错误。 gradle 4.1版也是如此。1)任何线索可能是什么问题?
2)将gradle版本4.xx或5.xx与grails版本3.xx以及gradle 5.xx一起使用是一个好主意,随着一些grails插件(例如grails-gsp v3.3.2其中是最新的稳定版本)使用在gradle 4.xx中已弃用并从gradle 5.xx中删除的某些功能(请参见下面的错误)?
Failed to apply plugin [id 'org.grails.grails-gsp']
Could not get unknown property 'classesDir' for main classes of type org.gradle.api.internal.tasks.DefaultSourceSetOutput.
最佳答案
1) Any clue what can be the problem ?
是。错误消息是GSP编译器找不到枚举类的线索。这是因为我们的插件与Gradle 4.10.3不兼容。
2) Is that a good idea to use gradle version 4.x.x or 5.x.x with grails version 3.x.x
否。您使用的Grails版本不支持这些Gradle版本。
希望对您有所帮助。
关于gradle - 将Gradle 3升级到Gradle 4后“unable to resolve class”错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56001316/