<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://gaellalire.fr/vestige/APPLICATION" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://gaellalire.fr/vestige/APPLICATION http://gaellalire.fr/vestige/application-2.2.0.xsd" javaSpecificationVersion="1.8">
  <installer class="org.apache.tomcat.vestige.full_installer.TomcatVestigeFullInstaller" supportedMigration="${tomcat.supportedMigration}">
    <mavenResolver groupId="org.apache.tomcat" artifactId="tomcat-vestige-full_installer" version="${project.version}"/>
    <verificationMetadata>
      <text>${tomcat.installer.verificationMetadata}</text>
    </verificationMetadata>
  </installer>
  <launcher class="org.apache.tomcat.vestige.launcher.TomcatVestigeLauncher" privateSystem="true">
  <!-- CLASSPATH FIXED_DEPENDENCIES -->
  <!-- ATTACHMENT INSTALLATION PLATFORM -->
    <mavenResolver groupId="org.apache.tomcat" artifactId="tomcat-vestige-launcher" version="${project.version}" scope="ATTACHMENT">
      <modifyLoadedDependency groupId="org.apache.tomcat" artifactId="tomcat-vestige-launcher">
         <addOpens module="java.base" package="java.lang"/>
         <addOpens module="java.base" package="java.util"/>
         <addOpens module="java.rmi" package="sun.rmi.transport"/>
      </modifyLoadedDependency>
      <modifyLoadedDependency groupId="org.apache.tomcat" artifactId="tomcat-catalina">
         <addOpens module="java.base" package="java.lang"/>
         <addOpens module="java.base" package="java.io"/>
         <addOpens module="java.rmi" package="sun.rmi.transport"/>
      </modifyLoadedDependency>
      <modifyScope groupId="org.apache.tomcat" artifactId="tomcat-jsp-api" scope="INSTALLATION"/>
    </mavenResolver>
    <inject serviceClassName="fr.gaellalire.vestige.spi.system.VestigeSystem" setterName="setVestigeSystem" targetServiceClassName="org.apache.tomcat.vestige.launcher.TomcatVestigeSystem"/>
    <inject serviceClassName="fr.gaellalire.vestige.spi.resolver.maven.VestigeMavenResolver" setterName="setVestigeMavenResolver"/>
    <verificationMetadata>
      <text>${tomcat.verificationMetadata}</text>
    </verificationMetadata>
  </launcher>
  <configurations>
    <permissions>    
      <permission type="java.security.AllPermission"/>
    </permissions>
  
    <mavenConfig>
      <!-- dependencies needed but not list as dependency -->
      <replaceDependency groupId="org.apache.tomcat" artifactId="tomcat-vestige-catalina-patched">
        <addDependency version="${tomcat.version}" groupId="org.apache.tomcat" artifactId="tomcat-catalina"/>
      </replaceDependency>
      <replaceDependency groupId="org.apache.tomcat" artifactId="tomcat-vestige-util-scan-patched">
        <addDependency version="${tomcat.version}" groupId="org.apache.tomcat" artifactId="tomcat-util-scan"/>
      </replaceDependency>
      <replaceDependency groupId="javax.websocket" artifactId="javax.websocket-api">
        <addDependency version="${tomcat.version}" groupId="org.apache.tomcat" artifactId="tomcat-websocket-api"/>
      </replaceDependency>
      <modifyDependency artifactId="tomcat-catalina" groupId="org.apache.tomcat">
        <patch artifactId="tomcat-vestige-catalina" groupId="org.apache.tomcat" version="${project.version}"/>
        <addDependency groupId="org.apache.tomcat" artifactId="tomcat-websocket-api" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-coyote" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-jasper" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="javax.websocket-api" groupId="javax.websocket" version="1.0"/>        
        <addDependency artifactId="tomcat-tribes" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        
        <!-- optional dependencies -->
        <addDependency artifactId="tomcat-catalina-ha" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-jdbc" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-dbcp" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-jdbc" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-storeconfig" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        
        <!-- language dependencies -->
        <addDependency artifactId="tomcat-i18n-fr" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-ko" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-es" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-de" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-cs" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-pt-BR" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-zh-CN" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-ja" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-ru" groupId="org.apache.tomcat" version="${tomcat.version}"/>
      </modifyDependency>
      <modifyDependency artifactId="tomcat-tribes" groupId="org.apache.tomcat">
        <addDependency artifactId="tomcat-coyote" groupId="org.apache.tomcat" version="${tomcat.version}"/>
      </modifyDependency>
      <modifyDependency artifactId="tomcat-jaspic-api" groupId="org.apache.tomcat">
        <addDependency artifactId="tomcat-catalina" groupId="org.apache.tomcat" version="${tomcat.version}"/>
      </modifyDependency>
      
      <modifyDependency artifactId="tomcat-coyote" groupId="org.apache.tomcat">
        <addDependency artifactId="tomcat-catalina" groupId="org.apache.tomcat" version="${tomcat.version}"/>
      </modifyDependency>
        <!-- util-scan load classes -->
      <modifyDependency artifactId="tomcat-util-scan" groupId="org.apache.tomcat">
        <patch artifactId="tomcat-vestige-util-scan" groupId="org.apache.tomcat" version="${project.version}"/>
        <addDependency artifactId="tomcat-coyote" groupId="org.apache.tomcat" version="${tomcat.version}"/>
      </modifyDependency>
      <!-- Constant is in tomcat-coyote -->
      <modifyDependency artifactId="tomcat-util" groupId="org.apache.tomcat">
        <addDependency artifactId="tomcat-coyote" groupId="org.apache.tomcat" version="${tomcat.version}"/>
      </modifyDependency>

      <modifyDependency artifactId="tomcat-servlet-api" groupId="org.apache.tomcat">
        <!-- language dependencies -->
        <addDependency artifactId="tomcat-i18n-fr" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-ko" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-es" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-de" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-cs" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-pt-BR" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-zh-CN" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-ja" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-ru" groupId="org.apache.tomcat" version="${tomcat.version}"/>
      </modifyDependency>
      <modifyDependency artifactId="tomcat-el-api" groupId="org.apache.tomcat">
        <!-- language dependencies -->
        <addDependency artifactId="tomcat-i18n-fr" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-ko" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-es" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-de" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-cs" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-pt-BR" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-zh-CN" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-ja" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-ru" groupId="org.apache.tomcat" version="${tomcat.version}"/>
      </modifyDependency>
      <modifyDependency artifactId="tomcat-dbcp" groupId="org.apache.tomcat">
        <!-- language dependencies -->
        <addDependency artifactId="tomcat-i18n-fr" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-ko" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-es" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-de" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-cs" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-pt-BR" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-zh-CN" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-ja" groupId="org.apache.tomcat" version="${tomcat.version}"/>
        <addDependency artifactId="tomcat-i18n-ru" groupId="org.apache.tomcat" version="${tomcat.version}"/>
      </modifyDependency>
      
      <additionalRepository id="gaellalire-repo" url="https://gaellalire.fr/maven/repository/"/>           
    </mavenConfig>
  </configurations>
</application>
