<?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">
    <parent>
        <artifactId>hydra</artifactId>
        <groupId>de.datasecs</groupId>
        <version>1.4.4</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>hydra-all</artifactId>

    <dependencies>
        <!-- Hydra client -->
        <dependency>
            <groupId>de.datasecs</groupId>
            <artifactId>hydra-client</artifactId>
            <version>1.4.4</version>
        </dependency>

        <!-- Hydra server -->
        <dependency>
            <groupId>de.datasecs</groupId>
            <artifactId>hydra-server</artifactId>
            <version>1.4.4</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- Clean -->
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <executions>
                    <execution>
                        <id>clean-first</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>clean</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Generate Javadoc -->
            <plugin>
                <artifactId>maven-javadoc-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Dependencies -->
            <plugin>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <!-- Locate dependencies -->
                    <execution>
                        <id>locate-dependencies</id>
                        <phase>initialize</phase>
                        <goals>
                            <goal>properties</goal>
                        </goals>
                    </execution>

                    <!-- Unpack all source files -->
                    <execution>
                        <id>unpack-sources</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <configuration>
                            <classifier>sources</classifier>
                            <includeScope>runtime</includeScope>
                            <includeGroupIds>${project.groupId}</includeGroupIds>
                            <outputDirectory>target</outputDirectory>
                        </configuration>
                    </execution>

                    <!-- Unpack all class files -->
                    <execution>
                        <id>unpack-jars</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <configuration>
                            <includeScope>runtime</includeScope>
                            <includeGroupIds>${project.groupId}</includeGroupIds>
                            <outputDirectory>${project.build.outputDirectory}</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Include the directory where the source files were unpacked -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>target</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Compiler -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.5.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>

            <!-- Jar packaging -->
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>