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

    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">

  <parent>
    <groupId>org.openengsb</groupId>
    <artifactId>openengsb-bundle-settings</artifactId>
    <version>2.3.0</version>
    <relativePath>../bundle/</relativePath>
  </parent>

  <modelVersion>4.0.0</modelVersion>
  <groupId>org.openengsb.domain</groupId>
  <artifactId>openengsb-domain-parent</artifactId>
  <version>2.3.0</version>

  <name>OpenEngSB :: Domain :: Parent</name>

  <packaging>pom</packaging>

  <description>Parent project for all OpenEngSB Domains</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>

  <build>
    <resources>
      <resource>
        <directory>src/manual</directory>
        <filtering>true</filtering>
      </resource>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
      <resource>
        <directory>${project.basedir}/src/main/filtered-resources</directory>
        <filtering>true</filtering>
        <includes>
          <include>**/*</include>
        </includes>
      </resource>
    </resources>
    <pluginManagement>
      <plugins>
        <plugin>
        <groupId>org.openengsb</groupId>
        <artifactId>openengsb-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>generateDocSrc</id>
            <goals>
              <goal>extractSource</goal>
            </goals>
            <phase>generate-sources</phase>
            <configuration>
              <sourcePath>${project.basedir}/src/</sourcePath>
              <targetPath>${project.basedir}/target/classes/docbook/snippets</targetPath>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <!-- Documentation -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>unpack</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.openengsb</groupId>
                  <artifactId>openengsb-manual-builder-resources</artifactId>
                  <outputDirectory>${project.build.directory}/manual-resources</outputDirectory>
                </artifactItem>
                <artifactItem>
                  <groupId>org.openengsb</groupId>
                  <artifactId>openengsb-assembly-builder-resources</artifactId>
                  <outputDirectory>${project.build.directory}/assembly-resources</outputDirectory>
                </artifactItem>
              </artifactItems>
              <overWriteReleases>false</overWriteReleases>
              <overWriteSnapshots>true</overWriteSnapshots>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.agilejava.docbkx</groupId>
        <artifactId>docbkx-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>html-single</id>
            <goals>
              <goal>generate-html</goal>
            </goals>
            <configuration>
              <xincludeSupported>true</xincludeSupported>
              <chunkedOutput>false</chunkedOutput>
              <htmlCustomization>${project.build.directory}/manual-resources/xsl/html.xsl</htmlCustomization>
              <preProcess>
                <delete dir="${basedir}/target/docbkx/html" />
              </preProcess>
              <postProcess>
                <copy todir="${basedir}/target/docbkx/html">
                  <fileset dir="${project.build.directory}/manual-resources">
                    <include name="**/*.css" />
                    <include name="**/*.png" />
                    <include name="**/*.gif" />
                    <include name="**/*.jpg" />
                  </fileset>
                </copy>
                <copy todir="${basedir}/target/docbkx/html/graphics" flatten="true">
                  <fileset dir="${project.build.directory}/classes">
                    <exclude name="resources/**" />
                    <include name="**/*.png" />
                    <include name="**/*.gif" />
                    <include name="**/*.jpg" />
                  </fileset>
                </copy>
                <copy todir="${basedir}/target/manual/html-single">
                  <fileset dir="${basedir}/target/docbkx/html">
                    <include name="**/*" />
                  </fileset>
                </copy>
              </postProcess>
            </configuration>
            <phase>compile</phase>
          </execution>
          <execution>
            <id>html-multi</id>
            <goals>
              <goal>generate-html</goal>
            </goals>
            <configuration>
              <xincludeSupported>true</xincludeSupported>
              <chunkedOutput>true</chunkedOutput>
              <htmlCustomization>${project.build.directory}/manual-resources/xsl/html_chunk.xsl</htmlCustomization>
              <preProcess>
                <delete dir="${basedir}/target/docbkx/html" />
              </preProcess>
              <postProcess>
                <copy todir="${basedir}/target/docbkx/html">
                  <fileset dir="${project.build.directory}/manual-resources">
                    <include name="**/*.css" />
                    <include name="**/*.png" />
                    <include name="**/*.gif" />
                    <include name="**/*.jpg" />
                  </fileset>
                </copy>
                <copy todir="${basedir}/target/docbkx/html/graphics" flatten="true">
                  <fileset dir="${project.build.directory}/classes/">
                    <exclude name="resources/**" />
                    <include name="**/*.png" />
                    <include name="**/*.gif" />
                    <include name="**/*.jpg" />
                  </fileset>
                </copy>
                <copy todir="${basedir}/target/manual/html-multi">
                  <fileset dir="${basedir}/target/docbkx/html">
                    <include name="*/**" />
                  </fileset>
                </copy>
                <copy todir="${basedir}/target/manual/html-multi">
                  <fileset dir="${basedir}/target/docbkx/html/${project.artifactId}">
                    <include name="**/*" />
                  </fileset>
                </copy>
              </postProcess>
            </configuration>
            <phase>compile</phase>
          </execution>
          <execution>
            <id>pdf-single</id>
            <goals>
              <goal>generate-pdf</goal>
            </goals>
            <configuration>
              <xincludeSupported>true</xincludeSupported>
              <foCustomization>${project.build.directory}/manual-resources/xsl/fopdf.xsl</foCustomization>
              <imgSrcPath>file:///${basedir}/target/classes/</imgSrcPath>
              <postProcess>
                <copy todir="${basedir}/target/manual/pdf">
                  <fileset dir="${basedir}/target/docbkx/pdf">
                    <include name="**/*.pdf" />
                  </fileset>
                </copy>
              </postProcess>
            </configuration>
            <phase>compile</phase>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>net.sf.docbook</groupId>
            <artifactId>docbook-xml</artifactId>
            <version>${docbkx.xml.version}</version>
            <scope>runtime</scope>
            <classifier>resources</classifier>
            <type>zip</type>
          </dependency>
          <dependency>
            <groupId>com.sun</groupId>
            <artifactId>jai_core</artifactId>
            <version>${jai.version}</version>
            <scope>runtime</scope>
          </dependency>
          <dependency>
            <groupId>com.sun</groupId>
            <artifactId>jai_codec</artifactId>
            <version>${jai.version}</version>
            <scope>runtime</scope>
          </dependency>
        </dependencies>
        <configuration>
          <includes>${project.artifactId}.xml</includes>
          <htmlStylesheet>css/html.css</htmlStylesheet>
          <xincludeSupported>true</xincludeSupported>
          <sourceDirectory>${basedir}/target/classes</sourceDirectory>
          <!--<generatedSourceDirectory>${basedir}/target/classes</generatedSourceDirectory>-->
          <useExtensions>1</useExtensions>
          <highlightSource>1</highlightSource>
          <highlightDefaultLanguage />
          <calloutsExtension>1</calloutsExtension>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <descriptors>
            <descriptor>${project.basedir}/target/assembly-resources/src.xml</descriptor>
            <descriptor>${project.basedir}/target/assembly-resources/docbook.xml</descriptor>
            <descriptor>${project.basedir}/target/assembly-resources/manual.xml</descriptor>
          </descriptors>
        </configuration>
        <executions>
          <execution>
            <id>make-src-assembly</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>wagon-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>upload-manual</id>
            <phase>deploy</phase>
            <goals>
              <goal>upload</goal>
            </goals>
            <configuration>
              <fromDir>${basedir}/target/manual/</fromDir>
              <includes>*/**</includes>
              <url>scp://openengsb.org/</url>
              <toDir>var/www/openengsb/manual/${project.artifactId}/v${project.version}/</toDir>
              <serverId>OpenengsbWebServer</serverId>
            </configuration>
          </execution>
        </executions>
      </plugin>
        <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/classes/features.xml</file>
                    <type>xml</type>
                    <classifier>features</classifier>
                  </artifact>
                </artifacts>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

</project>

