<?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>

   <groupId>com.github.lonnyj</groupId>
   <artifactId>liquibase-spatial</artifactId>
   <version>1.2.1</version>

   <name>Liquibase Spatial</name>
   <description>Liquibase Spatial extends Liquibase to handle spatial indexing and geometry types</description>
   <url>http://lonnyj.github.com/liquibase-spatial</url>
   <inceptionYear>2014</inceptionYear>

   <licenses>
      <license>
         <name>The Apache Software License, Version 2.0</name>
         <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
         <distribution>manual</distribution>
         <comments>A business-friendly OSS license</comments>
      </license>
   </licenses>

   <developers>
      <developer>
         <id>lonnyj</id>
         <name>Lonny Jacobson</name>
         <roles>
            <role>Java Developer</role>
         </roles>
         <timezone>-7</timezone>
      </developer>
   </developers>

   <scm>
      <connection>scm:git:git@${repository.domain}:${repository.user}/${repository.name}.git</connection>
      <developerConnection>scm:git:git@${repository.domain}:${repository.user}/${repository.name}.git</developerConnection>
      <tag>liquibase-spatial-1.2.1</tag>
      <url>https://${repository.domain}/${repository.user}/${repository.name}</url>
   </scm>

   <issueManagement>
      <system>GitHub</system>
      <url>${issueLinkUrl}</url>
   </issueManagement>

   <distributionManagement>
      <repository>
         <id>bintray-lonny-maven-${repository.name}</id>
         <name>lonny-maven-${repository.name}</name>
         <url>https://api.bintray.com/maven/lonny/maven/${repository.name}</url>
      </repository>
   </distributionManagement>

   <properties>
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

      <!-- GitHub Properties -->
      <issueLinkUrl>https://github.com/${repository.user}/${repository.name}/issues</issueLinkUrl>
      <github.global.server>github</github.global.server>
      <repository.domain>github.com</repository.domain>
      <repository.user>lonnyj</repository.user>
      <repository.name>${project.artifactId}</repository.name>

      <!-- Plugin Versions -->
      <build-helper-maven-plugin.version>1.8</build-helper-maven-plugin.version>
      <maven-changelog-plugin.version>2.3</maven-changelog-plugin.version>
      <maven-changes-plugin.version>2.11</maven-changes-plugin.version>
      <maven-dependency-plugin.version>2.9</maven-dependency-plugin.version>
      <maven-failsafe-plugin.version>${maven-surefire-plugin.version}</maven-failsafe-plugin.version>
      <maven-javadoc-plugin.version>2.10</maven-javadoc-plugin.version>
      <maven-source-plugin.version>2.4</maven-source-plugin.version>
      <maven-surefire-plugin.version>2.18</maven-surefire-plugin.version>
      <versions-maven-plugin.version>2.1</versions-maven-plugin.version>

      <!-- Dependency Versions -->
      <geodb.version>0.8</geodb.version>
      <hatbox.version>1.0.b9</hatbox.version>
      <h2.version>1.4.177</h2.version>
      <jts.version>1.13</jts.version>
      <liquibase.version>3.3.0</liquibase.version>
   </properties>

   <dependencies>
      <dependency>
         <groupId>com.vividsolutions</groupId>
         <artifactId>jts</artifactId>
         <version>${jts.version}</version>
      </dependency>
      <dependency>
         <groupId>org.liquibase</groupId>
         <artifactId>liquibase-core</artifactId>
         <version>${liquibase.version}</version>
      </dependency>
      <dependency>
         <groupId>com.h2database</groupId>
         <artifactId>h2</artifactId>
         <version>${h2.version}</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>net.sourceforge.hatbox</groupId>
         <artifactId>hatbox</artifactId>
         <version>${hatbox.version}</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.mockito</groupId>
         <artifactId>mockito-core</artifactId>
         <version>1.10.19</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.opengeo</groupId>
         <artifactId>geodb</artifactId>
         <version>${geodb.version}</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>org.testng</groupId>
         <artifactId>testng</artifactId>
         <version>6.8.17</version>
         <scope>test</scope>
      </dependency>
   </dependencies>

   <build>
      <pluginManagement>
         <plugins>
            <plugin>
               <artifactId>maven-antrun-plugin</artifactId>
               <version>1.7</version>
            </plugin>
            <plugin>
               <artifactId>maven-dependency-plugin</artifactId>
               <version>${maven-dependency-plugin.version}</version>
            </plugin>
            <plugin>
               <artifactId>maven-failsafe-plugin</artifactId>
               <version>${maven-failsafe-plugin.version}</version>
            </plugin>
            <plugin>
               <artifactId>maven-gpg-plugin</artifactId>
               <version>1.6</version>
            </plugin>
            <plugin>
               <artifactId>maven-install-plugin</artifactId>
               <version>2.5.2</version>
            </plugin>
            <plugin>
               <artifactId>maven-release-plugin</artifactId>
               <version>2.5.1</version>
            </plugin>
            <plugin>
               <artifactId>maven-resources-plugin</artifactId>
               <version>2.7</version>
            </plugin>
            <plugin>
               <artifactId>maven-site-plugin</artifactId>
               <version>3.4</version>
            </plugin>
            <plugin>
               <artifactId>maven-surefire-plugin</artifactId>
               <version>${maven-surefire-plugin.version}</version>
            </plugin>
            <plugin>
               <groupId>org.codehaus.mojo</groupId>
               <artifactId>versions-maven-plugin</artifactId>
               <version>${versions-maven-plugin.version}</version>
               <configuration>
                  <allowMajorUpdates>false</allowMajorUpdates>
                  <allowMinorUpdates>false</allowMinorUpdates>
                  <includeProperties>hatbox.version,jts.version,mysql.version</includeProperties>
               </configuration>
            </plugin>
         </plugins>
      </pluginManagement>
      <plugins>
         <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.2</version>
            <configuration>
               <source>1.6</source>
               <target>1.6</target>
            </configuration>
         </plugin>
         <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <executions>
               <execution>
                  <id>H2 Integration Test</id>
                  <goals>
                     <goal>integration-test</goal>
                     <goal>verify</goal>
                  </goals>
                  <configuration>
                     <includes>
                        <include>**/*H2*IT*</include>
                     </includes>
                  </configuration>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <artifactId>maven-jar-plugin</artifactId>
            <version>2.5</version>
            <configuration>
               <archive>
                  <manifestEntries>
                     <Liquibase-Package>liquibase.ext.spatial.change,
                        liquibase.ext.spatial.datatype,
                        liquibase.ext.spatial.preconditions,
                        liquibase.ext.spatial.sqlgenerator,
                        liquibase.ext.spatial.statement</Liquibase-Package>
                  </manifestEntries>
               </archive>
            </configuration>
         </plugin>
         <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${maven-javadoc-plugin.version}</version>
            <executions>
               <execution>
                  <id>attach-javadocs</id>
                  <goals>
                     <goal>jar</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <executions>
               <execution>
                  <id>Copy the XSD</id>
                  <phase>verify</phase>
                  <goals>
                     <goal>copy-resources</goal>
                  </goals>
                  <configuration>
                     <outputDirectory>${project.build.directory}/site</outputDirectory>
                     <resources>
                        <resource>
                           <directory>${project.build.outputDirectory}/liquibase/ext/spatial/xml</directory>
                           <includes>
                              <include>*.xsd</include>
                           </includes>
                        </resource>
                     </resources>
                  </configuration>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <version>${maven-source-plugin.version}</version>
            <executions>
               <execution>
                  <id>attach-sources</id>
                  <goals>
                     <goal>jar-no-fork</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <!-- Explicitly define maven-deploy-plugin after javadoc and source to
               force the execution order. -->
            <artifactId>maven-deploy-plugin</artifactId>
            <version>2.8.2</version>
            <executions>
               <execution>
                  <id>deploy</id>
                  <phase>deploy</phase>
                  <goals>
                     <goal>deploy</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>com.google.code.sortpom</groupId>
            <artifactId>maven-sortpom-plugin</artifactId>
            <version>2.3.0</version>
            <executions>
               <execution>
                  <phase>verify</phase>
                  <goals>
                     <goal>sort</goal>
                  </goals>
               </execution>
            </executions>
            <configuration>
               <keepBlankLines>true</keepBlankLines>
               <nrOfIndentSpace>3</nrOfIndentSpace>
               <sortDependencies></sortDependencies>
               <sortDependencies>scope,groupId,artifactId</sortDependencies>
            </configuration>
         </plugin>
      </plugins>
   </build>

   <reporting>
      <plugins>
         <plugin>
            <artifactId>maven-plugin-plugin</artifactId>
            <version>3.2</version>
         </plugin>
         <plugin>
            <artifactId>maven-project-info-reports-plugin</artifactId>
            <version>2.7</version>
         </plugin>
         <plugin>
            <artifactId>maven-changelog-plugin</artifactId>
            <version>${maven-changelog-plugin.version}</version>
         </plugin>
         <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${maven-javadoc-plugin.version}</version>
         </plugin>
         <plugin>
            <artifactId>maven-jxr-plugin</artifactId>
            <version>2.3</version>
         </plugin>
         <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>taglist-maven-plugin</artifactId>
            <version>2.4</version>
         </plugin>
         <plugin>
            <artifactId>maven-surefire-report-plugin</artifactId>
            <version>${maven-surefire-plugin.version}</version>
         </plugin>
         <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>cobertura-maven-plugin</artifactId>
            <version>2.6</version>
         </plugin>
         <plugin>
            <artifactId>maven-pmd-plugin</artifactId>
            <version>3.0.1</version>
            <configuration>
               <rulesets>
                  <ruleset>/rulesets/java/unusedcode.xml</ruleset>
                  <ruleset>/rulesets/java/basic.xml</ruleset>
                  <rulesets>${basedir}/rulesets/custom.xml</rulesets>
               </rulesets>
            </configuration>
         </plugin>
         <plugin>
            <artifactId>maven-checkstyle-plugin</artifactId>
            <version>2.10</version>
         </plugin>
         <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>findbugs-maven-plugin</artifactId>
            <version>2.5.2</version>
            <configuration>
               <effort>Max</effort>
               <onlyAnalyze>liquibase.ext.spatial</onlyAnalyze>
            </configuration>
         </plugin>
         <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>${maven-dependency-plugin.version}</version>
         </plugin>
         <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>versions-maven-plugin</artifactId>
            <version>${versions-maven-plugin.version}</version>
         </plugin>
      </plugins>
   </reporting>

   <profiles>
      <profile>
         <id>derby</id>
         <build>
            <plugins>
               <plugin>
                  <artifactId>maven-failsafe-plugin</artifactId>
                  <executions>
                     <execution>
                        <id>Derby Integration Test</id>
                        <goals>
                           <goal>integration-test</goal>
                           <goal>verify</goal>
                        </goals>
                        <configuration>
                           <includes>
                              <include>**/*DerbyIT*</include>
                           </includes>
                        </configuration>
                     </execution>
                  </executions>
               </plugin>
            </plugins>
         </build>

         <properties>
            <derby.version>10.8.2.2</derby.version>
            <geodb.version>0.9-SNAPSHOT</geodb.version>
         </properties>

         <dependencies>
            <dependency>
               <groupId>org.apache.derby</groupId>
               <artifactId>derby</artifactId>
               <version>${derby.version}</version>
               <scope>test</scope>
            </dependency>
         </dependencies>
      </profile>

      <profile>
         <id>github</id>
         <build>
            <plugins>
               <plugin>
                  <groupId>com.github.github</groupId>
                  <artifactId>site-maven-plugin</artifactId>
                  <version>0.10</version>
                  <executions>
                     <execution>
                        <phase>site</phase>
                        <goals>
                           <goal>site</goal>
                        </goals>
                     </execution>
                  </executions>
                  <configuration>
                     <message>Creating site for ${project.version}</message>
                     <server>github</server>
                  </configuration>
               </plugin>
            </plugins>
         </build>

         <distributionManagement>
            <site>
               <id>github</id>
               <name>GitHub</name>
               <url>http://lonnyj.github.com/${project.artifactId}</url>
            </site>
         </distributionManagement>
         <reporting>
            <plugins>
               <plugin>
                  <artifactId>maven-changes-plugin</artifactId>
                  <version>${maven-changes-plugin.version}</version>
                  <reportSets>
                     <reportSet>
                        <reports>
                           <report>github-report</report>
                        </reports>
                     </reportSet>
                  </reportSets>
                  <configuration>
                     <githubAPIScheme>https</githubAPIScheme>
                     <githubAPIPort>443</githubAPIPort>
                  </configuration>
               </plugin>
            </plugins>
         </reporting>
      </profile>

      <profile>
         <!--
            To enable the MySQL integration test, set the following system properties:
            mysql.url=jdbc:mysql://<host>:3306/<database>
            mysql.username=<username>
            mysql.password=<password>
         -->
         <id>mysql</id>

         <activation>
            <property>
               <name>mysql.url</name>
            </property>
         </activation>

         <build>
            <plugins>
               <plugin>
                  <artifactId>maven-failsafe-plugin</artifactId>
                  <executions>
                     <execution>
                        <id>MySQL Integration Test</id>
                        <goals>
                           <goal>integration-test</goal>
                           <goal>verify</goal>
                        </goals>
                        <configuration>
                           <includes>
                              <include>**/*MySQLIT*</include>
                           </includes>
                        </configuration>
                     </execution>
                  </executions>
               </plugin>
            </plugins>
         </build>

         <properties>
            <mysql.version>5.1.34</mysql.version>
         </properties>

         <dependencies>
            <dependency>
               <groupId>mysql</groupId>
               <artifactId>mysql-connector-java</artifactId>
               <version>${mysql.version}</version>
               <scope>test</scope>
            </dependency>
         </dependencies>
      </profile>

      <profile>
         <!--
            To enable the Oracle integration test, set the following system properties:
            oracle.url=jdbc:oracle:thin:@//<host>:1521/<service>
            oracle.username=<username>
            oracle.password=<password>
         -->
         <id>oracle</id>

         <activation>
            <property>
               <name>oracle.url</name>
            </property>
         </activation>

         <build>
            <plugins>
               <plugin>
                  <artifactId>maven-failsafe-plugin</artifactId>
                  <executions>
                     <execution>
                        <id>Oracle Integration Test</id>
                        <goals>
                           <goal>integration-test</goal>
                           <goal>verify</goal>
                        </goals>
                        <configuration>
                           <includes>
                              <include>**/*OracleIT*</include>
                           </includes>
                        </configuration>
                     </execution>
                  </executions>
               </plugin>
            </plugins>
         </build>

         <properties>
            <ojdbc6.groupId>com.oracle</ojdbc6.groupId>
            <ojdbc6.artifactId>ojdbc6</ojdbc6.artifactId>
            <ojdbc6.version>11.2.0.3.0</ojdbc6.version>
         </properties>

         <dependencies>
            <dependency>
               <groupId>${ojdbc6.groupId}</groupId>
               <artifactId>${ojdbc6.artifactId}</artifactId>
               <version>${ojdbc6.version}</version>
               <scope>test</scope>
            </dependency>
         </dependencies>
      </profile>

      <profile>
         <!--
            To enable the PostgreSQL integration test, set the following system properties:
            postgresql.url=jdbc:postgresql://<host>:5432/<database>
            postgresql.username=<username>
            postgresql.password=<password>
         -->
         <id>postgresql</id>

         <activation>
            <property>
               <name>postgresql.url</name>
            </property>
         </activation>

         <build>
            <plugins>
               <plugin>
                  <artifactId>maven-failsafe-plugin</artifactId>
                  <executions>
                     <execution>
                        <id>PostgreSQL Integration Test</id>
                        <goals>
                           <goal>integration-test</goal>
                           <goal>verify</goal>
                        </goals>
                        <configuration>
                           <includes>
                              <include>**/*PostgreSQLIT*</include>
                           </includes>
                        </configuration>
                     </execution>
                  </executions>
               </plugin>
            </plugins>
         </build>

         <properties>
            <postgresql.version>9.3-1102-jdbc4</postgresql.version>
         </properties>

         <dependencies>
            <dependency>
               <groupId>org.postgresql</groupId>
               <artifactId>postgresql</artifactId>
               <version>${postgresql.version}</version>
               <scope>test</scope>
            </dependency>
         </dependencies>
      </profile>

      <profile>
         <id>release-sign-artifacts</id>

         <activation>
            <property>
               <name>performRelease</name>
               <value>true</value>
            </property>
         </activation>

         <build>
            <plugins>
               <plugin>
                  <artifactId>maven-gpg-plugin</artifactId>
                  <executions>
                     <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                           <goal>sign</goal>
                        </goals>
                     </execution>
                  </executions>
               </plugin>
            </plugins>
         </build>
      </profile>

      <profile>
         <id>update-readme</id>

         <build>
            <plugins>
               <plugin>
                  <artifactId>maven-resources-plugin</artifactId>
                  <executions>
                     <execution>
                        <id>Filter index.md.vm</id>
                        <phase>site</phase>
                        <goals>
                           <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                           <outputDirectory>${project.build.directory}</outputDirectory>
                           <resources>
                              <resource>
                                 <filtering>true</filtering>
                                 <directory>${basedir}/src/site/markdown</directory>
                                 <includes>
                                    <include>index.md.vm</include>
                                 </includes>
                              </resource>
                           </resources>
                        </configuration>
                     </execution>
                  </executions>
               </plugin>
               <plugin>
                  <artifactId>maven-antrun-plugin</artifactId>
                  <executions>
                     <execution>
                        <id>Generate README.md</id>
                        <phase>site</phase>
                        <goals>
                           <goal>run</goal>
                        </goals>
                        <configuration>
                           <target>
                              <concat destfile="${basedir}/README.md">
                                 <path path="${project.build.directory}/index.md.vm"></path>
                                 <footer>Refer to the [documentation](${project.url}) for further information.</footer>
                              </concat>
                           </target>
                        </configuration>
                     </execution>
                  </executions>
               </plugin>
            </plugins>
         </build>
      </profile>
   </profiles>
</project>
