<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">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.test.liquibase</groupId>
    <artifactId>sme_analytics.build</artifactId>
    <version>0.1</version>
    <build>
        <plugins>
            <plugin>
              <groupId>org.codehaus.mojo</groupId>
              <artifactId>properties-maven-plugin</artifactId>
              <version>1.0-alpha-2</version>
              <executions>
                <execution>
                  <phase>initialize</phase>
                  <goals>
                    <goal>read-project-properties</goal>
                  </goals>
                  <configuration>
                    <files>
                      <file>db.properties</file>
                    </files>
                  </configuration>
                </execution>
              </executions>
            </plugin>
            <plugin>
               <groupId>org.codehaus.mojo</groupId>
               <artifactId>sql-maven-plugin</artifactId>
               <version>1.5</version>
               <dependencies>
                   <dependency>
                       <groupId>net.snowflake</groupId>
                       <artifactId>snowflake-jdbc</artifactId>
                       <version>3.14.5</version>
                   </dependency>
               </dependencies>
               <configuration>
                   <driver>net.snowflake.client.jdbc.SnowflakeDriver</driver>
                   <url>jdbc:snowflake://${host}.${region}.snowflakecomputing.com/?${conn_params}</url>
                   <username>${username}</username>
               </configuration>
                <executions>
                  <execution>
                    <phase>initialize</phase>
                    <goals>
                      <goal>execute</goal>
                    </goals>
                    <configuration>
                      <sqlCommand>ALTER WAREHOUSE CICD_WH RESUME;</sqlCommand>
                      <onError>continue</onError>
                    </configuration>
                  </execution>
               </executions>
            </plugin>
            <plugin>
                <groupId>org.liquibase</groupId>
                <artifactId>liquibase-maven-plugin</artifactId>
                <version>4.25.1</version>
                <configuration>
                    <searchPath>/</searchPath>
                    <changeLogFile>${changeLogFile}</changeLogFile>
                    <logging>${logLevel}</logging>
                    <driver>net.snowflake.client.jdbc.SnowflakeDriver</driver>
                    <url>jdbc:snowflake://${host}.${region}.snowflakecomputing.com/?${conn_params}</url>
                    <username>${username}</username>
                    <defaultSchemaName>${schema}</defaultSchemaName>
                    <!-- Properties substituted in the migrations should be declared via system properties -->
                    <systemProperties>
                        <db>${db}</db>
                    </systemProperties>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>net.snowflake</groupId>
                        <artifactId>snowflake-jdbc</artifactId>
                        <version>3.14.5</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>
</project>

