<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <groupId>ai.timefold.solver</groupId>
  <artifactId>timefold-solver-parent</artifactId>
  <packaging>pom</packaging>
  <version>1.4.0</version>

  <name>Timefold Solver multiproject parent</name>
  <description>
    Timefold solves planning problems.
    This lightweight, embeddable planning engine implements powerful and scalable algorithms
    to optimize business resource scheduling and planning.

    This module is just the multiproject parent. The planning engine itself is in timefold-solver-core.
  </description>
  <url>https://timefold.ai</url>
  <inceptionYear>2006</inceptionYear>
  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <properties>
    <version.javadoc.plugin>3.6.2</version.javadoc.plugin>
    <version.rewrite.plugin>5.10.0</version.rewrite.plugin>
    <version.source.plugin>3.3.0</version.source.plugin>
    <version.resources.plugin>3.3.1</version.resources.plugin>
    <sonar.moduleKey>${project.groupId}:${project.artifactId}</sonar.moduleKey>
  </properties>

  <scm>
    <connection>scm:git:git@github.com:TimefoldAI/timefold-solver.git</connection>
    <developerConnection>scm:git:git@github.com:TimefoldAI/timefold-solver.git</developerConnection>
    <url>https://github.com/TimefoldAI/timefold-solver</url>
  </scm>
  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/TimefoldAI/solver/issues/</url>
  </issueManagement>
  <developers>
    <developer>
      <name>Timefold Community</name>
      <organization>Timefold</organization>
      <organizationUrl>https://timefold.ai</organizationUrl>
    </developer>
  </developers>

  <modules>
    <module>build/bom</module>
    <module>build/ide-config</module>
    <module>build/build-parent</module>
    <module>core</module>
    <module>persistence</module>
    <module>benchmark</module><!-- TODO move to tools/benchmark -->
    <module>test</module><!-- TODO move to core/test -->
    <module>spring-integration</module>
    <module>quarkus-integration</module>
    <module>tools</module>
    <module>migration</module><!-- TODO move to tools/migration -->
    <module>examples</module>
  </modules>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>${version.source.plugin}</version>
        </plugin>
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>${version.resources.plugin}</version>
          <configuration>
            <encoding>UTF-8</encoding>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${version.javadoc.plugin}</version>
          <configuration>
            <author>false</author>
            <failOnError>true</failOnError>
            <quiet>true</quiet>
            <legacyMode>true</legacyMode>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <id>fullProfile</id>
      <activation>
        <property>
          <name>full</name>
        </property>
      </activation>
      <modules>
        <module>docs</module>
      </modules>
      <build>
        <plugins>
          <plugin>
            <!--
              All modules need this to be able to publish on Maven Central.
              Can not go into build-parent, because build-parent required ide-config.
              Therefore ide-config needs to depend on this parent and still publish sources.
            -->
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-sources</id>
                <phase>verify</phase>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin> <!-- Make sure the build fails-fast on Javadoc issues. -->
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>build-javadoc-jar</id>
                <phase>package</phase>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <!--
        Migration to Timefold 9 involves upgrading to Quarkus 3, Spring Boot 3 and migrating to jakarta.* packages.
        Timefold 8 remains compatible with Quarkus 2, Spring Boot 2 and javax.* packages.
        Both Timefold 8 and 9 are functionally equal and will be released simultaneously.
      -->
      <id>8-to-9-migration</id>
      <activation>
        <property>
          <name>migration</name>
        </property>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.openrewrite.maven</groupId>
              <artifactId>rewrite-maven-plugin</artifactId>
              <version>${version.rewrite.plugin}</version>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
  </profiles>
</project>
