<?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">
  <parent>
    <groupId>org.alfresco</groupId>
    <artifactId>alfresco-super-pom</artifactId>
    <version>12</version>
  </parent>

  <modelVersion>4.0.0</modelVersion>
  <artifactId>alfresco-database-connector-parent</artifactId>
  <packaging>pom</packaging>
  <name>Alfresco Database Connector :: Parent</name>
  <version>1.8.0-A.4-SNAPSHOT</version>
  <description>Alfresco Database Connector :: Parent</description>
  <licenses>
    <license>
      <name>GNU Lesser General Public License v3.0 or later</name>
      <url>https://www.gnu.org/licenses/lgpl-3.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <modules>
    <module>alfresco-database-connector-api</module>
    <module>alfresco-database-connector</module>
  </modules>

  <scm>
    <url>http://github.com/${project.scm.organization}/${project.scm.repository}</url>
    <connection>
      scm:git:https://github.com/${project.scm.organization}/${project.scm.repository}.git
    </connection>
    <developerConnection>
      scm:git:https://github.com/${project.scm.organization}/${project.scm.repository}.git
    </developerConnection>
    <tag>HEAD</tag>
  </scm>
  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/${project.scm.organization}/${project.scm.repository}/issues</url>
  </issueManagement>
  <ciManagement>
    <system>GitHub</system>
    <url>https://github.com/${project.scm.organization}/${project.scm.repository}/actions</url>
  </ciManagement>
  <distributionManagement>
    <repository>
      <id>alfresco-public</id>
      <name>Alfresco Public Repository</name>
      <url>https://artifacts.alfresco.com/nexus/content/repositories/releases/</url>
    </repository>
    <snapshotRepository>
      <id>alfresco-public-snapshots</id>
      <name>Alfresco Public Snapshots Repository</name>
      <url>https://artifacts.alfresco.com/nexus/content/repositories/snapshots/</url>
    </snapshotRepository>
  </distributionManagement>

  <properties>
    <maven.build.sourceVersion>17</maven.build.sourceVersion>
    <project.scm.organization>Alfresco</project.scm.organization>
    <project.scm.repository>alfresco-database-connector</project.scm.repository>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <project.year>2026</project.year>
    <licenseName>community</licenseName>

    <license-maven-plugin.version>2.5.0</license-maven-plugin.version>
    <maven-jar-plugin.version>3.4.2</maven-jar-plugin.version>

    <spring-boot.version>3.5.5</spring-boot.version>

    <!-- Needed for running integration tests-->
    <dist.alfresco.version>26.1.0-A.9</dist.alfresco.version>
    <dist.postgres.version>16.6</dist.postgres.version>
    <dist.activemq.version>5.18.6</dist.activemq.version>
    <dist.activemq.docker.tag>${dist.activemq.version}-jre17-rockylinux8</dist.activemq.docker.tag>
    <dist.insight-engine.version>2.0.15</dist.insight-engine.version>

    <testcontainers.version>2.0.3</testcontainers.version>
    <postgresql.version>42.7.7</postgresql.version>
    <mysql.version>8.0.33</mysql.version>

    <junit.jupiter.version>5.13.4</junit.jupiter.version>
    <mockito.version>5.19.0</mockito.version>
    <assertj.version>3.27.6</assertj.version>

    <dependency.hsqldb.version>2.7.4</dependency.hsqldb.version>
    <spotless-plugin.version>2.45.0</spotless-plugin.version>
    <commons-lang3.version>3.20.0</commons-lang3.version>
  </properties>

  <repositories>
    <repository>
      <id>central</id>
      <name>Central Repository</name>
      <url>https://repo.maven.apache.org/maven2</url>
      <layout>default</layout>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>alfresco-internal</id>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <name>Alfresco Internal Repository</name>
      <url>https://artifacts.alfresco.com/nexus/content/groups/internal/</url>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>alfresco-internal-plugin</id>
      <name>Alfresco Internal Repository</name>
      <url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
    </pluginRepository>
  </pluginRepositories>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.hsqldb</groupId>
        <artifactId>hsqldb</artifactId>
        <version>${dependency.hsqldb.version}</version>
      </dependency>
      <dependency>
        <groupId>org.testcontainers</groupId>
        <artifactId>testcontainers-bom</artifactId>
        <version>${testcontainers.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>${spring-boot.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
<dependency>
        <groupId>org.postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <version>${postgresql.version}</version>
      </dependency>
      <!-- Added as part of fixing vulnerability (PRODSEC-10503), Please remove it if no more needed -->
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>${commons-lang3.version}</version>
      </dependency>
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter</artifactId>
        <version>${junit.jupiter.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>${mockito.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-junit-jupiter</artifactId>
        <version>${mockito.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-core</artifactId>
        <version>${assertj.version}</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>${license-maven-plugin.version}</version>
          <executions>
            <execution>
              <id>third-party-licenses</id>
              <goals>
                <goal>add-third-party</goal>
              </goals>
              <phase>generate-resources</phase>
              <!-- Override of dual licenses is not working due to https://github.com/mojohaus/license-maven-plugin/issues/386 -->
              <!-- Overrides are listed in README instead -->
              <configuration>
                <failOnMissing>true</failOnMissing>
                <excludedScopes>provided,test</excludedScopes>
                <excludedGroups>org.alfresco</excludedGroups>
                <failIfWarning>true</failIfWarning>
                <includedLicenses>https://raw.githubusercontent.com/Alfresco/third-party-license-overrides/master/includedLicenses.txt</includedLicenses>
                <licenseMergesUrl>https://raw.githubusercontent.com/Alfresco/third-party-license-overrides/master/licenseMerges.txt</licenseMergesUrl>
                <overrideUrl>https://raw.githubusercontent.com/Alfresco/third-party-license-overrides/master/override-THIRD-PARTY.properties</overrideUrl>
              </configuration>
            </execution>
            <execution>
              <id>check-licenses</id>
              <phase>compile</phase>
              <goals>
                <goal>check-file-header</goal>
              </goals>
              <configuration>
                <addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
                <organizationName>Alfresco Software Limited</organizationName>
                <failOnMissingHeader>true</failOnMissingHeader>
                <failOnNotUptodateHeader>true</failOnNotUptodateHeader>
                <licenseResolver>classpath://alfresco</licenseResolver>
                <licenseName>${licenseName}</licenseName>
                <roots>
                  <root>src</root>
                </roots>
                <includes>
                  <include>**/*.java</include>
                  <include>**/*.jsp</include>
                </includes>
              </configuration>
            </execution>
          </executions>
          <dependencies>
            <dependency>
              <groupId>org.alfresco</groupId>
              <artifactId>alfresco-license-headers</artifactId>
              <version>1.0</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <artifactId>maven-site-plugin</artifactId>
          <configuration>
            <skip>true</skip>
            <skipDeploy>true</skipDeploy>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-maven-plugin</artifactId>
          <configuration>
            <!--Change in the layout is needed to switch from the Spring Boot's JarLauncher to the PropertiesLauncher.
                PropertiesLauncher allows us to specify an additional directory for loading jdbc drivers (Loader-Path
                added by the maven-jar-plugin below) -->
            <layout>ZIP</layout>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <version>${maven-jar-plugin.version}</version>
          <configuration>
            <archive>
              <manifestEntries>
                <Loader-Path>db-drivers/</Loader-Path>
              </manifestEntries>
            </archive>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.3.1</version>
          <executions>
            <execution>
              <id>attach-sources</id>
              <goals>
                <goal>jar-no-fork</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <configuration>
            <compilerArgs>
              <arg>-parameters</arg>
            </compilerArgs>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>3.0.0-M9</version>
        <configuration>
          <argLine>-Xmx1024m</argLine>
          <includes>
            <include>**/*Test.java</include>
            <include>**/*Tests.java</include>
          </includes>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>3.5.3</version>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <argLine>-Xmx1024m</argLine>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.8.13</version>
        <executions>
          <execution>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>license-maven-plugin</artifactId>
      </plugin>

      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
          <tagNameFormat>@{project.version}</tagNameFormat>
          <autoVersionSubmodules>true</autoVersionSubmodules>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <version>${spotless-plugin.version}</version>
        <configuration>
          <java>
            <eclipse>
              <file>https://raw.githubusercontent.com/Alfresco/alfresco-community-repo/refs/heads/master/alfresco-formatter.xml</file>
            </eclipse>
            <importOrder>
              <order>\#java|\#javax|\#jakarta,\#,\#org.alfresco,java|javax|jakarta,,org.alfresco</order>
            </importOrder>
            <removeUnusedImports />
            <formatAnnotations />
          </java>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
    </plugins>
  </build>
</project>
