<?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.quarkiverse.loggingmanager</groupId>
        <artifactId>quarkus-logging-manager-parent</artifactId>
        <version>1.0.1</version>
        <relativePath>../pom.xml</relativePath>
    </parent>
    
    
    <artifactId>quarkus-logging-manager-ui</artifactId>
    <name>Quarkus - Logging Manager - UI</name>
    
    <properties>
        <bootstrap.version>4.6.0</bootstrap.version>
        <fontawesome.version>5.15.2</fontawesome.version>
        <jquery.version>3.5.1</jquery.version>
    </properties>
    
    <!-- UI (Just here for dependabot) -->
    <dependencies>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>bootstrap</artifactId>
            <version>${bootstrap.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.webjars.bower</groupId>
            <artifactId>jquery</artifactId>
            <version>${jquery.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>font-awesome</artifactId>
            <version>${fontawesome.version}</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    
    <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.6.1</version>
                <executions>
                    
                    <execution>
                        <id>install-fontawesome-css-1</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>wget</goal>
                        </goals>
                        <configuration>
                            <url>https://unpkg.com/@fortawesome/fontawesome-free@${fontawesome.version}/css/solid.min.css</url>
                            <unpack>false</unpack>
                            <outputDirectory>${project.build.directory}/classes/META-INF/resources/logging-manager/fontawesome/css</outputDirectory>
                            <md5>7cad03119b81543b3f3afe4a19c4e2c5</md5>
                        </configuration>
                    </execution>
                    <execution>
                        <id>install-fontawesome-css-2</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>wget</goal>
                        </goals>
                        <configuration>
                            <url>https://unpkg.com/@fortawesome/fontawesome-free@${fontawesome.version}/css/fontawesome.min.css</url>
                            <unpack>false</unpack>
                            <outputDirectory>${project.build.directory}/classes/META-INF/resources/logging-manager/fontawesome/css</outputDirectory>
                            <md5>437e0fafbd3c880ef8b612d6ca41ed75</md5>
                        </configuration>
                    </execution>
                    <execution>
                        <id>install-fontawesome-fonts-1</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>wget</goal>
                        </goals>
                        <configuration>
                            <url>https://unpkg.com/@fortawesome/fontawesome-free@${fontawesome.version}/webfonts/fa-solid-900.woff2</url>
                            <unpack>false</unpack>
                            <outputDirectory>${project.build.directory}/classes/META-INF/resources/logging-manager/fontawesome/webfonts</outputDirectory>
                            <md5>9ae050d1876ac1763eb6afe4264e6d5a</md5>
                        </configuration>
                    </execution>
                    <execution>
                        <id>install-fontawesome-fonts-2</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>wget</goal>
                        </goals>
                        <configuration>
                            <url>https://unpkg.com/@fortawesome/fontawesome-free@${fontawesome.version}/webfonts/fa-solid-900.woff</url>
                            <unpack>false</unpack>
                            <outputDirectory>${project.build.directory}/classes/META-INF/resources/logging-manager/fontawesome/webfonts</outputDirectory>
                            <md5>4bfbf7eb4b19d9ff9293eb177b6d0070</md5>
                        </configuration>
                    </execution>
                    <execution>
                        <id>install-fontawesome-fonts-3</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>wget</goal>
                        </goals>
                        <configuration>
                            <url>https://unpkg.com/@fortawesome/fontawesome-free@${fontawesome.version}/webfonts/fa-solid-900.ttf</url>
                            <unpack>false</unpack>
                            <outputDirectory>${project.build.directory}/classes/META-INF/resources/logging-manager/fontawesome/webfonts</outputDirectory>
                            <md5>260d033f79f75d670fd09d8cf7c8bf8d</md5>
                        </configuration>
                    </execution>
                    
                    <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/logging-manager</outputDirectory>
                            <md5>d432e4222814b62dd30c9513dcc29440</md5>
                        </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.bundle.min.js</url>
                            <unpack>false</unpack>
                            <outputDirectory>${project.build.directory}/classes/META-INF/resources/logging-manager</outputDirectory>
                            <md5>f81d0a1705048649befc8b595e455a94</md5>
                        </configuration>
                    </execution>
                    
                    <execution>
                        <id>install-jquery</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/logging-manager</outputDirectory>
                            <md5>dc5e7f18c8d36ac1d3d4753a87c98d0a</md5>
                        </configuration>
                    </execution>
                    
                </executions>
            </plugin>
        </plugins>
    </build>
</project>