<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.overlord.sramp</groupId>
    <artifactId>s-ramp</artifactId>
    <version>0.5.0.Final</version>
    <relativePath>../pom.xml</relativePath>
  </parent>
  <artifactId>s-ramp-javadoc</artifactId>
  <name>S-RAMP Javadoc</name>
  <description>API javadocs.</description>
  
  <dependencies>
    <dependency>
      <groupId>org.overlord.sramp</groupId>
      <artifactId>s-ramp-atom</artifactId>
    </dependency>
    <dependency>
      <groupId>org.overlord.sramp</groupId>
      <artifactId>s-ramp-client</artifactId>
    </dependency>
    <dependency>
      <groupId>org.overlord.sramp</groupId>
      <artifactId>s-ramp-common</artifactId>
    </dependency>
    <dependency>
      <groupId>org.overlord.sramp</groupId>
      <artifactId>s-ramp-shell-api</artifactId>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <configuration>
            <groups>
              <group>
                <title>S-RAMP Client</title>
                <packages>org.overlord.sramp.client*</packages>
              </group>
              <group>
                <title>S-RAMP Artifact Expander</title>
                <packages>org.overlord.sramp.atom.archive.expand.registry*</packages>
              </group>
              <group>
                <title>S-RAMP Artifact Deriver</title>
                <packages>org.overlord.sramp.common.derived*</packages>
              </group>
              <group>
                <title>S-RAMP Shell API</title>
                <packages>org.overlord.sramp.shell.api*</packages>
              </group>
            </groups>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-sources</id>
            <phase>generate-sources</phase>
            <configuration>
              <target>
                <mkdir dir="${project.build.directory}/sources" />
                <copy todir="${project.build.directory}/sources">
                  <fileset dir="..">
                    <!-- APIs + packages for arguments and return types -->
                    <include name="**/src/main/java/org/overlord/sramp/client/**/*.java" />
                    <include name="**/src/main/java/org/overlord/sramp/atom/archive/**/*.java" />
                    <include name="**/src/main/java/org/overlord/sramp/common/**/*.java" />
                    <include name="**/src/main/java/org/overlord/sramp/shell/api/*.java" />
                    
                    <include name="**/src/main/java/org/overlord/sramp/atom/client/**/*.java" />
                    <include name="**/src/main/java/org/overlord/sramp/atom/err/**/*.java" />
                    
                    <exclude name="**/i18n/**" />
                    <exclude name="**/internal/**" />
                  </fileset>
                </copy>
              </target>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <executions>
          <execution>
            <id>sramp-javadoc</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <sourcepath>${project.build.directory}/sources</sourcepath>
              <outputDirectory>${project.build.directory}/api</outputDirectory>
              <attach>true</attach>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <minmemory>128m</minmemory>
          <maxmemory>768m</maxmemory>
          <header>Overlord S-RAMP</header>
          <footer>Overlord S-RAMP</footer>
          <doctitle>Overlord S-RAMP ${project.version} API</doctitle>
          <notimestamp>true</notimestamp>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

