<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <parent>
    <groupId>org.apache.tomcat</groupId>
    <artifactId>tomcat-vestige</artifactId>
    <version>9.0.31.1</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>tomcat-vestige-descriptors</artifactId>
  <packaging>pom</packaging>
  <name>Tomcat Vestige :: Descriptors</name>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-deploy-plugin</artifactId>
        <executions>
          <execution>
            <id>default-deploy</id>
            <phase>none</phase>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>deploy-vestige-descriptors</id>
      <activation>
        <property>
          <name>env.VESTIGE_REPOSITORY_PATH</name>
        </property>
      </activation>
      <properties>
        <vestige.repository.path>${env.VESTIGE_REPOSITORY_PATH}</vestige.repository.path>
        <vestige.application.version>${tomcat.version}</vestige.application.version>
        <tomcat.supportedMigration>${env.TOMCAT_SUPPORTED_MIGRATION}</tomcat.supportedMigration>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>fr.gaellalire.vestige</groupId>
            <artifactId>vestige.plugin.verify</artifactId>
            <executions>
              <execution>
                <goals>
                  <goal>create-verification-metadata</goal>
                </goals>
                <phase>deploy</phase>
                <configuration>
                  <verifications>
                    <verification>
                      <verifyFile>${basedir}/src/main/config/verify.xml</verifyFile>
                      <mavenPropertyName>tomcat.verificationMetadata</mavenPropertyName>
                    </verification>
                    <verification>
                      <verifyFile>${basedir}/src/main/config/verify-minimal.xml</verifyFile>
                      <mavenPropertyName>tomcat.minimal.verificationMetadata</mavenPropertyName>
                    </verification>
                    <verification>
                      <verifyFile>${basedir}/src/main/config/verify-installer.xml</verifyFile>
                      <mavenPropertyName>tomcat.installer.verificationMetadata</mavenPropertyName>
                    </verification>
                    <verification>
                      <verifyFile>${basedir}/src/main/config/verify-minimal-installer.xml</verifyFile>
                      <mavenPropertyName>tomcat.installer.minimal.verificationMetadata</mavenPropertyName>
                    </verification>
                  </verifications>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>com.coderplus.maven.plugins</groupId>
            <artifactId>copy-rename-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>rename-tomcat-file</id>
                <phase>deploy</phase>
                <goals>
                  <goal>copy</goal>
                </goals>
                <configuration>
                  <sourceFile>src/main/config/tomcat.xml</sourceFile>
                  <destinationFile>${project.build.directory}/tomcat/tomcat-${vestige.application.version}.xml</destinationFile>
                </configuration>
              </execution>
              <execution>
                <id>rename-tomcat-minimal-file</id>
                <phase>deploy</phase>
                <goals>
                  <goal>copy</goal>
                </goals>
                <configuration>
                  <sourceFile>src/main/config/tomcat-minimal.xml</sourceFile>
                  <destinationFile>${project.build.directory}/tomcat-minimal/tomcat-minimal-${vestige.application.version}.xml</destinationFile>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <executions>
              <execution>
                <id>deploy-vestige-app</id>
                <goals>
                  <goal>copy-resources</goal>
                </goals>
                <phase>deploy</phase>
                <configuration>
                  <resources>
                    <resource>
                      <targetPath>tomcat</targetPath>
                      <directory>${project.build.directory}/tomcat</directory>
                      <filtering>true</filtering>
                    </resource>
                    <resource>
                      <targetPath>tomcat-minimal</targetPath>
                      <directory>${project.build.directory}/tomcat-minimal</directory>
                      <filtering>true</filtering>
                    </resource>
                  </resources>
                  <outputDirectory>${vestige.repository.path}</outputDirectory>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>tomcat-vestige-installer</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>tomcat-vestige-full_installer</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>tomcat-vestige-launcher</artifactId>
      <version>${project.version}</version>
    </dependency>
  </dependencies>
</project>