【发布时间】:2019-04-02 13:51:43
【问题描述】:
由于某些情况,我不得不将 Spring Boot 项目中的 Kotlin 主类更改为 Java。但是当我使用 Gradle 构建项目时,出现错误:
Main class name has not been configured and it could not be resolved
我通过设置sourceSets.main.java.srcDirs = ['src'] 来解决构建问题,如Gradle - Could not find or load main class 中所述,但这会在本地搞砸一些事情(在 IntelliJ 中看不到包含整个源代码的 Kotlin 包)。
我怀疑有更好的方法来设置带有 Java 主类的 Kotlin 项目。
提前谢谢你
【问题讨论】:
标签: java spring spring-boot gradle kotlin