<?xml version="1.0"?>
<ruleset id="springboot" xmlns="http://windup.jboss.org/schema/jboss-ruleset"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://windup.jboss.org/schema/jboss-ruleset http://windup.jboss.org/schema/jboss-ruleset/windup-jboss-ruleset.xsd">
    <metadata>
        <description>
            Verify the version of the Spring Boot framework is compatible with those supported by Red Hat Runtimes
        </description>
        <!-- version ranges applied to from and to technologies -->
        <dependencies>
            <addon id="org.jboss.windup.rules,windup-rules-javaee,3.0.0.Final" />
            <addon id="org.jboss.windup.rules,windup-rules-java,3.0.0.Final" />
            <addon id="org.jboss.windup.rules,windup-rules-xml,3.0.0.Final" />
        </dependencies>
        <sourceTechnology id="springboot" />
        <targetTechnology id="rhr"/>
    </metadata>
    <rules>
        <rule id="springboot-00001">
            <!-- rule condition, when it could be fired -->
            <when>
                <dependency groupId="org.springframework.boot" artifactId="{*}" toVersion="2.2.5.RELEASE" />
            </when>
            <!-- rule operation, what to do if it is fired -->
            <perform>
                <hint title="Unsupported version of Spring Boot" effort="3" category-id="mandatory">
                    <message>Spring Boot has to be updated to Spring Boot 2.2.6 before being able to be migrated to a version supported by Red Hat Runtimes</message>
                    <link href="https://access.redhat.com/articles/3348731" title="RHOAR Component Details Overview" />
                </hint>
            </perform>
        </rule>
        <rule id="springboot-00002">
            <!-- rule condition, when it could be fired -->
            <when>
                <or>
                    <dependency groupId="org.springframework.boot" artifactId="{*}" fromVersion="2.0.0"          toVersion="2.1.1.RELEASE" />
                    <dependency groupId="org.springframework.boot" artifactId="{*}" fromVersion="2.2.7.RELEASE"  toVersion="2.2.9.RELEASE" />
                    <dependency groupId="org.springframework.boot" artifactId="{*}" fromVersion="2.2.12.RELEASE" toVersion="2.3.3.RELEASE" />
                    <dependency groupId="org.springframework.boot" artifactId="{*}" fromVersion="2.3.5.RELEASE"  toVersion="2.3.5.RELEASE" />
                    <dependency groupId="org.springframework.boot" artifactId="{*}" fromVersion="2.3.7.RELEASE"  toVersion="2.3.9.RELEASE" />
                    <dependency groupId="org.springframework.boot" artifactId="{*}" fromVersion="2.3.11.RELEASE" toVersion="2.3.13.RELEASE" />
                    <dependency groupId="org.springframework.boot" artifactId="{*}" fromVersion="2.4.0"          toVersion="2.4.8" />
                    <dependency groupId="org.springframework.boot" artifactId="{*}" fromVersion="2.4.10"         toVersion="2.5.9" />
                    <dependency groupId="org.springframework.boot" artifactId="{*}" fromVersion="2.5.11"         toVersion="2.5.11" />
                    <dependency groupId="org.springframework.boot" artifactId="{*}" fromVersion="2.5.13"         toVersion="2.7.4" />
                </or>
            </when>
            <!-- rule operation, what to do if it is fired -->
            <perform>
                <hint title="Unsupported version of Spring Boot" effort="1" category-id="potential">
                    <message>Spring Boot has to be updated to a version supported by Red Hat Runtimes</message>
                    <link href="https://access.redhat.com/articles/3348731" title="RHOAR Component Details Overview" />
                </hint>
            </perform>
        </rule>
    </rules>
</ruleset>
