<?xml version="1.0" encoding="UTF-8"?>
<!--
  ! CCPL HEADER START
  !
  ! This work is licensed under the Creative Commons
  ! Attribution-NonCommercial-NoDerivs 3.0 Unported License.
  ! To view a copy of this license, visit
  ! http://creativecommons.org/licenses/by-nc-nd/3.0/
  ! or send a letter to Creative Commons, 444 Castro Street,
  ! Suite 900, Mountain View, California, 94041, USA.
  !
  ! You can also obtain a copy of the license at
  ! src/main/resources/legal-notices/CC-BY-NC-ND.txt.
  ! See the License for the specific language governing permissions
  ! and limitations under the License.
  !
  ! If applicable, add the following below this CCPL HEADER, with the fields
  ! enclosed by brackets "[]" replaced with your own identifying information:
  !      Portions Copyright [yyyy] [name of copyright owner]
  !
  ! CCPL HEADER END
  !
  !      Copyright 2011 ForgeRock AS
  !    
-->
<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.forgerock</groupId>
  <artifactId>forgerock-parent</artifactId>
  <version>1.0.0-SNAPSHOT</version>
 </parent>
  <repositories>
    <repository>
      <id>forgerock-staging-repository</id>
      <name>ForgeRock Release Repository</name>
      <url>http://maven.forgerock.org/repo/releases</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>forgerock-snapshots-repository</id>
      <name>ForgeRock Snapshot Repository</name>
      <url>http://maven.forgerock.org/repo/snapshots</url>
      <releases>
        <enabled>false</enabled>
      </releases>
    </repository>
  </repositories>
 <groupId>org.forgerock.openam</groupId>
 <artifactId>openam-site</artifactId>
 <version>10.0.0-SNAPSHOT</version>
 <name>OpenAM Project</name>
 <inceptionYear>2011</inceptionYear>
 <packaging>pom</packaging>
 <description>DocBook XML source for OpenAM core user documentation. Java API reference documentation is generated from OpenAM source code.</description>
 <url>http://openam.forgerock.org/</url>
 <mailingLists>
  <mailingList>
   <name>OpenAM Users Mailing List</name>
   <archive>http://lists.forgerock.org/pipermail/openam/</archive>
   <subscribe>https://lists.forgerock.org/mailman/listinfo/openam/</subscribe>
   <unsubscribe>https://lists.forgerock.org/mailman/listinfo/openam/</unsubscribe>
   <post>openam@forgerock.org</post>
  </mailingList>
  <mailingList>
   <name>OpenAM Developers Mailing List</name>
   <archive>http://lists.forgerock.org/pipermail/openam-dev/</archive>
   <subscribe>https://lists.forgerock.org/mailman/listinfo/openam-dev/</subscribe>
   <unsubscribe>https://lists.forgerock.org/mailman/listinfo/openam-dev/</unsubscribe>
   <post>openam-dev@forgerock.org</post>
  </mailingList>
  <mailingList>
   <name>OpenAM Commit Notifications</name>
   <archive>http://lists.forgerock.org/pipermail/commitopenam/</archive>
   <subscribe>https://lists.forgerock.org/mailman/listinfo/commitopenam/</subscribe>
   <unsubscribe>https://lists.forgerock.org/mailman/listinfo/commitopenam/</unsubscribe>
   <post>commitopenam@forgerock.org</post>
  </mailingList>
 </mailingLists>
 <scm>
  <url>https://svn.forgerock.org/openam/trunk/opensso/</url>
  <connection>scm:svn:https://svn.forgerock.org/openam/trunk/opensso/</connection>
  <developerConnection>scm:svn:https://svn.forgerock.org/openam/trunk/opensso/</developerConnection>
  <tag>HEAD</tag>
 </scm>
 <issueManagement>
  <system>Jira</system>
  <url>https://bugster.forgerock.org/jira/browse/OPENAM</url>
 </issueManagement>
 <licenses>
  <license>
   <name>CC BY-NC-ND 3.0</name>
   <url>http://creativecommons.org/licenses/by-nc-nd/3.0/</url>
   <comments>Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported</comments>
   <distribution>repo</distribution>
  </license>
  <license>
   <name>CDDL-1.0</name>
   <url>http://www.opensource.org/licenses/cddl1.php</url>
   <comments>Common Development and Distribution License (CDDL) 1.0</comments>
   <distribution>repo</distribution>
  </license>
 </licenses>
 <properties>
  <docbkx-src>${basedir}/src/main/docbkx</docbkx-src>
  <dbstyle-dir>${basedir}/src/main/docbkx-stylesheets</dbstyle-dir>
  <docbkx-out>${basedir}/target/docbkx</docbkx-out>
  <site-out>${basedir}/target/site</site-out>
  <siteDistributionURL>scp://forgerock.org/var/www/vhosts/openam.forgerock.org/httpdocs</siteDistributionURL>
 </properties>
 <distributionManagement>
  <site>
   <id>forgerock.org</id>
   <name>OpenAM Project</name>
   <url>${siteDistributionURL}</url>
  </site>
 </distributionManagement>
 <build>
  <plugins>
   <plugin>
    <groupId>com.agilejava.docbkx</groupId>
    <artifactId>docbkx-maven-plugin</artifactId>
    <version>2.0.13</version>
    <executions>
     <execution>
      <id>build-doc</id>
      <phase>pre-site</phase>
      <inherited>false</inherited>
      <goals>
       <goal>generate-epub</goal>
       <goal>generate-html</goal>
       <goal>generate-pdf</goal>
       <goal>generate-rtf</goal>
       <goal>generate-manpages</goal>
      </goals>
      <configuration>
       <sourceDirectory>${basedir}/src/main/docbkx</sourceDirectory>
      
       <!-- Comment the draft elements out for final build -->
       <draftMode>yes</draftMode>
       <draftWatermarkImage>http://docbook.sourceforge.net/release/images/draft.png</draftWatermarkImage>
       
       <includes>*/OpenAM-*.xml</includes>
       <xincludeSupported>true</xincludeSupported>
       
       <sectionAutolabel>true</sectionAutolabel>
       <sectionLabelIncludesComponentLabel>true</sectionLabelIncludesComponentLabel>
       
       <!-- EPUB, HTML -->
       <chunkedOutput>false</chunkedOutput>
       <htmlCustomization>${dbstyle-dir}/html/coredoc.xsl</htmlCustomization>
       <htmlStylesheet>css/coredoc.css</htmlStylesheet>
  
       <!-- PDF, RTF -->
       <foCustomization>${dbstyle-dir}/fo/coredoc.xsl</foCustomization>
       
       <!-- Copy images, CSS for HTML, TODO: What's foreach in ant? -->
       <preProcess>
        <copy todir='${docbkx-out}/html/admin-guide/images'>
         <fileset dir='${docbkx-src}/admin-guide/images' />
        </copy>
        <copy todir='${docbkx-out}/html/admin-guide'>
         <fileset dir='src/main/resources' />
        </copy>
        <copy todir='${docbkx-out}/html/agent-install-guide/images'>
         <fileset dir='${docbkx-src}/agent-install-guide/images' />
        </copy>
        <copy todir='${docbkx-out}/html/agent-install-guide'>
         <fileset dir='src/main/resources' />
        </copy>
        <copy todir='${docbkx-out}/html/dev-guide/images'>
         <fileset dir='${docbkx-src}/dev-guide/images' />
        </copy>
        <copy todir='${docbkx-out}/html/dev-guide'>
         <fileset dir='src/main/resources' />
        </copy>
        <copy todir='${docbkx-out}/html/install-guide/images'>
         <fileset dir='${docbkx-src}/install-guide/images' />
        </copy>
        <copy todir='${docbkx-out}/html/install-guide'>
         <fileset dir='src/main/resources' />
        </copy>
        <copy todir='${docbkx-out}/html/reference/images'>
         <fileset dir='${docbkx-src}/reference/images' />
        </copy>
        <copy todir='${docbkx-out}/html/reference'>
         <fileset dir='src/main/resources' />
        </copy>
        <copy todir='${docbkx-out}/html/release-notes/images'>
         <fileset dir='${docbkx-src}/release-notes/images' />
        </copy>
        <copy todir='${docbkx-out}/html/release-notes'>
         <fileset dir='src/main/resources' />
        </copy>
       </preProcess>
      </configuration>
     </execution>
    </executions>
    <dependencies>
     <dependency>
      <groupId>net.sf.docbook</groupId>
      <artifactId>docbook-xml</artifactId>
      <version>5.0-all</version>
      <classifier>resources</classifier>
      <type>zip</type>
      <scope>runtime</scope>
     </dependency>
     <dependency>
      <groupId>net.sf.offo</groupId>
      <artifactId>fop-hyph</artifactId>
      <version>1.2</version> <!-- Should use 2.0, but it doesn't exist -->
      <scope>runtime</scope>
     </dependency>
    </dependencies>
   </plugin>
   <plugin>
    <artifactId>maven-antrun-plugin</artifactId>
    <executions>
     <execution>
      <id>fix-legalnotice</id>
      <phase>site</phase>
      <inherited>false</inherited>
      <goals>
       <goal>run</goal>
      </goals>
      <configuration>
       <detail>true</detail>
       <tasks>
        <!-- TODO: Figure out how to say foreach in ant. -->
        <copy file='${basedir}/legalnotice.html' todir='${basedir}/target/docbkx/html/admin-guide' />
        <copy file='${basedir}/legalnotice.html' todir='${basedir}/target/docbkx/html/agent-install-guide' />
        <copy file='${basedir}/legalnotice.html' todir='${basedir}/target/docbkx/html/dev-guide' />
        <copy file='${basedir}/legalnotice.html' todir='${basedir}/target/docbkx/html/install-guide' />
        <copy file='${basedir}/legalnotice.html' todir='${basedir}/target/docbkx/html/reference' />
        <move file='${basedir}/legalnotice.html' todir='${basedir}/target/docbkx/html/release-notes' />
       </tasks>
      </configuration>
     </execution>
    </executions>
   </plugin>
   <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-resources-plugin</artifactId>
    <executions>
     <execution>
      <phase>site</phase>
      <inherited>false</inherited>
      <goals>
       <goal>copy-resources</goal>
      </goals>
      <configuration>
       <encoding>UTF-8</encoding>
       <outputDirectory>${site-out}/doc</outputDirectory>
       <resources>
        <resource>
         <directory>${docbkx-out}/epub/admin-guide</directory>
         <directory>${docbkx-out}/epub/agent-install-guide</directory>
         <directory>${docbkx-out}/epub/dev-guide</directory>
         <directory>${docbkx-out}/epub/install-guide</directory>
         <directory>${docbkx-out}/epub/reference</directory>
         <directory>${docbkx-out}/epub/release-notes</directory>
         <includes>
          <include>**/*.epub</include>
         </includes>
        </resource>
        <resource>
         <directory>${docbkx-out}/html/</directory>
        </resource>
        <resource>
         <directory>${docbkx-out}/pdf</directory>
         <includes>
          <include>**/*.pdf</include>
         </includes>
        </resource>
        <resource>
         <directory>${docbkx-out}/rtf</directory>
         <includes>
          <include>**/*.rtf</include>
         </includes>
        </resource>
       </resources>
      </configuration>      
     </execution>
    </executions>
   </plugin>
  </plugins>
 </build>
</project>
