<?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>
        <artifactId>parent</artifactId>
        <groupId>com.ongres.scram</groupId>
        <version>2.1</version>
    </parent>

    <artifactId>client</artifactId>

    <name>SCRAM - client</name>

    <dependencies>
        <dependency>
            <groupId>com.ongres.scram</groupId>
            <artifactId>common</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.ongres.scram</groupId>
            <artifactId>common</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
            <type>test-jar</type>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>javadoc.io-links</id>
            <activation>
                <property>
                    <name>!maven.javadoc.skip</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin><!-- Used to generate JavaDoc with links pointing to javadoc.io -->
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <version>2.8</version>
                        <executions>
                            <execution>
                                <id>unpack-javadoc</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>unpack</goal>
                                </goals>
                                <configuration>
                                    <artifactItems>
                                        <artifactItem><!-- For each dependency in this same project -->
                                            <groupId>${project.groupId}</groupId>
                                            <artifactId>common</artifactId>
                                            <classifier>javadoc</classifier>
                                            <version>${project.version}</version>
                                            <overWrite>false</overWrite>
                                            <outputDirectory>${project.build.directory}/common-javadoc</outputDirectory>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin><!-- Used to generate JavaDoc with links pointing to javadoc.io -->
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <offlineLinks>
                                <offlineLink><!-- For each dependency in this same project -->
                                    <url>http://static.javadoc.io/${project.groupId}/common/${project.version}</url>
                                    <location>${project.build.directory}/common-javadoc</location>
                                </offlineLink>
                            </offlineLinks>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
