Kotlin在编译时未解决的参考

我前几天正在做一个项目,这个工作正在进行中,我今天又回来了,不再编译,但是我没有改变任何东西,据我所知…

这是文件:

package windall.console.account.api.persistence import com.fasterxml.jackson.annotation.JsonIgnore import windall.console.account.api.dtos.PaymentDto import windall.console.account.api.model.Tenant import java.time.LocalDateTime import javax.persistence.Column import javax.persistence.Entity import javax.persistence.GeneratedValue import javax.persistence.Id import javax.persistence.JoinColumn import javax.persistence.ManyToOne @Entity data class Receipt ( @Id @GeneratedValue(strategy = GenerationType.IDENTITY) val id: Long? = null, val amount: Long, @JsonIgnore @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "tenant_id") val tenant: Tenant? = null, @Column(name = "payment_datetime") val paymentDateTime: LocalDateTime = LocalDateTime.now() ) { @Suppress("unused") private constructor(): this(amount = 0) constructor(dto: PaymentDto, tenant: Tenant) : this(amount = dto.amount, tenant = tenant) } 

这是我在我的maven构建中的错误:

 > [ERROR] Failed to execute goal org.jetbrains.kotlin:kotlin-maven-plugin:1.1.60:compile (compile) on project api: Compilation failure: Compilation failure: > [ERROR] C:\workspace\windall.console.account.api\src\main\kotlin\windall\console\account\api\models\Receipt.kt:[18,30] Unresolved reference: GenerationType > [ERROR] C:\workspace\windall.console.account.api\src\main\kotlin\windall\console\account\api\models\Receipt.kt:[18,30] An annotation parameter must be a compile-time constant > [ERROR] C:\workspace\windall.console.account.api\src\main\kotlin\windall\console\account\api\models\Receipt.kt:[24,22] Unresolved reference: FetchType > [ERROR] C:\workspace\windall.console.account.api\src\main\kotlin\windall\console\account\api\models\Receipt.kt:[24,22] An annotation parameter must be a compile-time constant 

任何帮助将是奇妙:)因为我似乎无法find这些错误的任何可能的原因,我的IDE也没有突出任何问题…

如果有帮助,这里也是我的pom

   4.0.0 windall.console.account api 1.0.0.RELEASE jar windall.console.account.api Mucking around  org.springframework.boot spring-boot-starter-parent 1.4.3.RELEASE    UTF-8 UTF-8 1.8 1.1.60    org.springframework.boot spring-boot-starter-web   org.springframework.boot spring-boot-starter-data-jpa   org.jetbrains.kotlin kotlin-stdlib-jre8 ${kotlin.version}   org.jetbrains.kotlin kotlin-reflect ${kotlin.version}   com.h2database h2 runtime   com.fasterxml.jackson.datatype jackson-datatype-jsr310 2.9.2   io.springfox springfox-swagger2 2.6.1 compile   io.springfox springfox-swagger-ui 2.6.1 compile   org.springframework.boot spring-boot-starter-test test   org.jetbrains.kotlin kotlin-test-junit ${kotlin.version} test   info.cukes cucumber-java8 1.2.5 test   info.cukes cucumber-spring 1.2.5 test   info.cukes cucumber-junit 1.2.5 test    ${project.basedir}/src/main/kotlin ${project.basedir}/src/test/kotlin   org.springframework.boot spring-boot-maven-plugin   kotlin-maven-plugin org.jetbrains.kotlin ${kotlin.version}   spring  1.8    compile compile  compile    test-compile test-compile  test-compile      org.jetbrains.kotlin kotlin-maven-allopen ${kotlin.version}       

我错过了import

 import javax.persistence.GenerationType import javax.persistence.FetchType 

结果eclipse不能识别Kotlin中的注解参数中使用的类,因此,清理导入任务删除了它们…