<?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>10.6</version>
  <packaging>pom</packaging>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

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

  <properties>
    <compileSource>11</compileSource>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <project.lib.directory>lib</project.lib.directory>
    <jettyVersion>9.4.51.v20230217</jettyVersion>
    <junit.version>5.9.2</junit.version>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>
  </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>1.9.2</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>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>20220510</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>10.0</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</groupId>
        <artifactId>jetty-servlet</artifactId>
        <version>${jettyVersion}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-servlets</artifactId>
        <version>${jettyVersion}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-webapp</artifactId>
        <version>${jettyVersion}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.eclipse.jetty.websocket</groupId>
        <artifactId>websocket-server</artifactId>
        <version>${jettyVersion}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>com.ettrema</groupId>
        <artifactId>milton-api</artifactId>
        <version>1.8.1.4</version>
        <exclusions>
          <exclusion>
            <artifactId>commons-logging</artifactId>
            <groupId>commons-logging</groupId>
          </exclusion>
          <exclusion>
            <artifactId>commons-beanutils</artifactId>
            <groupId>commons-beanutils</groupId>
          </exclusion>
          <exclusion>
            <artifactId>slf4j-log4j12</artifactId>
            <groupId>org.slf4j</groupId>
          </exclusion>
          <exclusion>
            <artifactId>log4j</artifactId>
            <groupId>log4j</groupId>
          </exclusion>
          <exclusion>
            <artifactId>slf4j-api</artifactId>
            <groupId>org.slf4j</groupId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>commons-fileupload</groupId>
        <artifactId>commons-fileupload</artifactId>
        <version>1.5</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>1.7.36</version>
      </dependency>
      <dependency>
        <groupId>org.nineml</groupId>
        <artifactId>coffeefilter</artifactId>
        <version>2.0.0</version>
        <scope>runtime</scope>
        <optional>true</optional>
      </dependency>
      <dependency>
        <groupId>org.nineml</groupId>
        <artifactId>coffeegrinder</artifactId>
        <version>2.0.0</version>
        <scope>runtime</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>
    <repository>
      <id>central</id>
      <name>Central Maven Repository</name>
      <url>https://repo1.maven.org/maven2/</url>
    </repository>
  </repositories>

  <profiles>
    <profile>
      <id>only-eclipse</id>
      <activation>
        <property>
          <name>m2e.version</name>
        </property>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <!-- Eclipse m2e plugin does not "support plugin execution" -->
            <!-- we need to tell it to ignore the goals -->
            <plugin>
              <groupId>org.eclipse.m2e</groupId>
              <artifactId>lifecycle-mapping</artifactId>
              <version>1.0.0</version>
              <inherited>true</inherited>
              <configuration>
                <lifecycleMappingMetadata>
                  <pluginExecutions>
                    <pluginExecution>
                      <pluginExecutionFilter>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <versionRange>[2.0,)</versionRange>
                        <goals>
                          <goal>copy-dependencies</goal>
                        </goals>
                      </pluginExecutionFilter>
                      <action>
                        <ignore />
                      </action>
                    </pluginExecution>
                    <pluginExecution>
                      <pluginExecutionFilter>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>javacc-maven-plugin</artifactId>
                        <versionRange>[2.6,)</versionRange>
                        <goals>
                          <goal>javacc</goal>
                        </goals>
                      </pluginExecutionFilter>
                      <action>
                        <ignore />
                      </action>
                    </pluginExecution>
                  </pluginExecutions>
                </lifecycleMappingMetadata>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>

    <profile>
      <id>ossrh</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>3.5.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.0.1</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <!-- 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.5.0</version>
            <inherited>true</inherited>
            <configuration>
              <doclint>none</doclint>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <!-- Build Settings -->
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>javacc-maven-plugin</artifactId>
          <version>3.0.1</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.11.0</version>
          <inherited>true</inherited>
          <configuration>
            <source>${compileSource}</source>
            <target>${compileSource}</target>
            <!-- https://jira.codehaus.org/browse/MCOMPILER-205 -->
            <useIncrementalCompilation>false</useIncrementalCompilation>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>buildnumber-maven-plugin</artifactId>
          <version>3.0.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.3.0</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.0.0</version>
          <inherited>true</inherited>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.2.1</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.0.0</version>
          <configuration>
            <tagNameFormat>@{project.version}</tagNameFormat>
            <releaseProfiles>ossrh</releaseProfiles>
            <scmCommentPrefix>Release: </scmCommentPrefix>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>3.5.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.1.0</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.1</version>
          <inherited>true</inherited>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>3.2.1</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>

        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <version>1.6.13</version>
          <extensions>true</extensions>
          <configuration>
            <serverId>ossrh</serverId>
            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
            <autoReleaseAfterClose>true</autoReleaseAfterClose>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>

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