<!--
  ~ Copyright (C) 2003-2009 eXo Platform SAS.
  ~
  ~ 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">

  <parent>
    <artifactId>crsh.doc</artifactId>
    <groupId>org.crsh</groupId>
    <version>1.2.0-cr8</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.crsh</groupId>
  <artifactId>crsh.doc.reference</artifactId>
  <packaging>jar</packaging>
  <version>1.2.0-cr8</version>

  <name>CRaSH reference documentation</name>
  <description>The CRaSH reference documentation</description>

  <properties>
    <wikbook.version>0.9.45</wikbook.version>
    <crash.version>${project.version}</crash.version>
    <wikbook.source>${pom.basedir}/src/main/wikbook</wikbook.source>
    <wikbook.target>${project.build.directory}/wikbook</wikbook.target>
  </properties>

  <dependencies>

    <dependency>
      <groupId>org.crsh</groupId>
      <artifactId>crsh.shell.core</artifactId>
      <classifier>standalone</classifier>
    </dependency>
    <dependency>
      <groupId>org.crsh</groupId>
      <artifactId>crsh.jcr.core</artifactId>
      <classifier>standalone</classifier>
    </dependency>
    <dependency>
      <groupId>org.crsh</groupId>
      <artifactId>crsh.shell.ssh</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.jcr</groupId>
      <artifactId>jcr</artifactId>
      <version>1.0</version>
    </dependency>
    <dependency>
      <groupId>org.exoplatform.jcr</groupId>
      <artifactId>exo.jcr.component.core</artifactId>
      <version>1.11.1</version>
    </dependency>

    <!-- -->
    <dependency>
      <groupId>org.wikbook</groupId>
      <artifactId>wikbook.docbkxstyle</artifactId>
      <version>${wikbook.version}</version>
    </dependency>

    <!-- Sources -->
    <dependency>
      <groupId>org.crsh</groupId>
      <artifactId>crsh.cli</artifactId>
      <classifier>sources</classifier>
    </dependency>
    <dependency>
      <groupId>org.crsh</groupId>
      <artifactId>crsh.shell.core</artifactId>
      <classifier>sources</classifier>
    </dependency>
    <dependency>
      <groupId>org.crsh</groupId>
      <artifactId>crsh.shell.telnet</artifactId>
      <classifier>sources</classifier>
    </dependency>
    <dependency>
      <groupId>org.crsh</groupId>
      <artifactId>crsh.shell.ssh</artifactId>
      <classifier>sources</classifier>
    </dependency>
    <dependency>
      <groupId>org.crsh</groupId>
      <artifactId>crsh.shell.embed.spring</artifactId>
      <classifier>sources</classifier>
    </dependency>
    <dependency>
      <groupId>org.crsh</groupId>
      <artifactId>crsh.jcr.core</artifactId>
      <classifier>sources</classifier>
    </dependency>
    <dependency>
      <groupId>org.crsh</groupId>
      <artifactId>crsh.jcr.exo</artifactId>
      <classifier>sources</classifier>
    </dependency>
    <dependency>
      <groupId>org.crsh</groupId>
      <artifactId>crsh.jcr.jackrabbit</artifactId>
      <classifier>sources</classifier>
    </dependency>
    <dependency>
      <groupId>org.crsh</groupId>
      <artifactId>crsh.plugins.crowd</artifactId>
      <classifier>sources</classifier>
    </dependency>

  </dependencies>

  <build>

    <plugins>

     <!-- Generate wikbook from CRaSH commands -->
     <plugin>
       <groupId>org.codehaus.mojo</groupId>
       <artifactId>exec-maven-plugin</artifactId>
       <executions>
         <execution>
           <goals>
             <goal>java</goal>
           </goals>
           <phase>prepare-package</phase>
         </execution>
       </executions>
       <configuration>
         <mainClass>org.crsh.doc.Generator</mainClass>
         <arguments>
           <argument>${wikbook.target}/man</argument>
         </arguments>
       </configuration>
     </plugin>

     <!-- The wikbook maven plugin generates the docbook document from the wiki source -->
     <plugin>
        <groupId>org.wikbook</groupId>
        <artifactId>wikbook.maven</artifactId>
        <version>${wikbook.version}</version>
        <executions>
          <execution>
            <phase>prepare-package</phase>
            <goals>
              <goal>transform</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <sourceDirectory>${wikbook.source}/en/en-US</sourceDirectory>
          <extraSourceDirectory>${wikbook.target}/man</extraSourceDirectory>
          <sourceFileName>book.wiki</sourceFileName>
          <destinationDirectory>${wikbook.target}/src</destinationDirectory>
          <destinationFileName>index.xml</destinationFileName>
          <emitDoctype>false</emitDoctype>
          <beforeBookBodyXML><![CDATA[<xi:include href="${basedir}/src/main/wikbook/en/en-US/bookinfo.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />]]></beforeBookBodyXML>
        </configuration>
     </plugin>

     <plugin>
       <groupId>org.wikbook</groupId>
       <artifactId>wikbook.docbkxstyle</artifactId>
       <version>${wikbook.version}</version>
       <configuration>
         <sourceDirectory>${wikbook.target}/src</sourceDirectory>
         <includes>index.xml</includes>
         <highlightSource>1</highlightSource>
         <xincludeSupported>true</xincludeSupported>
         <useExtensions>1</useExtensions>
         <calloutsExtension>1</calloutsExtension>
       </configuration>
       <executions>
         <execution>
           <id>generate-html</id>
           <goals>
             <goal>generate-html</goal>
           </goals>
           <phase>package</phase>
           <configuration>
             <targetDirectory>${wikbook.target}/output/html</targetDirectory>
             <htmlCustomization>xsl/bootstrap/html.xsl</htmlCustomization>
           </configuration>
         </execution>
         <execution>
           <id>generate-xhtml</id>
           <goals>
             <goal>generate-xhtml</goal>
           </goals>
           <phase>package</phase>
           <configuration>
             <targetDirectory>${wikbook.target}/output/xhtml</targetDirectory>
             <targetFileExtension>html</targetFileExtension>
             <xhtmlCustomization>xsl/simple/pdf.xsl</xhtmlCustomization>
           </configuration>
         </execution>
       </executions>
       <dependencies>
         <dependency>
           <groupId>org.docbook</groupId>
           <artifactId>docbook-xml</artifactId>
           <version>4.4</version>
           <scope>runtime</scope>
         </dependency>
       </dependencies>
     </plugin>

     <plugin>
       <groupId>org.wikbook</groupId>
       <artifactId>wikbook.html2pdf</artifactId>
       <version>${wikbook.version}</version>
       <executions>
         <execution>
           <phase>package</phase>
           <goals>
             <goal>transform</goal>
           </goals>
         </execution>
       </executions>
       <configuration>
         <sourceDirectory>${wikbook.target}/output/xhtml</sourceDirectory>
         <sourceFileName>index.html</sourceFileName>
         <destinationDirectory>${wikbook.target}/output/pdf</destinationDirectory>
         <destinationFileName>index.pdf</destinationFileName>
       </configuration>
     </plugin>

     <!-- Attach the HTML zip -->
     <plugin>
       <artifactId>maven-assembly-plugin</artifactId>
       <executions>
         <execution>
           <phase>package</phase>
           <goals>
             <goal>single</goal>
           </goals>
           <configuration>
             <descriptors>
               <descriptor>src/main/assembly/html.xml</descriptor>
               <descriptor>src/main/assembly/docbook.xml</descriptor>
             </descriptors>
           </configuration>
         </execution>
       </executions>
     </plugin>

     <!-- Attach the PDF -->
     <plugin>
       <groupId>org.codehaus.mojo</groupId>
       <artifactId>build-helper-maven-plugin</artifactId>
       <executions>
         <execution>
           <id>attach-artifacts</id>
           <phase>package</phase>
           <goals>
             <goal>attach-artifact</goal>
           </goals>
           <configuration>
             <artifacts>
               <artifact>
                 <file>target/wikbook/output/pdf/index.pdf</file>
                 <type>pdf</type>
               </artifact>
             </artifacts>
           </configuration>
         </execution>
       </executions>
     </plugin>

      <!-- Generate aggregated javadoc -->
      <plugin>
        <groupId>com.goldin.plugins</groupId>
        <artifactId>maven-copy-plugin</artifactId>
        <version>0.2.3</version>
        <executions>
          <execution>
            <id>unpack</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <resource>
                <targetPath>${project.build.directory}/sources</targetPath>
                <dependencies>
                  <dependency>
                    <groupId>org.crsh</groupId>
                    <artifactId>crsh.cli</artifactId>
                    <classifier>sources</classifier>
                  </dependency>
                  <dependency>
                    <groupId>org.crsh</groupId>
                    <artifactId>crsh.shell.core</artifactId>
                    <classifier>sources</classifier>
                  </dependency>
                  <dependency>
                    <groupId>org.crsh</groupId>
                    <artifactId>crsh.shell.telnet</artifactId>
                    <classifier>sources</classifier>
                  </dependency>
                  <dependency>
                    <groupId>org.crsh</groupId>
                    <artifactId>crsh.shell.ssh</artifactId>
                    <classifier>sources</classifier>
                  </dependency>
                  <dependency>
                    <groupId>org.crsh</groupId>
                    <artifactId>crsh.shell.embed.spring</artifactId>
                    <classifier>sources</classifier>
                  </dependency>
                  <dependency>
                    <groupId>org.crsh</groupId>
                    <artifactId>crsh.jcr.core</artifactId>
                    <classifier>sources</classifier>
                  </dependency>
                  <dependency>
                    <groupId>org.crsh</groupId>
                    <artifactId>crsh.jcr.exo</artifactId>
                    <classifier>sources</classifier>
                  </dependency>
                  <dependency>
                    <groupId>org.crsh</groupId>
                    <artifactId>crsh.jcr.jackrabbit</artifactId>
                    <classifier>sources</classifier>
                  </dependency>
                  <dependency>
                    <groupId>org.crsh</groupId>
                    <artifactId>crsh.plugins.crowd</artifactId>
                    <classifier>sources</classifier>
                  </dependency>
                </dependencies>
                <unpack>true</unpack>
              </resource>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <executions>
          <execution>
            <id>javadoc</id>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <sourcepath>${project.build.directory}/sources</sourcepath>
              <quiet>true</quiet>
              <linksource>true</linksource>
              <show>private</show>
            </configuration>
            <phase>process-sources</phase>
          </execution>
        </executions>
      </plugin>

    </plugins>

   </build>

</project>
