<?xml version="1.0" encoding="UTF-8"?>
<!-- =======================================================================    
        Maven Project Configuration File                                        
                                                                                
        The Geotools Project                                                    
            http://www.geotools.org/                                            
                                                                                
        Version: $Id$              
     ======================================================================= -->
<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                                 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.geotools</groupId>
    <artifactId>geotools</artifactId>
    <version>34.5-C321</version>
  </parent>

  <!-- =========================================================== -->
  <!--     Module Description                                      -->
  <!-- =========================================================== -->
  <groupId>org.geotools</groupId>
  <artifactId>modules</artifactId>
  <packaging>pom</packaging>
  <name>Geotools modules</name>
  <description>Geotools libraries.</description>

  <licenses>
    <license>
      <name>Lesser General Public License (LGPL)</name>
      <url>http://www.gnu.org/copyleft/lesser.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <!-- =========================================================== -->
  <!--     Modules included in the build                           -->
  <!-- =========================================================== -->
  <modules>
    <module>library</module>
    <module>ogc</module>
    <module>integration</module>
    <module>plugin</module>
    <module>extension</module>
    <module>unsupported</module>
  </modules>

  <!-- =========================================================== -->
  <!--     Dependencies to be inherited by all modules.            -->
  <!-- =========================================================== -->
  <dependencyManagement>
    <dependencies>
      <!-- Import the GeoTools platform-dependencies BOM to get consistent dependency versions -->
      <dependency>
        <groupId>org.geotools</groupId>
        <artifactId>gt-platform-dependencies</artifactId>
        <version>${project.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <!-- Import the GeoTools BOM to have access to all artifacts without specifying the version -->
      <dependency>
        <groupId>org.geotools</groupId>
        <artifactId>gt-bom</artifactId>
        <version>${project.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <!--
     Adding gt-platform-dependencies and gt-bom as dependencies with type=pom and scope=provided here
     does not change the dependency tree for the submodules at all, but forces the BOMs to be installed
     in the local maven repository first, either when building the whole project or when a submodule is
     built independently (e.g. mvn install -pl :gt-main -am), hence ensuring any change to the dependencies
     is picked up.
    -->
    <dependency>
      <groupId>org.geotools</groupId>
      <artifactId>gt-platform-dependencies</artifactId>
      <version>${project.version}</version>
      <type>pom</type>
      <scope>provided</scope>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.geotools</groupId>
      <artifactId>gt-bom</artifactId>
      <version>${project.version}</version>
      <type>pom</type>
      <scope>provided</scope>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.eclipse.imagen</groupId>
      <artifactId>imagen-core</artifactId>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <id>enforce-managed-versions</id>
      <activation>
        <property>
          <name>qa</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <dependencies>
              <dependency>
                <groupId>org.geotools.maven</groupId>
                <artifactId>gt-enforce-managed-dependencies</artifactId>
                <version>${project.version}</version>
              </dependency>
            </dependencies>
            <executions>
              <execution>
                <id>enforce-managed-versions</id>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <enforceManagedDependencies>
                      <message>All dependency versions must be managed in gt-platform-dependencies or gt-bom. Unsupported modules may define their own dependencyManagement sections</message>
                      <failOnViolation>true</failOnViolation>
                      <allowSnapshots>false</allowSnapshots>
                      <allowTestScope>true</allowTestScope>
                      <excludes>
                        <exclude>org.geotools:gt-platform-dependencies</exclude>
                        <exclude>org.geotools:gt-bom</exclude>
                      </excludes>
                    </enforceManagedDependencies>
                  </rules>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
