<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ JBoss, Home of Professional Open Source.
  ~ Copyright 2020, Red Hat, Inc., and individual contributors
  ~ as indicated by the @author tags. See the copyright.txt file in the
  ~ distribution for a full listing of individual contributors.
  ~
  ~ This is free software; you can redistribute it and/or modify it
  ~ under the terms of the GNU Lesser General Public License as
  ~ published by the Free Software Foundation; either version 2.1 of
  ~ the License, or (at your option) any later version.
  ~
  ~ This software is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  ~ Lesser General Public License for more details.
  ~
  ~ You should have received a copy of the GNU Lesser General Public
  ~ License along with this software; if not, write to the Free
  ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  -->
<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">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.jboss.eap</groupId>
    <artifactId>javadocs-parent</artifactId>
    <relativePath>../pom.xml</relativePath>
    <!--
    Maintain separation between the artifact id and the version to help prevent
    merge conflicts between commits changing the GA and those changing the V.
    -->
    <version>4.0.0.GA-redhat-00009</version>
  </parent>

  <artifactId>javadocs-builder</artifactId>
  <packaging>pom</packaging>

  <name>JBoss EAP aggregate javadocs builder</name>
  <description>Generate JBoss EAP aggregate javadocs pom</description>

  <dependencies>
    <dependency>
      <groupId>org.wildfly</groupId>
      <artifactId>javadocs-pom-generator-plugin</artifactId>
      <version>${version.org.wildfly.javadocs-pom-generator-plugin}</version>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-invoker-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <defaultGoal>verify</defaultGoal>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-invoker-plugin</artifactId>
        <executions>

          <!-- generate javadocs pom for eap xp dist -->
          <execution>
            <id>generate-javadocs-pom-file</id>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <pomIncludes>
                <pomInclude>generate-javadocs-pom-file/pom.xml</pomInclude>
              </pomIncludes>
              <cloneProjectsTo>${project.build.directory}/it-dist-generate-pom</cloneProjectsTo>
              <settingsFile>src/it/settings.xml</settingsFile>
              <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
              <filterProperties>
                <xp.version>${project.version}</xp.version>
                <server.version>${version.org.jboss.eap}</server.version>
                <core.version>${version.org.wildfly.core}</core.version>
                <version.org.wildfly.javadocs-pom-generator-plugin>${version.org.wildfly.javadocs-pom-generator-plugin}</version.org.wildfly.javadocs-pom-generator-plugin>
              </filterProperties>
              <scriptVariables>
                <targetFolder>generate-javadocs-file</targetFolder>
              </scriptVariables>
            </configuration>
          </execution>

          <!-- generate javadocs for eap xp dist -->
          <execution>
            <id>generate-javadocs-file</id>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <mergeUserSettings>true</mergeUserSettings> <!-- to get remote repositories -->
              <pomIncludes>
                <pomInclude>generate-javadocs-file/pom.xml</pomInclude>
              </pomIncludes>
              <cloneProjectsTo>${project.build.directory}/it-dist-generate-javadocs</cloneProjectsTo>
              <settingsFile>src/it/settings.xml</settingsFile>
              <filterProperties>
                <target.release.version>${javadocs.target.release.version}</target.release.version>
                <xp.target.release.version>${javadocs.xp.target.release.version}</xp.target.release.version>
                <version.javadoc.plugin>${version.javadoc.plugin}</version.javadoc.plugin>
              </filterProperties>
              <scriptVariables>
                <groupId>${project.groupId}</groupId>
                <artifactId>${javadocs.artifactId}</artifactId>
                <version>${project.version}</version>
                <classifier>javadoc</classifier>
                <type>jar</type>
              </scriptVariables>
            </configuration>
          </execution>

        </executions>
      </plugin>
    </plugins>
  </build>

</project>
