<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>4.1.1</version>
        <relativePath/>
    </parent>

    <groupId>com.ankurm</groupId>
    <artifactId>redis-json-demo</artifactId>
    <version>1.0.0</version>
    <name>redis-json-demo</name>

    <properties>
        <java.version>25</java.version>
        <testcontainers.version>2.0.5</testcontainers.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.testcontainers</groupId>
                <artifactId>testcontainers-bom</artifactId>
                <version>${testcontainers.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-redis</artifactId>
        </dependency>
        <!-- spring-boot-starter-data-redis does NOT bring Jackson onto the
             classpath by itself (unlike spring-boot-starter-web). Without
             any Jackson, RedisJsonTemplate.create(...) throws at
             bean-creation time: "No default RedisJsonSerializer
             available." Boot 4.1.1's own spring-boot-starter-json pulls
             Jackson 3 (tools.jackson:jackson-databind), but the default
             RedisJsonSerializer this milestone resolves against still
             wants Jackson 2's com.fasterxml.jackson.databind.JsonNode on
             the classpath - confirmed by the NoClassDefFoundError that
             spring-boot-starter-json alone left behind, and fixed by
             depending on Jackson 2's databind module directly. -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <!-- JsonOperations / RedisJsonTemplate ships first in Spring Data
             Redis 4.2 (currently milestone M2); Boot 4.1.1's BOM manages
             the 4.1.1 GA line, which does not have these classes at all -
             confirmed by inspecting the resolved 4.1.1 jar. Overriding
             the single artifact to the milestone is the deliberate point
             of this post, not an oversight. -->
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-redis</artifactId>
            <version>4.2.0-M2</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-testcontainers</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>testcontainers-junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>
