<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2015 Red Hat, Inc. and/or its affiliates.
  ~
  ~ Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
  -->
<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>org.wildfly.swarm</groupId>
    <artifactId>swagger-webapp-parent</artifactId>
    <version>1.0.0.Final</version>
    <relativePath>../</relativePath>
  </parent>

  <groupId>org.wildfly.swarm</groupId>
  <artifactId>swagger-webapp-ui</artifactId>

  <name>WildFly Swarm: Swagger Web App UI</name>
  <description>WildFly Swarm: Swagger Web App UI</description>

  <packaging>war</packaging>

  <properties>
    <version.ui.swagger>2.1.4</version.ui.swagger>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>com.googlecode.maven-download-plugin</groupId>
        <artifactId>download-maven-plugin</artifactId>
        <version>1.2.1</version>
        <executions>
          <execution>
            <id>swagger-ui</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>wget</goal>
            </goals>
            <configuration>
              <url>https://github.com/swagger-api/swagger-ui/archive/v${version.ui.swagger}.tar.gz</url>
              <unpack>true</unpack>
              <outputDirectory>${project.build.directory}</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.1.1</version>
        <configuration>
          <webResources>
            <resource>
              <directory>${project.build.directory}/swagger-ui-${version.ui.swagger}/dist</directory>
            </resource>
          </webResources>
          <failOnMissingWebXml>false</failOnMissingWebXml>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
