For Gradle, you can add the OM dependency as an annotation processor using the annotationProcessor
call in the dependencies block like:
ext {
redisOmVersion = '0.8.0'
}
dependencies {
implementation: "com.redis.om:redis-om-spring:$redisOmVersion"
annotationProcessor "com.redis.om:redis-om-spring:$redisOmVersion"
}
For Maven, things normally just work, when you run ./mvnw spring-boot:run
. Some users have experienced this not being the case, in which I recommend to explicitly declaring the maven-compiler-plugin
in the case below it's pair with an app create with start.spring.io v3.0.4 (all other versions can be inherited from the parent poms):
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<version>3.0.4</version>
</path>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</path>
<path>
<groupId>com.redis.om</groupId>
<artifactId>redis-om-spring</artifactId>
<version>0.8.0</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
Also, in case you are using IntelliJ Idea, see
https://www.jetbrains.com/help/idea/annotation-processors-support.html#annotation_processing