Skip to content

Kotlin Support #250

@lucasleon2107

Description

@lucasleon2107

I using Spring Boot (3.0.2) with JDK 17, Kotlin (1.8.20) and the latest version of Redis OM (0.8.2). I configured the annotation processor using kapt. Here's the snippet:

<plugin>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-maven-plugin</artifactId>
                <version>${kotlin.version}</version>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <id>kapt</id>
                        <configuration>
                            <sourceDirs>
                                <sourceDir>src/main/kotlin</sourceDir>
                            </sourceDirs>
                            <annotationProcessorPaths>
                                <annotationProcessorPath>
                                    <groupId>com.redis.om</groupId>
                                    <artifactId>redis-om-spring</artifactId>
                                    <version>0.8.0</version>
                                </annotationProcessorPath>
                            </annotationProcessorPaths>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <args>
                        <arg>-Xjsr305=strict</arg>
                    </args>
                    <compilerPlugins>
                        <plugin>spring</plugin>
                    </compilerPlugins>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.jetbrains.kotlin</groupId>
                        <artifactId>kotlin-maven-allopen</artifactId>
                        <version>${kotlin.version}</version>
                    </dependency>
                </dependencies>
            </plugin>

This is the class that is being generated:

public final class UserInfoHash$ {
  public static MetamodelField<UserInfoHash, String> _KEY;

  static {
    try {
      _KEY = new MetamodelField<UserInfoHash, String>("__key", String.class, true);
    } catch(NoSuchFieldException | SecurityException e) {
      System.err.println(e.getMessage());
    }
  }
}

But I'm getting the following error:
exception java.lang.NoSuchFieldException is never thrown in body of corresponding try statement

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions