<?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>7</version>
    </parent>

    <groupId>com.coherentlogic.usaspending</groupId>
    <artifactId>client</artifactId>
    <version>1.0.4-RELEASE</version>

    <packaging>pom</packaging>
    <name>Coherent Logic USA Spending Client</name>
    <description>Java client for the USA Spending Web Services (see usaspending.gov)</description>
    <url>www.coherentlogic.com</url>
    <properties>
        <data.model.version>1.0.19-RELEASE</data.model.version>
        <java.version>1.8</java.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>No comments at the moment.</comments>
        </license>
    </licenses>
    <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>

    <!-- 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>usaspending-client-assembly</module>
            <module>usaspending-client-config</module> 
            <module>usaspending-client-misc</module -->
        <module>usaspending-client-core</module>
        <module>usaspending-client-core-it</module>
        <!-- module>usaspending-client-example</module -->
        <!-- module>usaspending-client-webstart-application</module -->
        <!-- module>usaspending-client-db-int</module>
        <module>usaspending-client-webstart-application</module -->
    </modules>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.coherentlogic.coherent.data-model</groupId>
                <artifactId>bom</artifactId>
                <version>${data.model.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.coherentlogic.usaspending.client</groupId>
                <artifactId>usaspending-client-core</artifactId>
                <version>${project.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <version>2.4.0</version>
                <configuration>
                    <xmlOutput>true</xmlOutput>
                    <xmlOutputDirectory>target/site</xmlOutputDirectory>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>2.9.1</version>
                <configuration>
                    <configLocation>sun_checks.xml</configLocation>
                </configuration>
            </plugin>
        </plugins>
    </reporting>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</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>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.plexus</groupId>
                        <artifactId>plexus-compiler-eclipse</artifactId>
                        <version>2.3</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>1.4.1</version>
                <executions>
                    <execution>
                        <id>enforce-java</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireJavaVersion>
                                    <version>[1.8.0,)</version>
                                </requireJavaVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.3</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/lib/UmlGraph.jar 
                        -DgroupId=org.umlgraph -DartifactId=doclet -Dversion=5.6 -Dpackaging=jar -->
                    <docletArtifact>
                        <groupId>org.umlgraph</groupId>
                        <artifactId>doclet</artifactId>
                        <version>5.6</version>
                    </docletArtifact>
                    <additionalparam>-views</additionalparam>
                    <useStandardDocletOptions>true</useStandardDocletOptions>
                    <!-- Upgrade to JDK 8 resulted in errors so the doclint param below 
                         fixes this. -->
                    <additionalparam>-Xdoclint:none</additionalparam>
                </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> -->
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </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>