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

    <parent>
        <groupId>com.lingyue</groupId>
        <artifactId>lingyue-zhibao</artifactId>
        <version>2.0.0</version>
    </parent>

    <artifactId>lingyue-starter</artifactId>
    <packaging>jar</packaging>

    <name>Lingyue Starter</name>
    <description>灵越智报启动器 - 整合所有微服务为单体应用</description>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    </properties>

    <dependencies>
        <!-- SpringDoc OpenAPI 文档 - 暂时排除以避免启动问题 -->
        <!--
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
        </dependency>
        
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>webjars-locator-core</artifactId>
        </dependency>
        -->

        <!-- spring-boot-devtools -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
        </dependency>

        <!-- 所有微服务模块 -->
        <dependency>
            <groupId>com.lingyue</groupId>
            <artifactId>common</artifactId>
            <version>${project.version}</version>
        </dependency>
        
        <dependency>
            <groupId>com.lingyue</groupId>
            <artifactId>auth-service</artifactId>
            <version>${project.version}</version>
        </dependency>
        
        <dependency>
            <groupId>com.lingyue</groupId>
            <artifactId>document-service</artifactId>
            <version>${project.version}</version>
        </dependency>
        
        <dependency>
            <groupId>com.lingyue</groupId>
            <artifactId>parse-service</artifactId>
            <version>${project.version}</version>
        </dependency>
        
        <dependency>
            <groupId>com.lingyue</groupId>
            <artifactId>ai-service</artifactId>
            <version>${project.version}</version>
        </dependency>
        
        <dependency>
            <groupId>com.lingyue</groupId>
            <artifactId>graph-service</artifactId>
            <version>${project.version}</version>
        </dependency>
        
        <dependency>
            <groupId>com.lingyue</groupId>
            <artifactId>notification-service</artifactId>
            <version>${project.version}</version>
        </dependency>
        
        <dependency>
            <groupId>com.lingyue</groupId>
            <artifactId>extract-service</artifactId>
            <version>${project.version}</version>
        </dependency>

        <!-- AOP -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-aop</artifactId>
        </dependency>

        <!-- PostgreSQL Driver -->
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
        </dependency>

        <!-- Spring Boot JDBC -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
        </dependency>

        <!-- Spring Boot Actuator -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>

        <!-- Lombok -->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>

        <!-- 测试所需 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <excludes>
                    <exclude>**/*.sample</exclude>
                </excludes>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <fork>true</fork>
                    <excludes>
                        <exclude>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                        </exclude>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- 移除了 maven-jar-plugin 的排除配置，确保 application.properties 被打包 -->
        </plugins>
        <finalName>${project.artifactId}</finalName>
    </build>
</project>

