<?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>io.thorntail</groupId>
    <artifactId>build-parent</artifactId>
    <version>2.5.1.Final-redhat-00010</version>
    <relativePath>../build-parent/pom.xml</relativePath>
  </parent>

  <groupId>io.thorntail</groupId>
  <artifactId>boms</artifactId>

  <name>BOMs</name>
  <description>BOMs</description>

  <packaging>pom</packaging>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>prepare-template</id>
            <phase>validate</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <inherited>false</inherited>
            <configuration>
              <outputDirectory>${basedir}/target</outputDirectory>
              <resources>
                <resource>
                  <directory>src/main/resources</directory>
                  <filtering>true</filtering>
                </resource>
              </resources>
              <escapeString>\</escapeString>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>io.thorntail</groupId>
          <artifactId>thorntail-fraction-plugin</artifactId>
          <version>${version.thorntail.fraction.plugin}</version>
          <executions>
            <execution>
              <id>generate-bom</id>
              <phase>none</phase>
              <goals>
                <goal>generate-bom</goal>
              </goals>
              <configuration>
                <stabilityIndex>1</stabilityIndex>
                <template>${project.parent.build.directory}/bom-template.xml</template>
              </configuration>
            </execution>
            <execution>
              <id>prep-doc-source</id>
              <phase>none</phase>
              <goals>
                <goal>prep-doc-source</goal>
              </goals>
              <configuration>
                <sourceOutputDir>${project.build.directory}/depSources</sourceOutputDir>
                <extraModules>
                  <extraModule>config-api:Config API</extraModule>
                  <extraModule>spi:SPI</extraModule>
                </extraModules>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>de.saumya.mojo</groupId>
          <artifactId>jruby-maven-plugin</artifactId>
          <executions>
            <execution>
              <id>collect-sources</id>
              <phase>process-sources</phase>
              <goals>
                <goal>jruby</goal>
              </goals>
              <configuration>
                <file>${project.parent.basedir}/src/main/ruby/collect_src.rb</file>
                <jrubyArgs>${project.build.directory} ${project.build.directory}/combined-src ${project.build.directory}/depSources</jrubyArgs>
              </configuration>
            </execution>
            <execution>
              <id>group-packages</id>
              <phase>package</phase>
              <goals>
                <goal>jruby</goal>
              </goals>
              <configuration>
                <file>${project.parent.basedir}/src/main/ruby/group_packages.rb</file>
                <jrubyArgs>${project.build.directory} ${project.reporting.outputDirectory}/${project.version}</jrubyArgs>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-javadoc-plugin</artifactId>
          <executions>
            <execution>
              <id>core-api</id>
              <phase>prepare-package</phase>
              <goals>
                <goal>javadoc</goal>
              </goals>
              <configuration>
                <sourcepath>${project.build.directory}/combined-src</sourcepath>
                <reportOutputDirectory>${project.reporting.outputDirectory}/${project.version}</reportOutputDirectory>
                <show>public</show>
                <failOnError>true</failOnError>
                <quiet>true</quiet>
                <header>Thorntail API, ${project.version}</header>
                <footer>Thorntail API, ${project.version}</footer>
                <doctitle>Thorntail API, ${project.version}</doctitle>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <artifactId>maven-assembly-plugin</artifactId>
          <executions>
            <execution>
              <id>create-javadoc-zip</id>
              <phase>package</phase>
              <goals>
                <goal>single</goal>
              </goals>
              <configuration>
                <descriptors>
                  <descriptor>${project.parent.basedir}/src/main/assembly/javadoc-zip.xml</descriptor>
                </descriptors>
              </configuration>
            </execution>
            <execution>
              <id>create-m2repo-zip</id>
              <phase>package</phase>
              <goals>
                <goal>single</goal>
              </goals>
              <configuration>
                <descriptors>
                  <descriptor>${project.parent.basedir}/src/main/assembly/m2repo-zip.xml</descriptor>
                </descriptors>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <id>jdk9</id>
      <activation>
        <jdk>[9,</jdk>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>de.saumya.mojo</groupId>
              <artifactId>jruby-maven-plugin</artifactId>
              <executions>
                <execution>
                  <id>collect-sources</id>
                  <phase>none</phase>
                </execution>
                <execution>
                  <id>group-packages</id>
                  <phase>none</phase>
                </execution>
              </executions>
            </plugin>
            <plugin>
              <artifactId>maven-javadoc-plugin</artifactId>
              <executions>
                <execution>
                  <id>core-api</id>
                  <phase>none</phase>
                </execution>
              </executions>
            </plugin>
            <plugin>
              <artifactId>maven-assembly-plugin</artifactId>
              <executions>
                <execution>
                  <id>create-javadoc-zip</id>
                  <phase>none</phase>
                </execution>
              </executions>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
  </profiles>

</project>
