<?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/maven-v4_0_0.xsd">
  <parent>
    <artifactId>wildscribe-parent</artifactId>
    <groupId>org.jboss.wildscribe</groupId>
    <version>2.0.0.Final</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>wildscribe-site-generator</artifactId>
  <name>Wildscribe Site Generator</name>
  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
      </testResource>
      <testResource>
        <directory>src/test/java</directory>
        <excludes>
          <exclude>**/*.java</exclude>
        </excludes>
      </testResource>
    </testResources>
    <plugins>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <enableAssertions>true</enableAssertions>
          <runOrder>reversealphabetical</runOrder>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <mainClass>org.jboss.wildscribe.site.Main</mainClass>
            </manifest>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <configuration>
          <mainClass>org.jboss.wildscribe.site.Main</mainClass>
          <arguments>
            <argument>${versions.txt.dir}</argument>
            <argument>${output.dir}</argument>
          </arguments>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>single-version</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-invoker-plugin</artifactId>
            <version>${version.invoker.plugin}</version>
            <executions>
              <execution>
                <id>generate-single-version</id>
                <goals>
                  <goal>install</goal>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <projectsDirectory>src/it</projectsDirectory>
                  <localRepositoryPath>target/local-repo</localRepositoryPath>
                  <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
                  <mergeUserSettings>true</mergeUserSettings>
                  <filterProperties>
                    <server.version>${server.version}</server.version>
                    <versions.txt.dir>${project.parent.basedir}/models/standalone/${server.version}.dmr</versions.txt.dir>
                  </filterProperties>
                  <scriptVariables>
                    <server.version>${server.version}</server.version>
                  </scriptVariables>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>hamcrest-core</artifactId>
          <groupId>org.hamcrest</groupId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>
  <properties>
    <versions.txt.dir>${project.parent.basedir}/models/standalone</versions.txt.dir>
    <output.dir>${project.basedir}/target/wildscribe-generated</output.dir>
  </properties>
</project>
