<?xml version="1.0" encoding="UTF-8"?>
<!-- 
Copyright 2012-2014 Eurocommercial Properties NV

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
  either express or implied. See the License for the specific
  language governing permissions and limitations under the License.
-->
<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.incode.module.country</groupId>
    <artifactId>incode-module-country-dom</artifactId>
    <version>1.13.0</version>

    <packaging>jar</packaging>
    
    <name>Incode Module Country DOM</name>
    <description>
        A module defining Country and State entities (reference data)
    </description>

    <url>https://github.com/incodehq/incode-module-country</url>
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <scm>
        <connection>scm:git:git@github.com:incodehq/incode-module-country.git</connection>
        <developerConnection>scm:git:git@github.com:incodehq/incode-module-country.git</developerConnection>
        <url>git@github.com:incodehq/incode-module-country.git</url>
    </scm>
    <developers>
        <developer>
            <id>dhaywood</id>
            <name>Dan Haywood</name>
            <email>dhaywood@incode.org</email>
        </developer>
        <developer>
            <id>jvanderwal</id>
            <name>Jeroen van der Wal</name>
            <email>jvanderwal@incode.org</email>
        </developer>
    </developers>

    <properties>
        <compileSource>1.8</compileSource>
        <compileTarget>1.8</compileTarget>

        <isis.version>1.13.0</isis.version>
        <isis-module-fakedata.version>1.13.0</isis-module-fakedata.version>
        <incode-module-base.version>1.13.0</incode-module-base.version>

        <lombok.version>1.16.6</lombok.version>

        <axon-core.version>2.4.4</axon-core.version>

        <assertj-core.version>3.3.0</assertj-core.version>
        <danhaywood-java-assertjext.version>0.1.0</danhaywood-java-assertjext.version>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    </properties>

    <build>
        <resources>
            <resource>
                <filtering>false</filtering>
                <directory>src/main/resources</directory>
            </resource>
            <resource>
                <filtering>false</filtering>
                <directory>src/main/java</directory>
                <includes>
                    <include>**</include>
                </includes>
                <excludes>
                    <exclude>**/*.java</exclude>
                </excludes>
            </resource>
        </resources>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>1.3.1</version>
                    <configuration>
                        <rules>
                            <requireMavenVersion>
                                <version>[3.2.1,)</version>
                            </requireMavenVersion>
                            <requireJavaVersion>
                                <version>[1.8.0,)</version>
                            </requireJavaVersion>
                            <requirePluginVersions>
                                <message>All plugin versions must be
                                    defined!</message>
                                <banLatest>true</banLatest>
                                <banRelease>true</banRelease>
                            </requirePluginVersions>
                            <DependencyConvergence />
                        </rules>
                    </configuration>
                    <!-- goal:enforce supposedly binds to phase:validate, but explicit binding seems to be required -->
                    <executions>
                        <execution>
                            <id>validate-enforce</id>
                            <phase>validate</phase>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.1</version>
                    <configuration>
                        <showDeprecation>false</showDeprecation>
                        <showWarnings>false</showWarnings>
                        <source>${compileSource}</source>
                        <target>${compileTarget}</target>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>2.4</version>
                    <inherited>true</inherited>
                    <executions>
                        <execution>
                            <id>package-test-jar</id>
                            <phase>package</phase>
                            <goals>
                                <goal>test-jar</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <archive>
                            <manifest>
                                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            </manifest>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.16</version>
                    <configuration>
                        <includes>
                            <include>**/*Test.java</include>
                            <include>**/*Test$*.java</include>
                            <include>**/*Test*_*.java</include>
                            <include>**/*Spec*.java</include>
                        </includes>
                        <excludes>
                            <exclude>**/*ForTesting.java</exclude>
                            <exclude>**/*Abstract*.java</exclude>
                        </excludes>
                        <useFile>true</useFile>
                        <printSummary>true</printSummary>
                        <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-report-plugin</artifactId>
                    <version>2.16</version>
                    <configuration>
                        <showSuccess>false</showSuccess>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>test</phase>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <!-- http://central.sonatype.org/pages/apache-maven.html -->
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.2</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.apache.isis.core</groupId>
                <artifactId>isis</artifactId>
                <version>${isis.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.apache.isis.core</groupId>
            <artifactId>isis-core-applib</artifactId>
            <version>${isis.version}</version>
        </dependency>
        <dependency>
            <groupId>org.isisaddons.module.fakedata</groupId>
            <artifactId>isis-module-fakedata-dom</artifactId>
            <version>${isis-module-fakedata.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.isis.core</groupId>
            <artifactId>isis-core-unittestsupport</artifactId>
            <version>${isis.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>${assertj-core.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.danhaywood.java</groupId>
            <artifactId>danhaywood-java-assertjext</artifactId>
            <version>${danhaywood-java-assertjext.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${lombok.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.incode.module.base</groupId>
            <artifactId>incode-module-base-dom</artifactId>
    	    <version>${incode-module-base.version}</version>
        </dependency>
        <dependency>
            <groupId>org.incode.module.base</groupId>
            <artifactId>incode-module-base-dom</artifactId>
    	    <version>${incode-module-base.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <!-- http://central.sonatype.org/pages/apache-maven.html -->
    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <profiles>

        <profile>
            <id>axon-event-bus</id>
            <activation>
                <property>
                    <name>!skip.axon-event-bus</name>
                </property>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.axonframework</groupId>
                    <artifactId>axon-core</artifactId>
                    <version>${axon-core.version}</version>
                </dependency>
            </dependencies>
        </profile>

        <profile>
            <id>isis-validate</id>
            <activation>
                <property>
                    <name>isis-validate</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.isis.tool</groupId>
                        <artifactId>isis-maven-plugin</artifactId>
                        <version>${isis.version}</version>
                        <configuration>
                            <appManifest>org.incode.module.country.dom.CountryModuleDomManifest</appManifest>
                        </configuration>
                        <dependencies>
                            <dependency>
                                <groupId>${project.groupId}</groupId>
                                <artifactId>incode-module-country-dom</artifactId>
                                <version>${project.version}</version>
                            </dependency>
                            <!--
                            ... workaround to avoid conflict with plexus-default
                                (not sure why exclusions in the isis-maven-plugin aren't sufficient, though ...
                            -->
                            <dependency>
                                <groupId>com.google.guava</groupId>
                                <artifactId>guava</artifactId>
                                <version>16.0.1</version>
                            </dependency>
                        </dependencies>
                        <executions>
                            <execution>
                                <phase>test</phase>
                                <goals>
                                    <goal>validate</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>enhance</id>
            <activation>
                <property>
                    <name>!skip.enhance</name>
                </property>
            </activation>
            <properties>
                <datanucleus-maven-plugin.version>4.0.1</datanucleus-maven-plugin.version>
            </properties>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                            <groupId>org.eclipse.m2e</groupId>
                            <artifactId>lifecycle-mapping</artifactId>
                            <version>1.0.0</version>
                            <configuration>
                                <lifecycleMappingMetadata>
                                    <pluginExecutions>
                                        <pluginExecution>
                                            <pluginExecutionFilter>
                                                <groupId>org.datanucleus</groupId>
                                                <artifactId>datanucleus-maven-plugin</artifactId>
                                                <versionRange>[${datanucleus-maven-plugin.version},)</versionRange>
                                                <goals>
                                                    <goal>enhance</goal>
                                                </goals>
                                            </pluginExecutionFilter>
                                            <action>
                                                <ignore></ignore>
                                            </action>
                                        </pluginExecution>
                                    </pluginExecutions>
                                </lifecycleMappingMetadata>
                            </configuration>
                        </plugin>
                    </plugins>
                </pluginManagement>
                <plugins>
                    <plugin>
                        <groupId>org.datanucleus</groupId>
                        <artifactId>datanucleus-maven-plugin</artifactId>
                        <version>${datanucleus-maven-plugin.version}</version>
                        <configuration>
                            <fork>false</fork>
                            <log4jConfiguration>${basedir}/log4j.properties</log4jConfiguration>
                            <verbose>true</verbose>
                            <props>${basedir}/datanucleus.properties</props>
                        </configuration>
                        <executions>
                            <execution>
                                <phase>process-classes</phase>
                                <goals>
                                    <goal>enhance</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency>
                    <groupId>org.datanucleus</groupId>
                    <artifactId>datanucleus-core</artifactId>
                </dependency>
                <dependency>
                    <groupId>org.datanucleus</groupId>
                    <artifactId>datanucleus-jodatime</artifactId>
                </dependency>
                <dependency>
                    <groupId>org.datanucleus</groupId>
                    <artifactId>datanucleus-api-jdo</artifactId>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>cloudbees-snapshots</id>
            <activation>
                <property>
                    <name>!skip.cloudbees-snapshots</name>
                </property>
            </activation>
            <repositories>
                <repository>
                    <id>snapshots-repo</id>
                    <url>http://repository-estatio.forge.cloudbees.com/snapshot/</url>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
            </repositories>
        </profile>
        <!-- http://central.sonatype.org/pages/apache-maven.html -->
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.2.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.8</version>
                        <inherited>true</inherited>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <!-- as per http://stackoverflow.com/a/16743137/56880 -->
                            <additionalparam>-Xdoclint:none</additionalparam>
                            <debug>true</debug>
                            <minmemory>128m</minmemory>
                            <maxmemory>1024m</maxmemory>
                            <quiet>true</quiet>
                            <doctitle>${project.name} ${project.version}</doctitle>
                            <windowtitle>${project.name} ${project.version}</windowtitle>
                            <testDoctitle>${project.name} ${project.version} (TEST API)</testDoctitle>
                            <testWindowtitle>${project.name} ${project.version} (TEST API)</testWindowtitle>
                            <splitindex>true</splitindex>
                            <encoding>${project.build.sourceEncoding}</encoding>
                            <links>
                                <link>http://docs.oracle.com/javase/7/docs/api/</link>
                            </links>
                            <linksource>true</linksource>
                            <detectOfflineLinks>false</detectOfflineLinks>
                        </configuration>
                    </plugin>

                    <!-- http://kohsuke.org/pgp-maven-plugin/secretkey.html instead of maven-gpg-plugin -->
                    <plugin>
                        <groupId>org.kohsuke</groupId>
                        <artifactId>pgp-maven-plugin</artifactId>
                        <version>1.1</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>m2e</id>
            <activation>
                <property>
                    <name>m2e.version</name>
                </property>
            </activation>
            <build>
                <directory>target-ide</directory>
            </build>
        </profile>
    </profiles>

</project>
