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

<!--
 ~ Copyright 2012 Red Hat, Inc. and/or its affiliates.
 ~
 ~ Licensed under the Eclipse Public License version 1.0, available at
 ~ http://www.eclipse.org/legal/epl-v10.html
-->

<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.forge</groupId>
      <artifactId>forge-parent</artifactId>
      <version>1.4.3.Final</version>
      <relativePath>../pom.xml</relativePath>
   </parent>

   <artifactId>forge-javadoc</artifactId>

   <name>Forge - Javadoc</name>
   <packaging>jar</packaging>

   <build>
      <sourceDirectory>${project.build.directory}/sources</sourceDirectory>
   </build>

   <dependencies>

      <dependency>
         <groupId>org.jboss.forge</groupId>
         <artifactId>forge-dev-plugins</artifactId>
      </dependency>

      <dependency>
         <groupId>org.jboss.forge</groupId>
         <artifactId>forge-event-bus</artifactId>
      </dependency>

      <dependency>
         <groupId>org.jboss.forge</groupId>
         <artifactId>forge-git-tools</artifactId>
      </dependency>

      <dependency>
         <groupId>org.jboss.forge</groupId>
         <artifactId>forge-javaee-api</artifactId>
      </dependency>

      <dependency>
         <groupId>org.jboss.forge</groupId>
         <artifactId>forge-maven-api</artifactId>
      </dependency>

      <dependency>
         <groupId>org.jboss.forge</groupId>
         <artifactId>forge-parser-xml</artifactId>
      </dependency>

      <dependency>
         <groupId>org.jboss.forge</groupId>
         <artifactId>forge-scaffold-api</artifactId>
      </dependency>

      <dependency>
         <groupId>org.jboss.forge</groupId>
         <artifactId>forge-scaffoldx-api</artifactId>
      </dependency>

      <dependency>
         <groupId>org.jboss.forge</groupId>
         <artifactId>forge-shell-api</artifactId>
      </dependency>

   </dependencies>

   <profiles>
      <profile>
         <id>release</id>
         <activation>
            <property>
               <name>release</name>
               <value>true</value>
            </property>
         </activation>
         <build>
            <plugins>
               <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-dependency-plugin</artifactId>
                  <executions>
                     <execution>
                        <id>copy-sources-javadoc</id>
                        <phase>package</phase>
                        <goals>
                           <goal>unpack-dependencies</goal>
                        </goals>
                        <configuration>
                           <classifier>sources</classifier>
                           <outputDirectory>${project.build.directory}/sources-javadoc</outputDirectory>
                           <excludeTransitive>true</excludeTransitive>
                           <includeArtifactIds>forge-dev-plugins,forge-event-bus,forge-git-tools,forge-javaee-api,forge-maven-api,forge-parser-xml,forge-scaffold-api,forge-scaffoldx-api,forge-shell-api</includeArtifactIds>
                        </configuration>
                     </execution>
                  </executions>
               </plugin>

               <plugin>
                  <artifactId>maven-javadoc-plugin</artifactId>
                  <executions>
                     <execution>
                        <id>javadoc-jar</id>
                        <phase>package</phase>
                        <goals>
                           <goal>jar</goal>
                        </goals>
                        <configuration>
                           <sourcepath>${project.build.directory}/sources-javadoc</sourcepath>
                           <links>
                             <link>http://download.oracle.com/javaee/6/api</link>
                             <link>http://download.oracle.com/javase/6/docs/api/</link>
                           </links>
                           <keywords>true</keywords>
                           <author>true</author>
                        </configuration>
                     </execution>
                  </executions>
               </plugin>

            </plugins>
         </build>
      </profile>
   </profiles>
</project>

