<?xml version="1.0"?>
<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>

  <!-- Artifact information -->
  <groupId>org.basex</groupId>
  <artifactId>basex-parent</artifactId>
  <version>13.0-SNAPSHOT</version>
  <packaging>pom</packaging>

  <modules>
    <module>basex-core</module>
    <module>basex-api</module>
  </modules>

  <properties>
    <maven.compiler.release>21</maven.compiler.release>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <project.lib.directory>lib</project.lib.directory>
    <jettyVersion>12.1.12</jettyVersion>
    <junit.version>6.1.2</junit.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.junit.platform</groupId>
        <artifactId>junit-platform-commons</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>jp.sourceforge.igo</groupId>
        <artifactId>igo</artifactId>
        <version>0.4.3</version>
        <scope>runtime</scope>
        <optional>true</optional>
      </dependency>
      <dependency>
        <groupId>org.apache</groupId>
        <artifactId>lucene-stemmers</artifactId>
        <version>3.4.0</version>
        <scope>runtime</scope>
        <optional>true</optional>
      </dependency>
      <dependency>
        <groupId>org.ccil.cowan.tagsoup</groupId>
        <artifactId>tagsoup</artifactId>
        <version>1.2.1</version>
        <scope>runtime</scope>
        <optional>true</optional>
      </dependency>
      <dependency>
        <groupId>nu.validator</groupId>
        <artifactId>htmlparser</artifactId>
        <version>1.4.16</version>
        <scope>runtime</scope>
        <optional>true</optional>
      </dependency>
      <dependency>
        <groupId>jline</groupId>
        <artifactId>jline</artifactId>
        <version>2.14.6</version>
        <scope>runtime</scope>
        <optional>true</optional>
      </dependency>
      <dependency>
        <groupId>org.relaxng</groupId>
        <artifactId>jing</artifactId>
        <version>20241231</version>
        <scope>runtime</scope>
        <optional>true</optional>
        <exclusions>
          <exclusion>
            <groupId>*</groupId>
            <artifactId>*</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>net.xqj</groupId>
        <artifactId>basex-xqj</artifactId>
        <version>13.0-SNAPSHOT</version>
      </dependency>
      <dependency>
        <groupId>org.xmldb</groupId>
        <artifactId>xmldb-api</artifactId>
        <version>1.0</version>
      </dependency>
      <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-server</artifactId>
        <version>${jettyVersion}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.eclipse.jetty.ee10</groupId>
        <artifactId>jetty-ee10-servlet</artifactId>
        <version>${jettyVersion}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.eclipse.jetty.ee10</groupId>
        <artifactId>jetty-ee10-servlets</artifactId>
        <version>${jettyVersion}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.eclipse.jetty.ee10</groupId>
        <artifactId>jetty-ee10-webapp</artifactId>
        <version>${jettyVersion}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.eclipse.jetty.ee10.websocket</groupId>
        <artifactId>jetty-ee10-websocket-jetty-server</artifactId>
        <version>${jettyVersion}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.eclipse.jetty.websocket</groupId>
        <artifactId>jetty-websocket-jetty-api</artifactId>
        <version>${jettyVersion}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.eclipse.jetty.compression</groupId>
        <artifactId>jetty-compression-server</artifactId>
        <version>${jettyVersion}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.eclipse.jetty.compression</groupId>
        <artifactId>jetty-compression-gzip</artifactId>
        <version>${jettyVersion}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>2.0.18</version>
      </dependency>
      <dependency>
        <groupId>de.bottlecaps</groupId>
        <artifactId>markup-blitz</artifactId>
        <version>1.12</version>
        <scope>runtime</scope>
        <optional>true</optional>
      </dependency>
      <dependency>
        <groupId>com.ibm.icu</groupId>
        <artifactId>icu4j</artifactId>
        <version>78.3</version>
        <scope>provided</scope>
        <optional>true</optional>
      </dependency>
      <dependency>
        <groupId>net.sf.saxon</groupId>
        <artifactId>Saxon-HE</artifactId>
        <version>13.0</version>
        <scope>provided</scope>
        <optional>true</optional>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <!-- Project Information -->
  <name>BaseX</name>
  <description>BaseX XML database and XPath/XQuery processor</description>
  <url>https://basex.org</url>
  <inceptionYear>2005</inceptionYear>

  <licenses>
    <license>
      <name>BSD License</name>
      <url>https://www.opensource.org/licenses/bsd-license.php</url>
    </license>
  </licenses>

  <organization>
    <name>BaseX Team</name>
    <url>https://basex.org</url>
  </organization>

  <!-- Environment Settings -->
  <issueManagement>
    <system>GitHub Tracker</system>
    <url>https://github.com/BaseXdb/basex/issues</url>
  </issueManagement>

  <mailingLists>
    <mailingList>
      <name>BaseX Talk</name>
      <post>basex-talk@mailman.uni-konstanz.de</post>
      <archive>https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk</archive>
    </mailingList>
  </mailingLists>

  <developers>
    <developer>
      <name>Christian Grün</name>
      <email>cg@basex.org</email>
      <organization>BaseX Team</organization>
      <organizationUrl>https://basex.org</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git://github.com/BaseXdb/basex.git</connection>
    <developerConnection>scm:git:git@github.com:BaseXdb/basex.git</developerConnection>
    <url>https://github.com/BaseXdb/basex</url>
    <tag>HEAD</tag>
  </scm>

  <repositories>
    <repository>
      <id>basex</id>
      <name>BaseX Maven Repository</name>
      <url>https://files.basex.org/maven</url>
    </repository>
  </repositories>

  <profiles>
    <profile>
      <id>central</id>
      <distributionManagement>
        <snapshotRepository>
          <id>basex-publish</id>
          <url>https://central.sonatype.com/repository/maven-snapshots/</url>
        </snapshotRepository>
      </distributionManagement>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>3.8.0</version>
            <inherited>true</inherited>
            <executions>
              <execution>
                <id>create-executable-jar</id>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <descriptorRefs>
                <descriptorRef>src</descriptorRef>
              </descriptorRefs>
              <appendAssemblyId>false</appendAssemblyId>
            </configuration>
          </plugin>

          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.2.8</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <keyname>cg@basex.org</keyname>
                  <!-- This is necessary for gpg to not try to use the pinentry programs -->
                  <gpgArguments>
                    <arg>--pinentry-mode</arg>
                    <arg>loopback</arg>
                  </gpgArguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.12.0</version>
            <inherited>true</inherited>
            <configuration>
              <doclint>none</doclint>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>

          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <version>0.11.0</version>
            <extensions>true</extensions>
            <configuration>
              <publishingServerId>basex-publish</publishingServerId>
              <autoPublish>true</autoPublish>
              <waitUntil>published</waitUntil>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <!-- Build Settings -->
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>javacc-maven-plugin</artifactId>
          <version>3.2.0</version>
          <inherited>true</inherited>
          <executions>
            <execution>
              <id>generate-all-parsers</id>
              <phase>generate-sources</phase>
              <goals>
                <goal>javacc</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <outputDirectory>src/main/java</outputDirectory>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.15.0</version>
          <inherited>true</inherited>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>buildnumber-maven-plugin</artifactId>
          <version>3.3.0</version>
          <executions>
            <execution>
              <phase>validate</phase>
              <goals>
                <goal>create</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <doCheck>false</doCheck>
            <doUpdate>false</doUpdate>
            <shortRevisionLength>7</shortRevisionLength>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.5.1</version>
          <inherited>true</inherited>
          <configuration>
            <archive>
              <manifest>
                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              </manifest>
              <manifestEntries>
                <Implementation-Build>${buildNumber}</Implementation-Build>
              </manifestEntries>
            </archive>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>3.5.6</version>
          <inherited>true</inherited>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.4.0</version>
          <inherited>true</inherited>
          <configuration>
            <outputDirectory>target</outputDirectory>
          </configuration>
          <executions>
            <execution>
              <id>attach-sources</id>
              <phase>package</phase>
              <goals>
                <goal>jar-no-fork</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>3.3.1</version>
          <configuration>
            <tagNameFormat>@{project.version}</tagNameFormat>
            <releaseProfiles>central</releaseProfiles>
            <scmCommentPrefix>Release: </scmCommentPrefix>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>3.11.0</version>
          <inherited>true</inherited>
          <configuration>
            <outputDirectory>${project.lib.directory}</outputDirectory>
            <includeScope>runtime</includeScope>
          </configuration>
          <executions>
            <execution>
              <id>copy-libs</id>
              <phase>package</phase>
              <goals>
                <goal>copy-dependencies</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>3.6.3</version>
          <inherited>true</inherited>
          <executions>
            <execution>
              <goals>
                <goal>java</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>3.1.4</version>
          <inherited>true</inherited>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>3.6.0</version>
          <inherited>true</inherited>
          <executions>
            <execution>
              <phase>test</phase>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <configLocation>.settings/checkstyle.xml</configLocation>
            <failsOnError>true</failsOnError>
            <includeTestSourceDirectory>true</includeTestSourceDirectory>
            <linkXRef>false</linkXRef>
            <consoleOutput>true</consoleOutput>
            <violationSeverity>warning</violationSeverity>
          </configuration>
        </plugin>

      </plugins>
    </pluginManagement>

    <extensions>
      <extension>
        <groupId>org.apache.maven.wagon</groupId>
        <artifactId>wagon-ssh-external</artifactId>
        <version>3.5.3</version>
      </extension>
    </extensions>
  </build>
</project>
