<?xml version="1.0" encoding="UTF-8"?>
<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>

  <parent>
    <groupId>io.smallrye</groupId>
    <artifactId>smallrye-health-parent</artifactId>
    <version>4.3.0</version>
  </parent>

  <artifactId>smallrye-health-ui</artifactId>

  <name>SmallRye Health: UI</name>
  
  <properties>
        <bootstrap.version>4.5.0</bootstrap.version>
        <jquery.version>3.5.1</jquery.version>
    </properties>
    
    <build>
                
        <!-- Copy all web content files META-INF folder, and push it through a filter to replace maven properties -->
        <resources>
            <resource>
                <directory>${basedir}/src/main/resources</directory>
            </resource>
            <resource>
                <directory>${basedir}/src/main/webapp</directory>
                <targetPath>${project.build.directory}/classes/META-INF/resources</targetPath>
                <filtering>true</filtering>
                <includes>
                    <include>**/*.css</include>
                    <include>**/*.html</include>
                </includes>
            </resource>
            <resource>
                <directory>${basedir}/src/main/webapp</directory>
                <targetPath>${project.build.directory}/classes/META-INF/resources</targetPath>
                <filtering>false</filtering>
                <excludes>
                    <exclude>**/*.css</exclude>
                    <exclude>**/*.html</exclude>
                </excludes>
            </resource>
        </resources>
        
        <plugins>
            <!-- So we don't have to keep a version of these javascript libs in our repo -->
            <plugin>
                <groupId>com.googlecode.maven-download-plugin</groupId>
                <artifactId>download-maven-plugin</artifactId>
                <version>1.13.0</version>
                <executions>
                    <execution>
                        <id>install-bootstrap-css</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>wget</goal>
                        </goals>
                        <configuration>
                            <url>https://unpkg.com/bootstrap@${bootstrap.version}/dist/css/bootstrap.min.css</url>
                            <unpack>false</unpack>
                            <outputDirectory>${project.build.directory}/classes/META-INF/resources/health-ui</outputDirectory>
                            <md5>3afe15e976734d9daac26310110c4594</md5>
                            <skipCache>true</skipCache>
                            <overwrite>true</overwrite>
                            <readTimeOut>10000</readTimeOut>
                        </configuration>
                    </execution>
                    <execution>
                        <id>install-bootstrap-js</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>wget</goal>
                        </goals>
                        <configuration>
                            <url>https://unpkg.com/bootstrap@${bootstrap.version}/dist/js/bootstrap.min.js</url>
                            <unpack>false</unpack>
                            <outputDirectory>${project.build.directory}/classes/META-INF/resources/health-ui</outputDirectory>
                            <md5>6bea60c34c5db6797150610dacdc6bce</md5>
                            <skipCache>true</skipCache>
                            <overwrite>true</overwrite>
                            <readTimeOut>10000</readTimeOut>
                        </configuration>
                    </execution>
                    <execution>
                        <id>install-query</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>wget</goal>
                        </goals>
                        <configuration>
                            <url>https://unpkg.com/jquery@${jquery.version}/dist/jquery.min.js</url>
                            <unpack>false</unpack>
                            <outputDirectory>${project.build.directory}/classes/META-INF/resources/health-ui</outputDirectory>
                            <md5>dc5e7f18c8d36ac1d3d4753a87c98d0a</md5>
                            <skipCache>true</skipCache>
                            <overwrite>true</overwrite>
                            <readTimeOut>10000</readTimeOut>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>