<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>3.5.7</version>
    <relativePath></relativePath>
  </parent>
  <groupId>cn.meowrain.aioj</groupId>
  <artifactId>ai-oj</artifactId>
  <version>1.0.0</version>
  <packaging>pom</packaging>
  <name>ai-oj-microservices</name>
  <description>一款集成了AI功能的OJ判题系统</description>
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0</url>
    </license>
  </licenses>
  <modules>
    <module>aioj-backend-common</module>
    <module>aioj-backend-gateway</module>
    <module>aioj-backend-judge-service</module>
    <module>aioj-backend-user-service</module>
    <module>aioj-backend-question-service</module>
    <module>aioj-backend-ai-service</module>
    <module>aioj-backend-auth</module>
    <module>aioj-backend-upms</module>
    <module>aioj-backend-file-service</module>
  </modules>
  <properties>
    <docker.spring.active>dev</docker.spring.active>
    <flatten.plugin.version>1.6.0</flatten.plugin.version>
    <git.commit.plugin>9.0.2</git.commit.plugin>
    <java.version>17</java.version>
    <jib.plugin.version>3.4.5</jib.plugin.version>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <spring-boot.version>3.5.7</spring-boot.version>
    <spring-cloud-alibaba.version>2025.0.0.0</spring-cloud-alibaba.version>
    <revision>1.0.0</revision>
    <spring-cloud.version>2025.0.0</spring-cloud.version>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <maven.compiler.plugin.version>3.14.1</maven.compiler.plugin.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <spring.checkstyle.plugin>0.0.47</spring.checkstyle.plugin>
  </properties>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>cn.meowrain.aioj</groupId>
        <artifactId>aioj-backend-common-bom</artifactId>
        <version>1.0.0</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.springframework.cloud</groupId>
        <artifactId>spring-cloud-dependencies</artifactId>
        <version>${spring-cloud.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>com.alibaba.cloud</groupId>
        <artifactId>spring-cloud-alibaba-dependencies</artifactId>
        <version>${spring-cloud-alibaba.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <optional>true</optional>
    </dependency>
  </dependencies>
  <build>
    <resources>
      <resource>
        <filtering>true</filtering>
        <directory>src/main/resources</directory>
      </resource>
    </resources>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>com.google.cloud.tools</groupId>
          <artifactId>jib-maven-plugin</artifactId>
          <version>${jib.plugin.version}</version>
          <executions>
            <execution>
              <phase>package</phase>
              <goals>
                <goal>build</goal>
                <goal>buildTar</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <allowInsecureRegistries>true</allowInsecureRegistries>
            <from>
              <image>registry.cn-shanghai.aliyuncs.com/all_lib/eclipse-temurin:17.0.10_7-jdk-jammy</image>
            </from>
            <to>
              <image>10.0.0.3/aioj/${project.artifactId}:${project.version}</image>
              <tags>
                <tag>${project.version}</tag>
              </tags>
              <auth>
                <username></username>
                <password></password>
              </auth>
            </to>
            <outputPaths>
              <tar>${project.build.directory}/${project.artifactId}-${project.version}.tar</tar>
            </outputPaths>
            <container>
              <environment>
                <TZ>Asia/Shanghai</TZ>
                <PROFILES_ACTIVE>${docker.spring.active}</PROFILES_ACTIVE>
              </environment>
              <jvmFlags>
                <jvmFlag>-Xms512m</jvmFlag>
                <jvmFlag>-Xmx512m</jvmFlag>
              </jvmFlags>
            </container>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${maven.compiler.plugin.version}</version>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
          <encoding>UTF-8</encoding>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <version>${spring-boot.version}</version>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>flatten-maven-plugin</artifactId>
        <version>${flatten.plugin.version}</version>
        <executions>
          <execution>
            <id>flatten</id>
            <phase>process-resources</phase>
            <goals>
              <goal>flatten</goal>
            </goals>
          </execution>
          <execution>
            <id>flatten.clean</id>
            <phase>clean</phase>
            <goals>
              <goal>clean</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <updatePomFile>true</updatePomFile>
          <flattenMode>resolveCiFriendliesOnly</flattenMode>
        </configuration>
      </plugin>
      <plugin>
        <groupId>io.spring.javaformat</groupId>
        <artifactId>spring-javaformat-maven-plugin</artifactId>
        <version>${spring.checkstyle.plugin}</version>
        <executions>
          <execution>
            <phase>validate</phase>
            <inherited>true</inherited>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>io.github.git-commit-id</groupId>
        <artifactId>git-commit-id-maven-plugin</artifactId>
        <version>${git.commit.plugin}</version>
        <executions>
          <execution>
            <id>get-the-git-infos</id>
            <phase>initialize</phase>
          </execution>
        </executions>
        <configuration>
          <failOnNoGitDirectory>false</failOnNoGitDirectory>
          <generateGitPropertiesFile>true</generateGitPropertiesFile>
          <dateFormat>yyyy-MM-dd HH:mm:ss</dateFormat>
          <includeOnlyProperties>
            <includeOnlyProperty>^git.build.(time|version)$</includeOnlyProperty>
            <includeOnlyProperty>^git.commit.(id|message|time).*$</includeOnlyProperty>
          </includeOnlyProperties>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>dev</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
        <env>dev</env>
      </properties>
    </profile>
    <profile>
      <id>test</id>
      <properties>
        <env>test</env>
      </properties>
    </profile>
    <profile>
      <id>prod</id>
      <properties>
        <env>prod</env>
      </properties>
    </profile>
  </profiles>
</project>
