<?xml version="1.0"?>
<ruleset xmlns="http://windup.jboss.org/schema/jboss-ruleset" id="eapxp_bootable_jar_maven_plugin_configuration_changes"
         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 provides analysis of Maven built applications that use JBoss EAP XP 2.x Bootable JAR Maven Plugin,
            which configuration may need to be changed, when migrating to JBoss EAP XP 3.x or later.
        </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="eapxp" />
        <targetTechnology id="eapxp" versionRange="[3,)" />
        <tag>JBossEAP</tag>
        <tag>EAPXP</tag>
    </metadata>
    <rules>
        <!-- https://issues.jboss.org/browse/WINDUPRULE-759 -->
        <rule id="eapxp_bootable_jar_maven_plugin_configuration_changes-1">
            <when>
                <xmlfile matches="//m:plugin[m:groupId/text() = 'org.wildfly.plugins' and m:artifactId/text() = 'wildfly-jar-maven-plugin']/m:configuration/m:extraServerContent" in="pom.xml">
                    <namespace prefix="m" uri="http://maven.apache.org/POM/4.0.0"/>
                </xmlfile>
            </when>
            <perform>
                <hint title="Bootable JAR Maven Plugin: rename extraServerContent configuration element" effort="1" category-id="potential">
                    <message>If you migrate your application to JBoss EAP XP 3.0 (or later), and want to ensure its Maven building, running or testing works as expected, rename the configuration element `extraServerContent` to `extraServerContentDirs`.</message>
                    <link title="JBoss EAP XP upgrade and migration guide: Bootable JAR application migration" href="https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.4/html-single/jboss_eap_xp_upgrade_and_migration_guide/index#microprofile-application-migration-bootable-jar_default"/>
                    <tag>EAPXP</tag>
                </hint>
            </perform>
        </rule>
    </rules>
</ruleset>