<?xml version="1.0" encoding="UTF-8"?>

<!--
  ~ JBoss, Home of Professional Open Source.
  ~ Copyright 2010, 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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.jboss.eap</groupId>
    <artifactId>jboss-eap-parent</artifactId>
    <version>${PROJECT_VERSION}</version>
  </parent>

  <artifactId>wildfly-ee-aggregate-javadocs</artifactId>

  <name>WildFly: Build-aggregate-javadocs</name>
  <packaging>jar</packaging>

  <licenses>
      <license>
          <name>GNU Lesser General Public License v2.1 or later</name>
          <url>http://repository.jboss.org/licenses/lgpl-2.1.txt</url>
          <distribution>repo</distribution>
      </license>
  </licenses>

  <profiles>
    <profile>
      <id>javadocPomGen</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <id>javadoc-pomgen</id>
                <phase>validate</phase>
                <configuration>
                  <target>
                    <echo message="Start to generate javadoc pom."/>
                    <!-- see org.wildfly.javadocs.pomgen.Main java doc for detail -->
                    <exec executable="java">
                      <arg value="org.wildfly.javadocs.pomgen.Main" />
                      <arg value="${wildfly-dist-dir}" />
                      <arg value="${wildfly-source-dir}"/>
                      <arg value="${wildfly-core-source-dir}"/>
                      <arg value="template-pom.xml" />
                    </exec>
                    <echo message="Finished generating javadoc pom."/>
                  </target>
                </configuration>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>javadocDist</id>
      <properties>
        <javadoc.branding>WildFly public API - ${project.version}</javadoc.branding>
      </properties>
      <build>
        <plugins>
          <plugin><!-- copy additional javadoc resources - LICENSE.txt -->
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
           <executions>
             <execution>
               <id>copy-license-file</id>
               <phase>prepare-package</phase>
               <goals>
                 <goal>copy-resources</goal>
               </goals>
               <configuration>
                 <outputDirectory>${project.build.directory}/apidocs</outputDirectory>
                 <resources>
                   <resource>
                     <directory>${basedir}</directory>
                     <includes>
                       <include>LICENSE.txt</include>
                       <filter>false</filter>
                     </includes>
                   </resource>
                 </resources>
               </configuration>
             </execution>
          </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${version.javadoc.plugin}</version>
            <executions>
              <execution>
                <id>javadocs-dist</id>
                <goals>
                  <goal>aggregate-jar</goal>
                </goals>
                <phase>package</phase>
                <configuration>
                  <debug>true</debug>
                  <verbose>true</verbose>
                  <maxmemory>2400m</maxmemory>
                  <!-- To prevent problems with author names written in non-UTF-8:
                  -->
                  <encoding>UTF-8</encoding>

                  <windowtitle>${javadoc.branding} public API</windowtitle>
                  <doctitle>${javadoc.branding} public API</doctitle>
                  <header>${javadoc.branding}</header>
                  <footer>${javadoc.branding}</footer>

                  <dependencySourceFilesExcludes>
                    <filesExclude>module-info.java</filesExclude>
                    <filesExclude>META-INF/versions/**/**.*</filesExclude>
                  </dependencySourceFilesExcludes>

                  <includeDependencySources>true</includeDependencySources>
                  <dependencySourceIncludes>
                    <!-- Filled by a script during creation of Javadoc. -->
                    <!--<include>commons-configuration:commons-configuration</include>-->
                  </dependencySourceIncludes>

                  <dependencySourceExcludes>
                    <!-- Filled by a script during creation of Javadoc. -->
                    <!-- manual exclusion for current -->
                    <!--<exclude>org.jboss.resteasy:resteasy-jaxrs</exclude>-->
                    <!--<exclude>joda-time:joda-time</exclude>-->
                    <!--<exclude>io.netty:netty-all</exclude>--> <!-- maven javadoc plugin fails if not exclude -->
                    <!--<exclude>org.jboss.narayana:jbosstxbridge</exclude>-->
                    <!--<exclude>dom4j:dom4j</exclude>-->
                    <!--<exclude>com.h2database:h2</exclude>-->
                    <!--<exclude>org.hornetq:hornetq-jms-server</exclude>-->
                    <!--<exclude>org.hibernate:hibernate-validator</exclude>-->
                    <!--<exclude>org.hibernate:hibernate-core</exclude>-->
                    <!--<exclude>org.bouncycastle:bcprov-jdk15on</exclude>-->
                    <!--<exclude>org.apache.wss4j:wss4j-ws-security-common</exclude>-->
                    <!--<exclude>org.apache.qpid:proton-j-impl</exclude>-->
                    <!--<exclude>org.opensaml:xmltooling</exclude>-->
                    <!--<exclude>org.opensaml:opensaml</exclude>-->
                    <!--<exclude>org.opensaml:openws</exclude>-->
                    <!--<exclude>org.jgroups:jgroups</exclude>-->
                    <!--<exclude>org.jboss.eap:jipijapa-eclipselink</exclude>-->
                    <exclude>org.jboss.eap:jipijapa-hibernate4-1</exclude> <!-- cause class file for org.hibernate.jpa.boot.archive.internal.StandardArchiveDescriptorFactory not found -->
                    <exclude>org.jboss.eap:jipijapa-hibernate4-3</exclude>
                    <!--<exclude>org.jboss.eap:jipijapa-openjpa</exclude>-->
                    <!--<exclude>org.apache.cxf:cxf-core</exclude>-->
                    <!--<exclude>org.jboss.openjdk-orb:openjdk-orb</exclude>-->
                    <!--<exclude>org.jboss.weld:weld-api</exclude>-->
                    <!--<exclude>org.jboss.weld:weld-core-impl</exclude>-->
                    <!--<exclude>org.wildfly.core:wildfly-controller-client</exclude>-->
                    <!--<exclude>org.wildfly.core:wildfly-core-security-api</exclude>-->
                    <!--<exclude>org.wildfly.core:wildfly-io</exclude>-->
                    <!--<exclude>org.wildfly.core:wildfly-request-controller</exclude>-->
                    <!--<exclude>org.wildfly.core:wildfly-self-contained</exclude>-->
                    <!--<exclude>com.github.spullara.mustache.java:compiler</exclude>-->
                    <!--<exclude>net.shibboleth.utilities:java-support</exclude>-->
                    <!--<exclude>org.apache.activemq:artemis-cli</exclude>-->
                    <!--<exclude>org.jboss:jboss-dmr</exclude>-->
                    <!--<exclude>io.undertow:undertow-core</exclude>-->
                    <exclude>org.eclipse.jdt.core.compiler:ecj</exclude> <!-- maven javadoc plugin fails if not exclude -->
                    <!-- end manual exclusion -->

                  </dependencySourceExcludes>

                  <groups>
                    <!-- Filled by a script during creation of Javadoc. -->
<!--
                    <group>
                      <title>Module org.jboss.as.controller</title>
                      <packages>org.jboss.as.controller:org.jboss.as.controller.access</packages>
                    </group>
-->
                  </groups>
                  <sourceFileExcludes>
                    <sourceFileExclude>**/module-info.java</sourceFileExclude>
                    <sourceFileExclude>**/META-INF/versions/**</sourceFileExclude>
                  </sourceFileExcludes>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <dependencies>
        <!-- Filled by a script during creation of Javadoc. -->
        <dependency> <!-- need to add bcel -->
          <groupId>org.apache.bcel</groupId>
          <artifactId>bcel</artifactId>
          <version>5.2</version>
        </dependency>


      </dependencies>
    </profile>

  </profiles>

</project>
