<?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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

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

    <artifactId>h2gis</artifactId>
    <packaging>bundle</packaging>

    <!-- Project Information -->
    <name>h2gis-functions</name>
    <description>Main module of the H2GIS distribution. It extends H2 by adding spatial storage and analysis
        capabilities.</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>${commons-compress-groupId}</groupId>
            <artifactId>commons-compress</artifactId>
        </dependency>
        <dependency>
            <groupId>${cts-groupId}</groupId>
            <artifactId>cts</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>${project.groupId}</groupId>
            <artifactId>h2gis-utilities</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>${jackson-core-groupId}</groupId>
            <artifactId>jackson-core</artifactId>
        </dependency>
        <dependency>
            <groupId>${jts-core-groupId}</groupId>
            <artifactId>jts-core</artifactId>
        </dependency>
        <dependency>
            <groupId>${poly2tri-groupId}</groupId>
            <artifactId>poly2tri-core</artifactId>
        </dependency>

        <!-- Provided dependencies -->
        <dependency>
            <groupId>${osgi-enterprise-groupId}</groupId>
            <artifactId>org.osgi.enterprise</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>${osgi-compendium-groupId}</groupId>
            <artifactId>org.osgi.compendium</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>${osgi-core-groupId}</groupId>
            <artifactId>org.osgi.core</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Test dependencies -->
        <dependency>
            <groupId>${commons-io-groupId}</groupId>
            <artifactId>commons-io</artifactId>
            <scope>test</scope>
        </dependency>
        <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>${slf4j-groupId}</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.functions.*</Export-Package>
                        <Fragment-Host>org.h2</Fragment-Host>
                        <Bundle-Vendor>CNRS</Bundle-Vendor>
                        <Bundle-Category>JDBC</Bundle-Category>
                        <Import-Package>
                            org.h2.api,
                            org.h2.tools,
                            org.h2.util,
                            !org.h2.*,*
                        </Import-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>50</totalBranchRate>
                        <totalLineRate>70</totalLineRate>
                        <packageLineRate>0</packageLineRate>
                        <packageBranchRate>0</packageBranchRate>
                    </check>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- Plugin for the compilation -->
            <plugin>
                <groupId>${maven-compiler-plugin-groupId}</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
        </plugins>

        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>**/version.txt</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>false</filtering>
                <excludes>
                    <exclude>**/version.txt</exclude>
                </excludes>
            </resource>
        </resources>
    </build>
</project>
