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

  <parent>
    <groupId>org.geoserver.extension</groupId>
    <artifactId>gs-geofence-root</artifactId>
    <version>C105.2.27.2.00</version>
  </parent>

  <groupId>org.geoserver.extension</groupId>
  <artifactId>gs-geofence-server</artifactId>
  <packaging>jar</packaging>

  <name>GeoFence Server</name>
  <description>GeoFence security embedded engine</description>

  <dependencies>
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-entitymanager</artifactId>
    </dependency>
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-core</artifactId>
    </dependency>

    <dependency>
      <groupId>org.opengeo</groupId>
      <artifactId>geodb</artifactId>
      <version>${opengeo-geodb.version}</version>
      <scope>test</scope>
    </dependency>

    <!-- Older versions of h2 fails in drop/create tables   -->
    <!-- This version may break netcdf/grib modules         -->
    <!-- Please do consider using a postgis backend instead -->
    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
      <version>2.3.232</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.postgresql</groupId>
      <artifactId>postgresql</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.postgis</groupId>
      <artifactId>postgis-jdbc</artifactId>
      <version>${postgis.jdbc.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-expression</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-web</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-beans</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-core</artifactId>
    </dependency>

    <dependency>
      <groupId>org.geoserver</groupId>
      <artifactId>gs-main</artifactId>
    </dependency>

    <dependency>
      <groupId>org.geoserver.web</groupId>
      <artifactId>gs-web-core</artifactId>
    </dependency>

    <dependency>
      <groupId>org.geoserver.geofence</groupId>
      <artifactId>geofence-services-impl</artifactId>
      <version>${gf.version}</version>
      <exclusions>
        <exclusion>
          <artifactId>postgis-jdbc</artifactId>
          <groupId>org.postgis</groupId>
        </exclusion>
        <exclusion>
          <artifactId>postgis-stubs</artifactId>
          <groupId>org.postgis</groupId>
        </exclusion>
        <exclusion>
          <artifactId>postgresql</artifactId>
          <groupId>postgresql</groupId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.geoserver.extension</groupId>
      <artifactId>gs-geofence</artifactId>
      <version>${project.version}</version>
      <exclusions>
        <exclusion>
          <artifactId>geofence-model</artifactId>
          <groupId>org.geoserver.geofence</groupId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-oxm</artifactId>
    </dependency>

    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
    </dependency>

    <dependency>
      <groupId>com.github.svenmeier.wicket-dnd</groupId>
      <artifactId>wicket-dnd</artifactId>
    </dependency>

    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <scope>provided</scope>
    </dependency>

    <!-- test dependencies -->
    <dependency>
      <groupId>org.geotools.xsd</groupId>
      <artifactId>gt-xsd-gml3</artifactId>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.geoserver</groupId>
      <artifactId>gs-main</artifactId>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.geoserver.web</groupId>
      <artifactId>gs-web-core</artifactId>
      <version>${project.version}</version>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.geoserver.extension</groupId>
      <artifactId>gs-geofence</artifactId>
      <version>${project.version}</version>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.geoserver</groupId>
      <artifactId>gs-wfs</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.geoserver.web</groupId>
      <artifactId>gs-web-wms</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.geoserver</groupId>
      <artifactId>gs-wms</artifactId>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
    <!--
     hibernate requires: [INFO] |  +- net.bytebuddy:byte-buddy:jar:1.12.18:compile
     mockito requires    [INFO] |  +- net.bytebuddy:byte-buddy-agent:jar:1.14.15:test
     Let's add the proper byte-buddy version to avoid conflicts in test
    -->
    <dependency>
      <groupId>net.bytebuddy</groupId>
      <artifactId>byte-buddy</artifactId>
      <version>1.14.15</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>${basedir}/src/main/java</directory>
        <includes>
          <include>**/*.html</include>
        </includes>
      </resource>
      <resource>
        <directory>${basedir}/src/main/resources</directory>
        <includes>
          <include>**/*</include>
        </includes>
      </resource>
    </resources>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <!-- needed to pack h2 in geofence needed version -->
        <plugins>
          <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>copy-dependencies</id>
                <phase>install</phase>
                <goals>
                  <goal>copy-dependencies</goal>
                </goals>
                <configuration>
                  <includeGroupIds>com.h2database,org.postgresql,org.postgis,org.opengeo</includeGroupIds>
                  <includeArtifactIds>h2,postgresql,postgis-jdbc,geodb</includeArtifactIds>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
