<?xml version="1.0" encoding="UTF-8"?>
<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.exoplatform.platform</groupId>
    <artifactId>exo.platform.doc</artifactId>
    <version>3.5.0-Beta3</version>
  </parent>
  <artifactId>exo.platform.doc.bundle</artifactId>
  <packaging>pom</packaging>
  <name>eXo Platform - Docs package</name>
  <profiles>
    <profile>
      <id>distrib</id>
      <dependencies>
        <!-- Admin guide -->
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>exo.platform.doc.admin</artifactId>
          <version>${project.version}</version>
          <classifier>html</classifier>
          <type>zip</type>
        </dependency>
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>exo.platform.doc.admin</artifactId>
          <version>${project.version}</version>
          <type>pdf</type>
        </dependency>
        <!-- Dev guide -->
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>exo.platform.doc.developer</artifactId>
          <version>${project.version}</version>
          <classifier>html</classifier>
          <type>zip</type>
        </dependency>
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>exo.platform.doc.developer</artifactId>
          <version>${project.version}</version>
          <type>pdf</type>
        </dependency>
        <!-- Ref guide -->
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>exo.platform.doc.refguide</artifactId>
          <version>${project.version}</version>
          <classifier>html</classifier>
          <type>zip</type>
        </dependency>
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>exo.platform.doc.refguide</artifactId>
          <version>${project.version}</version>
          <type>pdf</type>
        </dependency>
        <!-- GateIn user guide -->
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>exo.platform.doc.user.gatein</artifactId>
          <version>${project.version}</version>
          <type>zip</type>
        </dependency>
        <!-- Social user guide -->
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>exo.platform.doc.user.social</artifactId>
          <version>${project.version}</version>
          <type>pdf</type>
        </dependency>
        <!-- Collaboration user guide -->
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>exo.platform.doc.user.collaboration</artifactId>
          <version>${project.version}</version>
          <type>pdf</type>
        </dependency>
        <!-- Knowledge user guide -->
        <dependency>
          <groupId>${project.groupId}</groupId>
          <artifactId>exo.platform.doc.user.knowledge</artifactId>
          <version>${project.version}</version>
          <type>pdf</type>
        </dependency>
        <!--dependency>
          <groupId>org.gatein.doc</groupId>
          <artifactId>gatein-reference-guide-en</artifactId>
          <version>${org.exoplatform.portal.version}</version>
          <type>jdocbook</type>
        </dependency>
        <dependency>
          <groupId>org.exoplatform.jcr</groupId>
          <artifactId>reference-docs-en</artifactId>
          <version>${org.exoplatform.jcr.version}</version>
          <type>jdocbook</type>
        </dependency-->
      </dependencies>
      <build>
        <finalName>eXo-Platform-docs-${project.version}</finalName>
        <plugins>
          <!--
            1) Unpack the Zip archives that contain HTML files
           -->
		  <plugin>
		    <groupId>org.apache.maven.plugins</groupId>
		    <artifactId>maven-dependency-plugin</artifactId>
		    <executions>
		       <execution>
		         <id>01-unpack</id>
		         <phase>prepare-package</phase>
		         <goals>
		           <goal>unpack</goal>
		         </goals>
		         <configuration>
		           <artifactItems>
                     <!-- Admin Guide -->
		             <artifactItem>
                       <groupId>${project.groupId}</groupId>
                       <artifactId>exo.platform.doc.admin</artifactId>
                       <version>${project.version}</version>
                       <classifier>html</classifier>
                       <type>zip</type>
		               <outputDirectory>${project.build.directory}/work/admin-guide/html</outputDirectory>
		             </artifactItem>
                     <!-- Developers Guide -->
		             <artifactItem>
                       <groupId>${project.groupId}</groupId>
                       <artifactId>exo.platform.doc.developer</artifactId>
                       <version>${project.version}</version>
                       <classifier>html</classifier>
                       <type>zip</type>
		               <outputDirectory>${project.build.directory}/work/developer-guide/html</outputDirectory>
		             </artifactItem>
                     <!-- Reference Guide -->
		             <artifactItem>
                       <groupId>${project.groupId}</groupId>
                       <artifactId>exo.platform.doc.refguide</artifactId>
                       <version>${project.version}</version>
                       <classifier>html</classifier>
                       <type>zip</type>
		               <outputDirectory>${project.build.directory}/work/reference/html</outputDirectory>
		             </artifactItem>
		           </artifactItems>
		         </configuration>
		       </execution>
          <!--
            2) Copy the PDFs files
           -->
		      <execution>
		        <id>02-copy</id>
		        <phase>prepare-package</phase>
		        <goals>
		          <goal>copy</goal>
		        </goals>
		        <configuration>
		          <artifactItems>
                     <!-- Admin Guide -->
		             <artifactItem>
                       <groupId>${project.groupId}</groupId>
                       <artifactId>exo.platform.doc.admin</artifactId>
                       <version>${project.version}</version>
                       <type>pdf</type>
		               <outputDirectory>${project.build.directory}/work/admin-guide/pdf</outputDirectory>
		               <destFileName>eXo-Administration-Guide.pdf</destFileName>
		             </artifactItem>
                     <!-- Developers Guide -->
		             <artifactItem>
                       <groupId>${project.groupId}</groupId>
                       <artifactId>exo.platform.doc.developer</artifactId>
                       <version>${project.version}</version>
                       <type>pdf</type>
		               <outputDirectory>${project.build.directory}/work/developer-guide/pdf</outputDirectory>
		              <destFileName>eXo-Developers-Guide.pdf</destFileName>
		             </artifactItem>
                     <!-- Reference Guide -->
		             <artifactItem>
                       <groupId>${project.groupId}</groupId>
                       <artifactId>exo.platform.doc.refguide</artifactId>
                       <version>${project.version}</version>
                       <type>pdf</type>
		               <outputDirectory>${project.build.directory}/work/reference/pdf</outputDirectory>
		              <destFileName>eXo-Reference-Guide.pdf</destFileName>
		             </artifactItem>
                    <!-- PLF-986: bundle the WCM user guide in docbook -->
		            <artifactItem>
		              <groupId>org.exoplatform.ecms</groupId>
		              <artifactId>exo-ecms-docs-userguide</artifactId>
		              <version>${org.exoplatform.ecms.version}</version>
		              <type>pdf</type>
		              <outputDirectory>${project.build.directory}/work/user-guide</outputDirectory>
		              <destFileName>eXo-Content-User-Guide.pdf</destFileName>
		            </artifactItem>
                    <!-- PLF-1721: bundle the Social, Collaboration and Knowledge user guides in wikbook -->
                    <artifactItem>
		              <groupId>org.exoplatform.platform</groupId>
		              <artifactId>exo.platform.doc.user.social</artifactId>
		              <version>${project.version}</version>
		              <type>pdf</type>
		              <outputDirectory>${project.build.directory}/work/user-guide</outputDirectory>
		              <destFileName>eXo-Social-User-Guide.pdf</destFileName>
		            </artifactItem>
                    <artifactItem>
		              <groupId>org.exoplatform.platform</groupId>
		              <artifactId>exo.platform.doc.user.collaboration</artifactId>
		              <version>${project.version}</version>
		              <type>pdf</type>
		              <outputDirectory>${project.build.directory}/work/user-guide</outputDirectory>
		              <destFileName>eXo-Collaboration-User-Guide.pdf</destFileName>
		            </artifactItem>
                    <artifactItem>
		              <groupId>org.exoplatform.platform</groupId>
		              <artifactId>exo.platform.doc.user.knowledge</artifactId>
		              <version>${project.version}</version>
		              <type>pdf</type>
		              <outputDirectory>${project.build.directory}/work/user-guide</outputDirectory>
		              <destFileName>eXo-Knowledge-User-Guide.pdf</destFileName>
		            </artifactItem>
		          </artifactItems>
		        </configuration>
		      </execution>
		    </executions>
		  </plugin>
          <!--
            3) Assemble the final Zip archive
           -->
          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <executions>
              <execution>
                <id>03-package</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
                <configuration>
                  <descriptors>
                    <descriptor>src/main/assembly/docs-archive.xml</descriptor>
                  </descriptors>
                  <appendAssemblyId>false</appendAssemblyId>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
