<?xml version="1.0"?>
<ruleset xmlns="http://windup.jboss.org/schema/jboss-ruleset" id="springboot-scheduled-to-quarkus"
         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>
            This ruleset gives hints to migrate from Spring Scheduled to Quarkus spring-scheduled extension
        </description>
        <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="quarkus" />
    </metadata>
    <rules>
        <rule id="springboot-scheduled-to-quarkus-00000">
            <when>
                <javaclass references="org.springframework.scheduling.annotation.Scheduled">
                    <location>ANNOTATION</location>
                </javaclass>
            </when>
            <perform>
                <hint title="Replace the SpringBoot context artifact with Quarkus 'spring-scheduled' extension" effort="1" category-id="mandatory">
                    <message>
                        Replace the Spring Context artifact with Quarkus `spring-scheduled` extension

                        Spring Scheduled is in spring-context artifact brought transitively by any `org.springframework.boot:spring-boot-*` dependency
                        Add Quarkus dependency `io.quarkus:quarkus-spring-scheduled`
                    </message>
                    <link title="Quarkus Spring Scheduled Guide" href="https://quarkus.io/guides/spring-scheduled" />
                </hint>
            </perform>
        </rule>
    </rules>
</ruleset>
