pom.xml 7.91 KB
<?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>

    <groupId>com.zteits.boot</groupId>
    <artifactId>parking-cloud</artifactId>
    <version>${revision}</version>
    <packaging>pom</packaging>

    <name>${project.artifactId}</name>
    <description>ZTEITS 智能停车云平台(模块化单体,单 Jar 发布)</description>

    <modules>
        <module>parking-dependencies</module>
        <module>parking-framework</module>
        <module>parking-module-api</module>
        <!-- 业务模块 -->
        <module>parking-module-system</module>

        <!-- 存量核心业务模块(P2 从 zteits-clouds 迁入)。
             ⚠️ park/order/pay/bill 四方互相调用,Dubbo 时代靠 XML 装配绕开了编译期依赖,
                改成进程内 DI 后就是 Maven 循环依赖,所以这四个**必须同时**进 reactor,
                不能只并入其中一两个。business 是 order 运行时依赖的随迁模块(见方案 4.6)。 -->
        <module>parking-module-park</module>
        <module>parking-module-order</module>
        <module>parking-module-pay</module>
        <module>parking-module-bill</module>
        <module>parking-module-charge</module>
        <module>parking-module-business</module>
        <!-- 设备采集(德飞地锁,对应老 zteits-glock-collection)。
             P2 阶段只有一个空实现:order 的两处裸 @Autowired DfGroundLockMsgPushService
             需要装配上才不至于启动失败;真实的 netty 实现在 P5 随迁。 -->
        <module>parking-module-datacollect</module>

        <!-- Server 主项目:唯一启动模块,产出唯一 Jar -->
        <module>parking-server</module>
    </modules>

    <properties>
        <revision>1.0.0-SNAPSHOT</revision>
        <!-- Maven 相关 -->
        <java.version>1.8</java.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <maven-surefire-plugin.version>3.2.5</maven-surefire-plugin.version>
        <maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
        <flatten-maven-plugin.version>1.6.0</flatten-maven-plugin.version>
        <lombok.version>1.18.30</lombok.version>
        <mapstruct.version>1.5.5.Final</mapstruct.version>
        <spring.boot.version>2.7.18</spring.boot.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.build.timestamp.format>yyyyMMdd-HHmm</maven.build.timestamp.format>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.zteits.boot</groupId>
                <artifactId>parking-dependencies</artifactId>
                <version>${revision}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <!-- maven-surefire-plugin 插件,用于运行单元测试。 -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                </plugin>
                <!-- maven-compiler-plugin 插件,解决 spring-boot-configuration-processor + Lombok + MapStruct 组合 -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <annotationProcessorPaths>
                            <path>
                                <groupId>org.springframework.boot</groupId>
                                <artifactId>spring-boot-configuration-processor</artifactId>
                                <version>${spring.boot.version}</version>
                            </path>
                            <path>
                                <groupId>org.projectlombok</groupId>
                                <artifactId>lombok</artifactId>
                                <version>${lombok.version}</version>
                            </path>
                            <path>
                                <!-- 确保 Lombok 生成的 getter/setter 方法能被 MapStruct 正确识别,
                                     避免出现 No property named "xxx" exists 的编译错误 -->
                                <groupId>org.projectlombok</groupId>
                                <artifactId>lombok-mapstruct-binding</artifactId>
                                <version>0.2.0</version>
                            </path>
                            <path>
                                <groupId>org.mapstruct</groupId>
                                <artifactId>mapstruct-processor</artifactId>
                                <version>${mapstruct.version}</version>
                            </path>
                        </annotationProcessorPaths>
                        <!-- 编译参数写在 arg 内,解决 Parameter Name Discovery 问题 -->
                        <compilerArgs>
                            <arg>-parameters</arg>
                            <!-- javac 默认只报 200 条错(-Xmaxerrs 200)。存量代码搬迁动辄上千条,
                                 截断会让「已修完」看起来像「还差一批」(POI 纠偏时就踩到过:
                                 excle/ 的 200 条把 poiexcle/ 的错整个挡在后面)。调大上限。 -->
                            <arg>-Xmaxerrs</arg>
                            <arg>9999</arg>
                        </compilerArgs>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>flatten-maven-plugin</artifactId>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <!-- 统一 revision 版本 -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>flatten-maven-plugin</artifactId>
                <version>${flatten-maven-plugin.version}</version>
                <configuration>
                    <flattenMode>oss</flattenMode>
                    <updatePomFile>true</updatePomFile>
                </configuration>
                <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>
            </plugin>
        </plugins>
    </build>

    <!-- 使用 huawei / aliyun 的 Maven 源,提升下载速度 -->
    <repositories>
        <repository>
            <id>huaweicloud</id>
            <name>huawei</name>
            <url>https://mirrors.huaweicloud.com/repository/maven/</url>
        </repository>
        <repository>
            <id>aliyunmaven</id>
            <name>aliyun</name>
            <url>https://maven.aliyun.com/repository/public</url>
        </repository>
    </repositories>

</project>