<?xml version="1.0"?>
<ruleset xmlns="http://windup.jboss.org/schema/jboss-ruleset" id="quarkus1-12-dockerfile-fast-jar"
         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 for upgrading to Quarkus 1.12 - Dockerfile.fast-jar as default 
        </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>
        <!-- The major version is implied by the target, the minor is reflected in the verionRange -->
        <sourceTechnology id="quarkus1" versionRange="(,11]"/>
        <targetTechnology id="quarkus1" versionRange="[12,)"/>
    </metadata>
    <rules>
        <rule id="quarkus1-12-dockerfile-fast-jar-00000">
            <when>
                <file filename="Dockerfile.fast-jar"/>
            </when>
            <perform>
                <hint title="Dockerfiles - fast-jar as default" effort="1" category-id="potential">
                        <message>
                            <![CDATA[
                            For existing applications, you have two Dockerfiles:

                            1. `Dockerfile.jvm`: this is the one for the `legacy-jar` packaging
                            2. `Dockerfile.fast-jar`: this is the one for `fast-jar` packaging (so the new default)
                            
                            For newly generated applications, the situation is a bit different:

                            1. `Dockerfile.jvm`: this is the one for the `fast-jar` packaging (so the new default)
                            2. `Dockerfile.legacy-jar`: this is the one for `legacy-jar`
                            
                            Note that if you want all your applications to be consistent, you can just update the Dockerfiles of 
                            your existing applications with the ones of a newly generated project.
                            ]]>                        
                        </message>
                        <link title="An example of the new Fast jar Dockerfile" href="https://github.com/quarkusio/quarkus-quickstarts/blob/master/validation-quickstart/src/main/docker/Dockerfile.jvm" />
                        <link title="Quarkus - Migration Guide 1.12" href="https://github.com/quarkusio/quarkus/wiki/Migration-Guide-1.12#dockerfiles" />
                </hint>
            </perform>
        </rule>
    </rules>
</ruleset>
