Referencia no resuelta de Kotlin en time de compilation

Estuve trabajando en un proyecto hace unos días y funcionaba, volví a hacerlo hoy y ya no compilo, pero no cambié nada por lo que sé …

Este es el file:

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) } 

Aquí está el error que estoy obteniendo en mi construcción maven:

 > [ERROR] Failed to execute goal org.jetbrains.kotlin:kotlin-maven-plugin:1.1.60:compile (compile) on project api: Comstacktion failure: Comstacktion 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 

Cualquier ayuda sería maravillosa 🙂 ya que parece que no puedo encontrar ninguna causa posible para estos errores, mi IDE tampoco resalta ningún problema …

También aquí está mi pom en caso de que ayude

 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>windall.console.account</groupId> <artifactId>api</artifactId> <version>1.0.0.RELEASE</version> <packaging>jar</packaging> <name>windall.console.account.api</name> <description>Mucking around</description> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.4.3.RELEASE</version> </parent> <properties> <!--kotlin.compiler.incremental>true</kotlin.compiler.incremental--> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> <kotlin.version>1.1.60</kotlin.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <dependency> <groupId>org.jetbrains.kotlin</groupId> <artifactId>kotlin-stdlib-jre8</artifactId> <version>${kotlin.version}</version> </dependency> <dependency> <groupId>org.jetbrains.kotlin</groupId> <artifactId>kotlin-reflect</artifactId> <version>${kotlin.version}</version> </dependency> <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <scope>runtime</scope> </dependency> <dependency> <groupId>com.fasterxml.jackson.datatype</groupId> <artifactId>jackson-datatype-jsr310</artifactId> <version>2.9.2</version> </dependency> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.6.1</version> <scope>compile</scope> </dependency> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger-ui</artifactId> <version>2.6.1</version> <scope>compile</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.jetbrains.kotlin</groupId> <artifactId>kotlin-test-junit</artifactId> <version>${kotlin.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>info.cukes</groupId> <artifactId>cucumber-java8</artifactId> <version>1.2.5</version> <scope>test</scope> </dependency> <dependency> <groupId>info.cukes</groupId> <artifactId>cucumber-spring</artifactId> <version>1.2.5</version> <scope>test</scope> </dependency> <dependency> <groupId>info.cukes</groupId> <artifactId>cucumber-junit</artifactId> <version>1.2.5</version> <scope>test</scope> </dependency> </dependencies> <build> <sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory> <testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <plugin> <artifactId>kotlin-maven-plugin</artifactId> <groupId>org.jetbrains.kotlin</groupId> <version>${kotlin.version}</version> <configuration> <compilerPlugins> <plugin>spring</plugin> </compilerPlugins> <jvmTarget>1.8</jvmTarget> </configuration> <executions> <execution> <id>compile</id> <phase>compile</phase> <goals> <goal>compile</goal> </goals> </execution> <execution> <id>test-compile</id> <phase>test-compile</phase> <goals> <goal>test-compile</goal> </goals> </execution> </executions> <dependencies> <dependency> <groupId>org.jetbrains.kotlin</groupId> <artifactId>kotlin-maven-allopen</artifactId> <version>${kotlin.version}</version> </dependency> </dependencies> </plugin> </plugins> </build> </project> 

Me faltaban las importaciones

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

Resulta que Eclipse no reconocerá las Clases utilizadas en los parameters de anotación en Kotlin, por lo tanto, la tarea de import de limpieza las eliminó …