<?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.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>9</version>
    </parent>

    <groupId>com.coherentlogic.gama</groupId>
    <artifactId>client</artifactId>
    <version>2.0.3-RELEASE</version>

    <packaging>pom</packaging>
    <name>Coherent Logic GAMA Client</name>
    <description>Java client for the Google Analytics Measurement API (GAMA)</description>
    <url>https://coherentlogic.com/middleware-development/google-analytics-measurement-api-client/</url>

    <properties>
        <java.version>1.8</java.version>
        <enterprise.data.adapter.version>2.0.3-RELEASE</enterprise.data.adapter.version>
    </properties>

    <licenses>
        <license>
            <name>GNU LESSER GENERAL PUBLIC LICENSE Version 3</name>
            <url>http://www.gnu.org/licenses/lgpl-3.0.txt</url>
            <distribution>manual</distribution>
            <comments>NA</comments>
        </license>
    </licenses>

    <scm>
        <!-- developerConnection></developerConnection -->
        <url>https://bitbucket.org/CoherentLogic/google-analytics-measurement-api-client</url>
        <tag>HEAD</tag>
    </scm>
    <developers>
        <developer>
            <name>Support</name>
            <email>support@coherentlogic.com</email>
            <id>support</id>
            <organization>Coherent Logic Limited</organization>
            <organizationUrl>www.coherentlogic.com</organizationUrl>
            <url>www.coherentlogic.com</url>
            <timezone>+1</timezone>
            <roles>
                <role>Support</role>
            </roles>
        </developer>
    </developers>

    <distributionManagement>
        <site>
            <id>GAMA Client on Bitbucket</id>
            <name>GAMA Client on Bitbucket</name>
            <url>https://bitbucket.org/CoherentLogic/google-analytics-measurement-api-client</url>
        </site>
        <repository>
            <id>sonatype-nexus-staging</id>
            <name>Nexus Staging Repository</name>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <!-- See https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide 
        section on 6. Central Sync Requirement as repositories will be phased out 
        at some point ( we're keeping it for the moment because we need to get the 
        Spring dependencies and I don't see any other way of achieving this). -->
    <repositories>
        <repository>
            <id>com.springsource.repository.bundles.release</id>
            <name>EBR Spring Release Repository</name>
            <url>http://repository.springsource.com/maven/bundles/release</url>
        </repository>
        <repository>
            <id>com.springsource.repository.bundles.external</id>
            <name>EBR External Release Repository</name>
            <url>http://repository.springsource.com/maven/bundles/external</url>
        </repository>
    </repositories>

    <!-- When releasing this project we need to disable the assembly module 
        as this causes problems and the process will fail. There may be a better 
        way to do this however at the moment commenting the module seems to work. -->
    <modules>
        <module>gama-client-core</module>
        <!-- module>gama-client-core-it</module -->
    </modules>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.coherentlogic.enterprise-data-adapter</groupId>
                <artifactId>bom</artifactId>
                <version>${enterprise.data.adapter.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.coherentlogic.gama.client</groupId>
                <artifactId>gama-client-core</artifactId>
                <version>${project.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>3.0.0</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>index</report>
                            <report>license</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>2.22.0</version>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <version>3.0.5</version>
                <configuration>
                    <xmlOutput>true</xmlOutput>
                    <xmlOutputDirectory>target/site</xmlOutputDirectory>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>3.0.0</version>
                <configuration>
                    <configLocation>sun_checks.xml</configLocation>
                </configuration>
            </plugin>
        </plugins>
    </reporting>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.4</version>
                <configuration>
                    <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
                    <docletPath>C:/development/software/UMLGraph-5.6/lib/UmlGraph.jar</docletPath>
                    <!--
                        If you see this error "Cannot run program 'dot'" then Graphviz has probably
                        not been installed; see here:

                        http://www.graphviz.org/Download.php

                        The UML Graph doclet needs to be installed manually as follows: 
                        mvn install:install-file -Dfile=C:/development/software/UMLGraph-5.6.6/lib/UmlGraph.jar 
                        -DgroupId=org.umlgraph -DartifactId=doclet -Dversion=5.6.6 -Dpackaging=jar -->
                    <docletArtifact>
                        <groupId>org.umlgraph</groupId>
                        <artifactId>doclet</artifactId>
                        <version>5.6</version>
                    </docletArtifact>
                    <additionalparam>"-views" "-Xdoclint:none"</additionalparam>
                    <useStandardDocletOptions>true</useStandardDocletOptions>
                </configuration>
                <!-- Below is the yDoc configuration. <doclet>ydoc.doclets.YStandard</doclet> 
                    <docletPath>C:/development/software/yworks-uml-doclet/lib/ydoc.jar: C:/development/software/yworks-uml-doclet/lib/styleed.jar: 
                    C:/development/software/yworks-uml-doclet/resources </docletPath> <additionalparam>-umlautogen</additionalparam> -->
                <!-- reportSets>
                    <reportSet>
                        <id>aggregate</id>
                        <configuration></configuration>
                        <reports>
                            <report>aggregate</report>
                        </reports>
                    </reportSet>
                </reportSets -->
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <!-- TODO: Update this to 3.1/3.5.1 but see the notes in the bom re
                           the potential problem this can cause. -->
                <version>3.7.0</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <!-- @TODO: Remove the executable as we really don't want to have this 
                        here in order to make this work as this destroys platform independence. -->
                    <executable>C:/Program Files/Java/jdk1.8.0_66/bin/javac</executable>
                    <!-- True will generate line numbers. -->
                    <debug>true</debug>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.0</version>
                <configuration>
                    <aggregate>true</aggregate>
                    <!--also set this to link to generated source reports-->
                    <linkXRef>true</linkXRef>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.5.1</version>
                <configuration>
                    <stagingDirectory>C:/temp/GAMAClient-SITE</stagingDirectory>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.wagon</groupId>
                        <artifactId>wagon-ssh</artifactId>
                        <version>1.0</version>
                    </dependency>
                </dependencies>
            </plugin -->
        </plugins>
        <pluginManagement>
            <!--This plugin's configuration is used to store Eclipse m2e
                settings only. It has no influence on the Maven build itself.-->
            <plugins>
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.apache.maven.plugins
                                        </groupId>
                                        <artifactId>
                                            maven-compiler-plugin
                                        </artifactId>
                                        <versionRange>
                                            [3.1,)
                                        </versionRange>
                                        <goals>
                                            <goal>compile</goal>
                                            <goal>testCompile</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
            <plugins>
                <!-- https://issues.sonatype.org/browse/OSSRH-3376 -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>1.6</version>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
            </build>
        </profile>
    </profiles>
</project>
