<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>

  <groupId>com.llmrix</groupId>
  <artifactId>orion-open</artifactId>
  <version>1.3.0</version>
  <packaging>pom</packaging>

  <name>orion-open</name>
  <description>Orion Open - An open-source AI agent platform for building, deploying, and managing intelligent conversational agents</description>
  <url>https://github.com/llmrix/orion-open</url>

  <licenses>
    <license>
      <name>GNU Library or Lesser General Public License (LGPL)</name>
      <url>http://www.gnu.org/licenses/lgpl.html</url>
    </license>
  </licenses>

  <organization>
    <name>llmrix</name>
    <url>https://www.llmrix.com</url>
  </organization>

  <scm>
    <connection>scm:git:git@github.com:llmrix/orion-open.git</connection>
    <developerConnection>scm:git:git@github.com:llmrix/orion-open.git</developerConnection>
    <url>https://github.com/llmrix/orion-open</url>
  </scm>

  <developers>
    <developer>
      <id>llmrix</id>
      <name>llmrix</name>
      <email>ailab@llmrix.com</email>
      <url>https://github.com/llmrix/orion-open/</url>
      <organizationUrl>https://www.llmrix.com</organizationUrl>
      <timezone>+8</timezone>
    </developer>
  </developers>

  <issueManagement>
    <system>github</system>
    <url>https://github.com/llmrix/orion-open.git/issues</url>
  </issueManagement>

  <modules>
    <module>orion-model</module>
    <module>orion-mould</module>
    <module>orion-public</module>
  </modules>

  <properties>
    <java.version>17</java.version>
    <maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target>
    <maven.java.version>17</maven.java.version>
    <maven.compiler.version>3.13.0</maven.compiler.version>
    <maven.surefire.version>3.0.0-M5</maven.surefire.version>
    <spring.checkstyle.plugin>0.0.38</spring.checkstyle.plugin>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <spring-boot.version>3.2.1</spring-boot.version>
    <mybatis-plus.version>3.5.14</mybatis-plus.version>
    <sa-token.version>1.45.0</sa-token.version>
    <swagger-annotations.version>2.2.25</swagger-annotations.version>
    <knife4j.version>4.5.0</knife4j.version>
    <postgresql.version>42.7.3</postgresql.version>
    <hutool.version>5.8.26</hutool.version>
    <guava.version>32.1.3-jre</guava.version>
    <commons-lang3.version>3.17.0</commons-lang3.version>
    <lombok.version>1.18.42</lombok.version>
    <jobrunr.version>7.3.2</jobrunr.version>
    <orion.boxes.version>1.2.8</orion.boxes.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <!-- Spring Boot BOM -->
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>${spring-boot.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <!-- MyBatis-Plus -->
      <dependency>
        <groupId>com.baomidou</groupId>
        <artifactId>mybatis-plus-spring-boot3-starter</artifactId>
        <version>${mybatis-plus.version}</version>
      </dependency>
      <dependency>
        <groupId>com.baomidou</groupId>
        <artifactId>mybatis-plus-annotation</artifactId>
        <version>${mybatis-plus.version}</version>
      </dependency>
      <dependency>
        <groupId>com.baomidou</groupId>
        <artifactId>mybatis-plus-core</artifactId>
        <version>${mybatis-plus.version}</version>
      </dependency>
      <dependency>
        <groupId>com.baomidou</groupId>
        <artifactId>mybatis-plus-spring</artifactId>
        <version>${mybatis-plus.version}</version>
      </dependency>
      <dependency>
        <groupId>org.mybatis</groupId>
        <artifactId>mybatis</artifactId>
        <version>3.5.19</version>
      </dependency>
      <!-- Sa-Token -->
      <dependency>
        <groupId>cn.dev33</groupId>
        <artifactId>sa-token-spring-boot3-starter</artifactId>
        <version>${sa-token.version}</version>
      </dependency>
      <dependency>
        <groupId>cn.dev33</groupId>
        <artifactId>sa-token-redis-jackson</artifactId>
        <version>${sa-token.version}</version>
      </dependency>

      <!-- Knife4j -->
      <dependency>
        <groupId>com.github.xiaoymin</groupId>
        <artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId>
        <version>${knife4j.version}</version>
      </dependency>

      <!-- PostgreSQL -->
      <dependency>
        <groupId>org.postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <version>${postgresql.version}</version>
        <scope>runtime</scope>
      </dependency>

      <!-- Hutool -->
      <dependency>
        <groupId>cn.hutool</groupId>
        <artifactId>hutool-all</artifactId>
        <version>${hutool.version}</version>
      </dependency>
      <dependency>
        <groupId>cn.hutool</groupId>
        <artifactId>hutool-crypto</artifactId>
        <version>${hutool.version}</version>
      </dependency>

      <!-- Guava -->
      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>${guava.version}</version>
      </dependency>

      <!-- Commons Lang3 -->
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>${commons-lang3.version}</version>
      </dependency>

      <!-- Lombok -->
      <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>${lombok.version}</version>
        <scope>provided</scope>
      </dependency>

      <!-- Jackson JSR310 -->
      <dependency>
        <groupId>com.fasterxml.jackson.datatype</groupId>
        <artifactId>jackson-datatype-jsr310</artifactId>
        <version>2.16.1</version>
      </dependency>

      <dependency>
        <groupId>com.llmrix</groupId>
        <artifactId>orion-dollar</artifactId>
        <version>${orion.boxes.version}</version>
      </dependency>
      <dependency>
        <groupId>com.llmrix</groupId>
        <artifactId>orion-status</artifactId>
        <version>${orion.boxes.version}</version>
      </dependency>
      <dependency>
        <groupId>com.llmrix</groupId>
        <artifactId>orion-skillet</artifactId>
        <version>${orion.boxes.version}</version>
      </dependency>
      <dependency>
        <groupId>com.llmrix</groupId>
        <artifactId>orion-terms</artifactId>
        <version>${orion.boxes.version}</version>
      </dependency>
      <dependency>
        <groupId>com.llmrix</groupId>
        <artifactId>orion-boxes-auth-starter</artifactId>
        <version>${orion.boxes.version}</version>
      </dependency>

      <!-- JobRunr — background job scheduler (dashboard disabled, engine only) -->
      <dependency>
        <groupId>org.jobrunr</groupId>
        <artifactId>jobrunr-spring-boot-3-starter</artifactId>
        <version>${jobrunr.version}</version>
      </dependency>

      <!-- Bucket4j — 令牌桶限流（Open API 配额） -->
      <dependency>
        <groupId>com.bucket4j</groupId>
        <artifactId>bucket4j-core</artifactId>
        <version>8.10.1</version>
      </dependency>

      <!-- JustAuth — third-party OAuth2 social login (Google, GitHub, etc.) -->
      <dependency>
        <groupId>me.zhyd.oauth</groupId>
        <artifactId>JustAuth</artifactId>
        <version>1.16.7</version>
      </dependency>
      <dependency>
        <groupId>com.github.ulisesbocchio</groupId>
        <artifactId>jasypt-spring-boot-starter</artifactId>
        <version>4.0.4</version>
      </dependency>
      <dependency>
        <groupId>io.swagger.core.v3</groupId>
        <artifactId>swagger-annotations-jakarta</artifactId>
        <version>${swagger-annotations.version}</version>
      </dependency>
      <dependency>
        <groupId>io.swagger.core.v3</groupId>
        <artifactId>swagger-annotations</artifactId>
        <version>${swagger-annotations.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <!--mvn versions:set -DnewVersion=1.9.2 -DprocessAllModules=true-->
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>versions-maven-plugin</artifactId>
          <version>2.13.0</version>
          <configuration>
            <generateBackupPoms>false</generateBackupPoms>
          </configuration>
        </plugin>
        <plugin>
          <groupId>io.spring.javaformat</groupId>
          <artifactId>spring-javaformat-maven-plugin</artifactId>
          <version>${spring.checkstyle.plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${maven.surefire.version}</version>
          <configuration>
            <skipTests>true</skipTests>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.3.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.3.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.3.0</version>
          <configuration>
            <charset>${project.build.sourceEncoding}</charset>
            <docencoding>${project.build.sourceEncoding}</docencoding>
            <additionalJOption>-Xdoclint:none</additionalJOption>
            <!-- JDK17+ javadoc 默认会打包 DejaVu 字体文件(单 jar 约 4MB),
                 34 个模块合计约 143MB,超过 Sonatype Central Portal 上传限制,
                 导致上传过程中服务端断开连接(Broken pipe)。
                 Sonatype Central Portal 不强制要求 javadoc jar,故禁用 -->
            <!--<skip>true</skip>-->
          </configuration>
          <executions>
            <execution>
              <phase>package</phase>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>3.2.4</version>
          <executions>
            <execution>
              <phase>verify</phase>
              <goals>
                <goal>sign</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <!-- CI 环境禁用交互式 pinentry，走 loopback -->
            <gpgArguments>
              <arg>--pinentry-mode</arg>
              <arg>loopback</arg>
            </gpgArguments>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.3.0</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>
          <version>${maven.compiler.version}</version>
          <configuration>
            <verbose>true</verbose>
            <fork>true</fork>
            <source>${maven.compiler.target}</source>
            <target>${maven.compiler.target}</target>
            <encoding>${project.build.sourceEncoding}</encoding>
            <parameters>true</parameters>
            <annotationProcessorPaths>
              <path>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>${lombok.version}</version>
              </path>
            </annotationProcessorPaths>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.sonatype.central</groupId>
          <artifactId>central-publishing-maven-plugin</artifactId>
          <version>0.11.0</version>
          <extensions>true</extensions>
          <configuration>
            <publishingServerId>sonatype</publishingServerId>
            <!-- Disable autoPublish to prevent 'failed while publishing' error.
                 Upload only; publish manually from Central Portal after validation. -->
            <autoPublish>true</autoPublish>
            <waitUntil>uploaded</waitUntil>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <modules>
        <module>orion-model</module>
        <module>orion-mould</module>
      </modules>
      <build>
        <plugins>
          <plugin>
            <!--mvn versions:set -DnewVersion=1.8.8 -DprocessAllModules=true-->
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>versions-maven-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
              <source>${maven.java.version}</source>
              <target>${maven.java.version}</target>
              <encoding>${project.build.sourceEncoding}</encoding>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <!--mac下用如下命令-->
  <!-- mvn -Dmaven.test.skip=true clean deploy -Prelease -Dgpg.executable=gpg -Dgpg.passphrase='password' 2>&1 -->
  <distributionManagement>
    <repository>
      <id>sonatype</id>
      <name>Central Portal</name>
      <url>https://central.sonatype.com/api/v1/publisher/deployments/maven2/</url>
    </repository>
  </distributionManagement>


</project>
