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

    Licensed to the Austrian Association for Software Tool Integration (AASTI)
    under one or more contributor license agreements. See the NOTICE file
    distributed with this work for additional information regarding copyright
    ownership. The AASTI licenses this file to you under the Apache License,
    Version 2.0 (the "License"); you may not use this file except in compliance
    with the License. You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->

<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.openengsb.docs</groupId>
    <artifactId>openengsb-docs-parent</artifactId>
    <version>1.2.2.RELEASE</version>
  </parent>

  <groupId>org.openengsb.docs</groupId>
  <artifactId>openengsb-docs-homepage</artifactId>
  <version>1.2.2.RELEASE</version>
  <name>OpenEngSB :: Documentation :: Homepage</name>
  <packaging>pom</packaging>

  <description>Homepage for the Open Engineering Service Bus</description>

  <url>http://www.openengsb.org</url>
  <licenses>
    <license>
      <name>Apache 2</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <scm>
    <connection>scm:git:git://github.com/openengsb/openengsb-framework.git</connection>
    <developerConnection>scm:git:git@github.com:openengsb/openengsb-framework.git</developerConnection>
    <url>http://github.com/openengsb/openengsb-framework</url>
  </scm>

  <properties>
    <!-- stable releases -->
    <stable.version>${openengsb.version.stable}</stable.version>

    <stable.binary>${repos.final}/org/openengsb/openengsb/${stable.version}</stable.binary>
    <stable.binary.win>${stable.binary}/openengsb-${stable.version}.zip</stable.binary.win>
    <stable.binary.unix>${stable.binary}/openengsb-${stable.version}.tar.gz</stable.binary.unix>

    <stable.source>${repos.source}/openengsb/openengsb</stable.source>
    <stable.source.dir>${stable.source}/downloads</stable.source.dir>
    <stable.source.zip>${stable.source}/zipball/openengsb-${stable.version}</stable.source.zip>
    <stable.source.tar>${stable.source}/tarball/openengsb-${stable.version}</stable.source.tar>

    <!-- development releases -->
    <dev.version>${openengsb.version.dev}</dev.version>

    <dev.binary>${repos.final}/org/openengsb/openengsb/${dev.version}</dev.binary>
    <dev.binary.win>${dev.binary}/openengsb-${dev.version}.zip</dev.binary.win>
    <dev.binary.unix>${dev.binary}/openengsb-${dev.version}.tar.gz</dev.binary.unix>

    <dev.source>${repos.source}/openengsb/openengsb</dev.source>
    <dev.source.dir>${dev.source}/downloads</dev.source.dir>
    <dev.source.zip>${dev.source}/zipball/openengsb-${dev.version}</dev.source.zip>
    <dev.source.tar>${dev.source}/tarball/openengsb-${dev.version}</dev.source.tar>

    <!-- nightly releases -->
    <nightly.version>${openengsb.version.nightly}</nightly.version>
    <nightly.binary>${repos.snapshot}/org/openengsb/openengsb/${nightly.version}</nightly.binary>
    <nightly.binary.dir>${nightly.binary}</nightly.binary.dir>
  </properties>

  <profiles>
    <profile>
      <id>nightly</id>
      <properties>
        <latestWin>${repos.snapshot}/org/openengsb/openengsb/${project.version}/</latestWin>
        <latestUnix>${repos.snapshot}/org/openengsb/openengsb/${project.version}/</latestUnix>
        <older>${repos.snapshot}/org/openengsb/openengsb/${project.version}/</older>
      </properties>
      <distributionManagement>
        <site>
          <id>OpenengsbWebServer</id>
          <url>scp://openengsb.org/var/www/openengsb/nightly</url>
        </site>
      </distributionManagement>
    </profile>
    <profile>
      <id>milestone</id>
      <properties>
        <latestWin>${repos.final}/org/openengsb/openengsb/${project.version}/openengsb-${project.version}.zip</latestWin>
        <latestUnix>${repos.final}/org/openengsb/openengsb/${project.version}/openengsb-${project.version}.tar.gz</latestUnix>
        <older>${repos.final}/org/openengsb/openengsb/</older>
      </properties>
      <distributionManagement>
        <site>
          <id>OpenengsbWebServer</id>
          <url>scp://openengsb.org/var/www/openengsb/milestone</url>
        </site>
      </distributionManagement>
    </profile>
    <profile>
      <id>rc</id>
      <properties>
        <latestWin>${repos.final}/org/openengsb/openengsb/${project.version}/openengsb-${project.version}.zip</latestWin>
        <latestUnix>${repos.final}/org/openengsb/openengsb/${project.version}/openengsb-${project.version}.tar.gz</latestUnix>
        <older>${repos.final}/org/openengsb/openengsb/</older>
      </properties>
      <distributionManagement>
        <site>
          <id>OpenengsbWebServer</id>
          <url>scp://openengsb.org/var/www/openengsb/rc</url>
        </site>
      </distributionManagement>
    </profile>
    <profile>
      <id>final</id>
      <properties>
        <latestWin>${repos.final}/org/openengsb/openengsb/${project.version}/openengsb-${project.version}.zip</latestWin>
        <latestUnix>${repos.final}/org/openengsb/openengsb/${project.version}/openengsb-${project.version}.tar.gz</latestUnix>
        <older>${repos.final}/org/openengsb/openengsb/</older>
      </properties>
      <distributionManagement>
        <site>
          <id>OpenengsbWebServer</id>
          <url>scp://openengsb.org/var/www/openengsb</url>
        </site>
      </distributionManagement>
    </profile>
    <profile>
      <id>support</id>
      <properties>
        <latestWin>${repos.final}/org/openengsb/openengsb/${project.version}/openengsb-${project.version}.zip</latestWin>
        <latestUnix>${repos.final}/org/openengsb/openengsb/${project.version}/openengsb-${project.version}.tar.gz</latestUnix>
        <older>${repos.final}/org/openengsb/openengsb/</older>
      </properties>
      <distributionManagement>
        <site>
          <id>OpenengsbWebServer</id>
          <url>scp://openengsb.org/var/www/openengsb/support</url>
        </site>
      </distributionManagement>
    </profile>
  </profiles>

  <build>
    <resources>
      <resource>
        <directory>${project.basedir}/src/site</directory>
        <filtering>true</filtering>
        <includes>
          <include>**/*</include>
        </includes>
        <excludes>
          <exclude>**/*.pdf</exclude>
        </excludes>
      </resource>
      <resource>
        <directory>${project.basedir}/src/site</directory>
        <filtering>false</filtering>
        <includes>
          <include>**/*.pdf</include>
        </includes>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <configuration>
          <useDefaultDelimiters>false</useDefaultDelimiters>
          <delimiters>
            <delimiter>${*}</delimiter>
          </delimiters>
        </configuration>
        <executions>
          <execution>
            <id>filter</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>resources</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>unpack</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.openengsb.docs</groupId>
                  <artifactId>openengsb-docs-manual</artifactId>
                  <version>${project.version}</version>
                  <type>zip</type>
                  <classifier>html-multi</classifier>
                </artifactItem>
                <artifactItem>
                  <groupId>org.openengsb.docs</groupId>
                  <artifactId>openengsb-docs-manual</artifactId>
                  <version>${project.version}</version>
                  <type>zip</type>
                  <classifier>html-single</classifier>
                </artifactItem>
                <artifactItem>
                  <groupId>org.openengsb.docs</groupId>
                  <artifactId>openengsb-docs-manual</artifactId>
                  <version>${project.version}</version>
                  <type>zip</type>
                  <classifier>pdf</classifier>
                </artifactItem>
              </artifactItems>
              <outputDirectory>${project.build.directory}</outputDirectory>
              <overWriteReleases>true</overWriteReleases>
              <overWriteSnapshots>true</overWriteSnapshots>
              <stripVersion>true</stripVersion>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>net.sourceforge.docbook-utils.maven-plugin</groupId>
        <artifactId>maven-tidy-plugin</artifactId>
        <version>1.0.0.beta-1</version>
        <executions>
          <execution>
            <phase>process-resources</phase>
            <goals>
              <goal>tidy</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <sourceDir>${project.build.directory}/openengsb-docs-manual-${project.version}/manual/html-multi/</sourceDir>
          <destinationDir>${project.build.directory}/generated-site/xhtml/docbook</destinationDir>
          <replaceExtensionMap>
            <html>xhtml</html>
          </replaceExtensionMap>
          <jtidyConfiguration>
            <property>
               <name>output-encoding</name>
               <value>UTF-8</value>
             </property>
             <property>
               <name>add-xml-space</name>
               <value>true</value>
             </property>
             <property>
               <name>char-encoding</name>
               <value>UTF-8</value>
             </property>
             <property>
               <name>quiet</name>
               <value>true</value>
             </property>
             <property>
               <name>quote-nbsp</name>
               <value>false</value>
             </property>
             <property>
               <name>output-xhtml</name>
               <value>true</value>
             </property>
             <property>
               <name>indent</name>
               <value>true</value>
             </property>
             <property>
               <name>write-back</name>
               <value>true</value>
             </property>
             <property>
               <name>wrap</name>
               <value>68</value>
             </property>
          </jtidyConfiguration>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <dependencies>
          <dependency>
            <groupId>org.apache.maven.doxia</groupId>
            <artifactId>doxia-module-xhtml</artifactId>
            <version>1.1.4</version>
          </dependency>
        </dependencies>
        <configuration>
          <siteDirectory>${basedir}/target/classes</siteDirectory>
          <outputEncoding>UTF-8</outputEncoding>
          <reportPlugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-project-info-reports-plugin</artifactId>
              <version>${maven.plugin.project.info.reports.version}</version>
              <configuration>
                <webAccessUrl>http://github.com/openengsb/openengsb</webAccessUrl>
                <anonymousConnection>scm:git:git://github.com/openengsb/openengsb.git</anonymousConnection>
                <developerConnection>scm:git:git@github.com:openengsb/openengsb-framework.git</developerConnection>
              </configuration>
              <reportSets>
                <reportSet>
                  <reports>
                    <report>project-team</report>
                    <report>mailing-list</report>
                    <report>cim</report>
                    <report>issue-tracking</report>
                    <report>license</report>
                    <report>scm</report>
                  </reports>
                </reportSet>
              </reportSets>
            </plugin>
          </reportPlugins>
        </configuration>
        <executions>
          <execution>
            <id>mvnSite</id>
            <phase>package</phase>
            <goals>
              <goal>site</goal>
            </goals>
          </execution>
          <execution>
            <id>mvnDeploy</id>
            <phase>deploy</phase>
            <goals>
              <goal>deploy</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-manual-resources</id>
            <phase>package</phase>
            <configuration>
              <target>
                <copy todir="${basedir}/target/site/docbook">
                  <fileset dir="${project.build.directory}/openengsb-docs-manual-${project.version}/manual/html-multi/">
                    <exclude name="**/*.html" />
                  </fileset>
                </copy>
              </target>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
          <execution>
            <phase>package</phase>
            <configuration>
              <target>
                <copy todir="${basedir}/target/site/">
                  <fileset dir="${basedir}/target/openengsb-docs-manual-${project.version}/">
                    <include name="**/*" />
                  </fileset>
                </copy>
              </target>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>

