<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</groupId>
    <artifactId>enterprise-data-adapter</artifactId>
    <version>2.0.3-RELEASE</version>
    <packaging>pom</packaging>

    <name>data-model</name>
    <url>https://bitbucket.org/CoherentLogic/coherent-logic-enterprise-data-adapter</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <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>

    <distributionManagement>
        <repository>
            <id>sonatype-nexus-staging</id>
            <name>Nexus Staging Repository</name>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <modules>
        <module>bom</module>
        <module>data-model-core</module>
        <module>data-model-security-core</module>
        <module>data-adapter-core</module>
        <module>data-adapter-application</module>
        <module>xstream-int</module>
        <module>infinispan-int</module>
        <module>aspectj-int</module>
        <module>spring-aop-int</module>
    </modules>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.coherentlogic.enterprise-data-adapter</groupId>
                <artifactId>bom</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <dependencies>
        <!-- TODO: Remove this dependency. -->
        <dependency>
            <groupId>com.thoughtworks.xstream</groupId>
            <artifactId>xstream</artifactId>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <mainClass>${start-class}</mainClass>
                    <layout>ZIP</layout>
                </configuration>
            </plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.6.1</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <!-- This has been added due to the introduction of the aspectj-int module; refer to the
                         following link for an explanation:

                         https://stackoverflow.com/questions/17944108/maven-compiler-plugin-always-detecting-a-set-of-sources-as-stale

                         and

                         https://stackoverflow.com/questions/24211943/aspectj-maven-plugin-declare-soft-how-to-compile

                         What led to this was a unit test failing in the aspectj-int module and the symptoms
                         included the aspectj-maven-plugin recompiling classes due to changes being detected
                         (specifically the message "Changes detected - recompiling the module!") and setting
                         the useIncrementalCompilation flag to false addresses this problem.
                      -->
                    <useIncrementalCompilation>false</useIncrementalCompilation>
                    <!-- @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.8.2</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.20</version>
            </plugin>
            <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>
                    <!-- Java 8: Absent the additonalParam below mvn will complain about Javadoc errors. -->
                    <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> -->
            </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.6</version>
                <!-- configuration>
                    <port>9000</port>
                    <tempWebappDirectory>${basedir}/target/site/tempdir</tempWebappDirectory>
                </configuration -->
            </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>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <version>3.0.4</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.17</version>
                <configuration>
                    <configLocation>sun_checks.xml</configLocation>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>2.5</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>dependency-updates-report</report>
                            <report>plugin-updates-report</report>
                            <report>property-updates-report</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>
</project>
