<?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>

    <!-- Maven Coordinates -->
    <parent>
        <artifactId>h2gis-parent</artifactId>
        <groupId>org.orbisgis</groupId>
        <version>1.5.0</version>
        <relativePath>../</relativePath>
    </parent>

    <name>h2gis-utilities</name>
    <packaging>bundle</packaging>

    <!-- Project Information -->
    <artifactId>h2gis-utilities</artifactId>
    <description>Collection of methods to fetch spatial metadata in SFS database like PostGIS or H2GIS.
        Theses functions can be commonly used either in PostGIS or in H2.
        Spatial utilities publish also a DataSourceFactory wrapper that provide JDBC Wrapper for spatial
        functionality.
    </description>

    <organization>
        <name>CNRS</name>
        <url>http://www.h2gis.org</url>
    </organization>
    <url>http://github.com/orbisgis/H2GIS</url>
    <licenses>
        <license>
            <name>GNU Lesser General Public License (LGPLV3+)</name>
            <url>http://www.gnu.org/licenses/lgpl-3.0.html</url>
        </license>
    </licenses>

    <!-- Properties -->
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <!-- Dependencies -->
    <dependencies>
        <dependency>
            <groupId>${jts-core-groupId}</groupId>
            <artifactId>jts-core</artifactId>
        </dependency>
        <dependency>
            <groupId>${h2-groupId}</groupId>
            <artifactId>h2</artifactId>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>h2gis-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>${slf4j-groupId}</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>

        <!-- Provided dependencies -->
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.compendium</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Test dependencies -->
        <dependency>
            <groupId>${junit-groupId}</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>h2gis-test-utilities</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <!-- Build Settings -->
    <build>
        <plugins>
            <!-- Plugin for the bundle packaging -->
            <plugin>
                <groupId>${maven-bundle-plugin-groupId}</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Export-Package>org.h2gis.utilities.*</Export-Package>
                        <Private-Package>org.h2gis.utilities.wrapper</Private-Package>
                    </instructions>
                </configuration>
            </plugin>
            <!-- Plugin for the test coverage check -->
            <plugin>
                <groupId>${cobertura-maven-plugin-groupId}</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
                <configuration>
                    <check>
                        <!-- TODO Raise Coverage constraint -->
                        <branchRate>0</branchRate>
                        <lineRate>0</lineRate>
                        <haltOnFailure>true</haltOnFailure>
                        <totalBranchRate>57</totalBranchRate>
                        <totalLineRate>42</totalLineRate>
                        <regexes>
                            <regex>
                                <pattern>org.h2gis.utilities.jts_utils.Contouring</pattern>
                                <branchRate>79</branchRate>
                                <lineRate>80</lineRate>
                            </regex>
                            <regex>
                                <pattern>org.h2gis.utilities.wrapper</pattern>
                                <branchRate>0</branchRate>
                                <lineRate>0</lineRate>
                            </regex>
                        </regexes>
                    </check>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- Plugin for test running -->
            <plugin>
                <groupId>${maven-surefire-plugin-groupId}</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>
