<?xml version="1.0" encoding="UTF-8"?>
<!--

    开源代码，仅供学习和交流研究使用，商用请联系三丙
    微信：mohan_88888
    抖音：程序员三丙
    付费课程：https://www.bilibili.com/cheese/play/ss942400790

-->
<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>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.5.6</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>sanbing</groupId>
    <artifactId>jcpp-parent</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>pom</packaging>
    <name>JChargePointProtocol</name>
    <description>JChargePointProtocol</description>
    <url>https://t.zsxq.com/j9b21</url>
    <developers>
        <developer>
            <name>程序员三丙</name>
            <organization>gitee</organization>
            <organizationUrl>https://gitee.com/san-bing</organizationUrl>
        </developer>
    </developers>

    <properties>
        <java.version>21</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <main.dir>${basedir}</main.dir>
        <jacoco.version>0.8.12</jacoco.version>
        <passay.version>1.6.4</passay.version>
        <ua-parser.version>1.6.1</ua-parser.version>
        <os-maven-plugin.version>1.7.1</os-maven-plugin.version>
        <disruptor.version>3.4.4</disruptor.version>
        <jakarta.el.version>4.0.2</jakarta.el.version>
        <protobuf.version>4.28.2</protobuf.version>
        <grpc.version>1.75.0</grpc.version>
        <protobuf-maven-plugin.version>0.6.1</protobuf-maven-plugin.version>
        <maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
        <hutool-all.version>5.8.32</hutool-all.version>
        <mybatis-plus-boot-starter.version>3.5.7</mybatis-plus-boot-starter.version>
        <curator-recipes.version>5.9.0</curator-recipes.version>
        <oshi-core.version>6.6.2</oshi-core.version>
        <zookeeper.version>3.9.4</zookeeper.version>
        <xnio-api.version>3.8.16.Final</xnio-api.version>
        <javax.annotation-api.version>1.3.2</javax.annotation-api.version>
        <commons-lang3.version>3.18.0</commons-lang3.version>
        <guava.version>33.0.0-jre</guava.version>
        <antisamy.version>1.7.5</antisamy.version>
        <jjwt.version>0.12.3</jjwt.version>
        <bouncycastle.version>1.78.1</bouncycastle.version>
        <itCoverageAgent/>
        <skip.unit.tests/>
        <skip.integration.tests/>
    </properties>

    <profiles>
        <!-- 默认不运行测试用例 -->
        <profile>
            <id>dev</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <skip.unit.tests>true</skip.unit.tests>
                <skip.integration.tests>true</skip.integration.tests>
            </properties>
        </profile>
        <!-- 只运行单侧 -->
        <profile>
            <id>unit-test</id>
            <properties>
                <skip.unit.tests>false</skip.unit.tests>
                <skip.integration.tests>true</skip.integration.tests>
            </properties>
        </profile>
        <!-- 只运行集测 -->
        <profile>
            <id>integration-test</id>
            <properties>
                <skip.unit.tests>true</skip.unit.tests>
                <skip.integration.tests>false</skip.integration.tests>
            </properties>
        </profile>
        <!-- 同时运行单侧和集测 -->
        <profile>
            <id>test-all</id>
            <properties>
                <skip.unit.tests>false</skip.unit.tests>
                <skip.integration.tests>false</skip.integration.tests>
            </properties>
        </profile>
    </profiles>

    <modules>
        <module>jcpp-app-bootstrap</module>
        <module>jcpp-protocol-bootstrap</module>
        <module>jcpp-app</module>
        <module>jcpp-infrastructure-queue</module>
        <module>jcpp-infrastructure-cache</module>
        <module>jcpp-infrastructure-util</module>
        <module>jcpp-infrastructure-stats</module>
        <module>jcpp-infrastructure-proto</module>
        <module>jcpp-protocol-api</module>
        <module>jcpp-testing</module>
        <module>jcpp-protocol-yunkuaichong</module>
        <module>jcpp-protocol-lvneng</module>
        <module>jcpp-web-ui</module>
    </modules>

    <dependencies>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <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>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>sanbing</groupId>
                <artifactId>jcpp-app</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>sanbing</groupId>
                <artifactId>jcpp-protocol-yunkuaichong</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>sanbing</groupId>
                <artifactId>jcpp-protocol-lvneng</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>sanbing</groupId>
                <artifactId>jcpp-infrastructure-cache</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>sanbing</groupId>
                <artifactId>jcpp-infrastructure-proto</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>sanbing</groupId>
                <artifactId>jcpp-infrastructure-queue</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>sanbing</groupId>
                <artifactId>jcpp-infrastructure-stats</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>sanbing</groupId>
                <artifactId>jcpp-infrastructure-util</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>sanbing</groupId>
                <artifactId>jcpp-protocol-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jboss.xnio</groupId>
                <artifactId>xnio-api</artifactId>
                <version>${xnio-api.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.protobuf</groupId>
                <artifactId>protobuf-java</artifactId>
                <version>${protobuf.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.protobuf</groupId>
                <artifactId>protobuf-java-util</artifactId>
                <version>${protobuf.version}</version>
            </dependency>
            <dependency>
                <groupId>io.grpc</groupId>
                <artifactId>grpc-netty-shaded</artifactId>
                <version>${grpc.version}</version>
            </dependency>
            <dependency>
                <groupId>io.grpc</groupId>
                <artifactId>grpc-protobuf</artifactId>
                <version>${grpc.version}</version>
            </dependency>
            <dependency>
                <groupId>io.grpc</groupId>
                <artifactId>grpc-stub</artifactId>
                <version>${grpc.version}</version>
            </dependency>
            <dependency>
                <groupId>org.glassfish</groupId>
                <artifactId>jakarta.el</artifactId>
                <version>${jakarta.el.version}</version>
            </dependency>
            <dependency>
                <groupId>com.lmax</groupId>
                <artifactId>disruptor</artifactId>
                <version>${disruptor.version}</version>
            </dependency>
            <dependency>
                <groupId>cn.hutool</groupId>
                <artifactId>hutool-core</artifactId>
                <version>${hutool-all.version}</version>
            </dependency>
            <dependency>
                <groupId>com.github.oshi</groupId>
                <artifactId>oshi-core</artifactId>
                <version>${oshi-core.version}</version>
            </dependency>
            <dependency>
                <groupId>com.baomidou</groupId>
                <artifactId>mybatis-plus-spring-boot3-starter</artifactId>
                <version>${mybatis-plus-boot-starter.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.curator</groupId>
                <artifactId>curator-recipes</artifactId>
                <version>${curator-recipes.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.zookeeper</groupId>
                <artifactId>zookeeper</artifactId>
                <version>${zookeeper.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${guava.version}</version>
            </dependency>
            <dependency>
                <groupId>org.owasp.antisamy</groupId>
                <artifactId>antisamy</artifactId>
                <version>${antisamy.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>*</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>commons-logging</groupId>
                        <artifactId>commons-logging</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.github.spotbugs</groupId>
                        <artifactId>spotbugs-annotations</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <!-- JWT -->
            <dependency>
                <groupId>io.jsonwebtoken</groupId>
                <artifactId>jjwt-api</artifactId>
                <version>${jjwt.version}</version>
            </dependency>
            <dependency>
                <groupId>io.jsonwebtoken</groupId>
                <artifactId>jjwt-impl</artifactId>
                <version>${jjwt.version}</version>
                <scope>runtime</scope>
            </dependency>
            <dependency>
                <groupId>io.jsonwebtoken</groupId>
                <artifactId>jjwt-jackson</artifactId>
                <version>${jjwt.version}</version>
                <scope>runtime</scope>
            </dependency>
            <dependency>
                <groupId>org.passay</groupId>
                <artifactId>passay</artifactId>
                <version>${passay.version}</version>
            </dependency>
            <dependency>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bcprov-jdk18on</artifactId>
                <version>${bouncycastle.version}</version>
            </dependency>
            <dependency>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bcpkix-jdk18on</artifactId>
                <version>${bouncycastle.version}</version>
            </dependency>
            <dependency>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bcutil-jdk18on</artifactId>
                <version>${bouncycastle.version}</version>
            </dependency>
            <dependency>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bcprov-ext-jdk18on</artifactId>
                <version>${bouncycastle.version}</version>
            </dependency>
            <dependency>
                <groupId>com.github.ua-parser</groupId>
                <artifactId>uap-java</artifactId>
                <version>${ua-parser.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <extensions>
            <extension>
                <groupId>kr.motd.maven</groupId>
                <artifactId>os-maven-plugin</artifactId>
                <version>${os-maven-plugin.version}</version>
            </extension>
        </extensions>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <release>${java.version}</release>
                        <compilerArgs>
                            <arg>-Xlint:deprecation</arg>
                            <arg>-Xlint:removal</arg>
                            <arg>-Xlint:unchecked</arg>
                            <arg>-parameters</arg>
                        </compilerArgs>
                        <annotationProcessorPaths>
                            <path>
                                <groupId>org.projectlombok</groupId>
                                <artifactId>lombok</artifactId>
                                <version>${lombok.version}</version>
                            </path>
                        </annotationProcessorPaths>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.2.0</version>
                    <executions>
                        <execution>
                            <id>copy-conf</id>
                            <phase>process-resources</phase>
                            <goals>
                                <goal>copy-resources</goal>
                            </goals>
                            <configuration>
                                <outputDirectory>${project.build.directory}/conf</outputDirectory>
                                <resources>
                                    <resource>
                                        <directory>src/main/resources</directory>
                                        <excludes>
                                            <exclude>*</exclude>
                                        </excludes>
                                        <filtering>false</filtering>
                                    </resource>
                                    <resource>
                                        <directory>src/main/resources</directory>
                                        <includes>
                                            <include>log4j2.xml</include>
                                            <include>*-service.yml</include>
                                        </includes>
                                        <filtering>true</filtering>
                                    </resource>
                                </resources>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <configuration>
                        <excludes>
                            <exclude>**/log4j2.xml</exclude>
                        </excludes>
                        <archive>
                            <manifestEntries>
                                <Implementation-Title>${project.name}</Implementation-Title>
                                <Implementation-Version>${project.version}</Implementation-Version>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>copy-protoc</id>
                            <phase>generate-sources</phase>
                            <goals>
                                <goal>copy</goal>
                            </goals>
                            <configuration>
                                <artifactItems>
                                    <artifactItem>
                                        <groupId>com.google.protobuf</groupId>
                                        <artifactId>protoc</artifactId>
                                        <version>${protobuf.version}</version>
                                        <!--suppress UnresolvedMavenProperty -->
                                        <classifier>${os.detected.classifier}</classifier>
                                        <type>exe</type>
                                        <overWrite>true</overWrite>
                                        <outputDirectory>${project.build.directory}</outputDirectory>
                                    </artifactItem>
                                </artifactItems>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.xolstice.maven.plugins</groupId>
                    <artifactId>protobuf-maven-plugin</artifactId>
                    <version>${protobuf-maven-plugin.version}</version>
                    <configuration>
                        <!--suppress UnresolvedMavenProperty -->
                        <protocArtifact>com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}
                        </protocArtifact>
                        <pluginId>grpc-java</pluginId>
                        <!--suppress UnresolvedMavenProperty -->
                        <pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}
                        </pluginArtifact>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>compile</goal>
                                <goal>compile-custom</goal>
                                <goal>test-compile</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>com.github.eirslett</groupId>
                    <artifactId>frontend-maven-plugin</artifactId>
                    <version>1.15.1</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <argLine>@{argLine} -Xms256m -Xmx1024m -Dfile.encoding=UTF-8
                        -XX:+EnableDynamicAgentLoading
                        -XX:+UseStringDeduplication -XX:MaxGCPauseMillis=20
                        --add-opens java.base/java.lang.reflect=ALL-UNNAMED
                    </argLine>
                    <skipTests>${skip.unit.tests}</skipTests>
                    <forkCount>1</forkCount>
                    <runOrder>filesystem</runOrder>
                    <includes>
                        <include>**/*Tests.java</include>
                        <include>**/*Test.java</include>
                    </includes>
                    <excludes>
                        <exclude>**/Abstract*.java</exclude>
                        <exclude>**/*IntegrationTest.java</exclude>
                        <exclude>**/IT*.java</exclude>
                        <exclude>**/*IT.java</exclude>
                        <exclude>**/*ITCase.java</exclude>
                        <exclude>examples/codequality/tests/**/*.java</exclude>
                    </excludes>
                    <testFailureIgnore>true</testFailureIgnore>
                    <forkCount>1</forkCount>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.surefire</groupId>
                        <artifactId>surefire-junit47</artifactId>
                        <version>${maven-surefire-plugin.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.maven.surefire</groupId>
                        <artifactId>surefire-junit-platform</artifactId>
                        <version>${maven-surefire-plugin.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <configuration>
                    <skipTests>${skip.integration.tests}</skipTests>
                </configuration>
                <executions>
                    <execution>
                        <id>integration-tests</id>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                        <configuration>
                            <includes>
                                <include>**/*IntegrationTest.java</include>
                                <include>**/IT*.java</include>
                                <include>**/*IT.java</include>
                                <include>**/*ITCase.java</include>
                            </includes>
                            <reuseForks>true</reuseForks>
                            <argLine>${itCoverageAgent}</argLine>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco.version}</version>
                <configuration>
                    <excludes>
                        <exclude>**/*DO.class</exclude>
                        <exclude>**/*DTO.class</exclude>
                        <exclude>**/*VO.class</exclude>
                        <exclude>**/*BO.class</exclude>
                        <exclude>**/*Model.class</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <id>prepare-unit-tests</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                        <phase>pre-integration-test</phase>
                        <configuration>
                            <propertyName>itCoverageAgent</propertyName>
                        </configuration>
                    </execution>
                    <execution>
                        <id>report</id>
                        <goals>
                            <goal>report</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <header>${main.dir}/license-header-template.txt</header>
                    <properties>
                        <owner>程序员三丙</owner>
                    </properties>
                    <excludes>
                        <exclude>**/.env</exclude>
                        <exclude>**/*.env</exclude>
                        <exclude>**/env.development</exclude>
                        <exclude>**/env.production</exclude>
                        <exclude>**/env.*</exclude>
                        <exclude>**/*.sh</exclude>
                        <exclude>**/.gradle/**</exclude>
                        <exclude>**/*.md</exclude>
                        <exclude>**/LICENSE</exclude>
                        <exclude>**/banner.txt</exclude>
                        <exclude>**/*.properties</exclude>
                        <exclude>src/test/resources/**</exclude>
                        <exclude>src/sh/**</exclude>
                        <exclude>**/*.log</exclude>
                        <exclude>src/main/resources/*.yml</exclude>
                        <exclude>**/*.raw</exclude>
                        <exclude>**/*.patch</exclude>
                        <exclude>.run/**</exclude>
                        <exclude>node_modules/**</exclude>
                        <exclude>build/**</exclude>
                        <exclude>**/.browserslistrc</exclude>
                        <exclude>**/yarn.lock</exclude>
                        <exclude>**/.yarnrc</exclude>
                        <exclude>**/.prettierrc</exclude>
                        <exclude>**/.prettierignore</exclude>
                        <exclude>**/dist/**</exclude>
                        <exclude>**/target/**</exclude>
                        <exclude>**/.eslintrc.*</exclude>
                        <exclude>**/vite.config.*</exclude>
                        <exclude>**/tsconfig.*</exclude>
                        <exclude>**/package.json</exclude>
                        <exclude>**/package-lock.json</exclude>
                        <exclude>**/auto-imports.d.ts</exclude>
                        <exclude>**/components.d.ts</exclude>
                        <exclude>**/*.map</exclude>
                        <exclude>**/.gitignore</exclude>
                        <exclude>**/favicon.ico</exclude>
                        <exclude>**/CHANGELOG.md</exclude>
                        <exclude>**/README.md</exclude>
                        <exclude>**/robots.txt</exclude>
                        <exclude>.cursor/**</exclude>
                    </excludes>
                    <mapping>
                        <proto>JAVADOC_STYLE</proto>
                        <cql>DOUBLEDASHES_STYLE</cql>
                        <sql>SLASHSTAR_STYLE</sql>
                        <scss>JAVADOC_STYLE</scss>
                        <tsx>SLASHSTAR_STYLE</tsx>
                        <conf>SCRIPT_STYLE</conf>
                        <gradle>JAVADOC_STYLE</gradle>
                        <Dockerfile>SCRIPT_STYLE</Dockerfile>
                        <!-- 前端文件类型映射 -->
                        <vue>XML_STYLE</vue>
                        <js>SLASHSTAR_STYLE</js>
                        <ts>SLASHSTAR_STYLE</ts>
                        <jsx>SLASHSTAR_STYLE</jsx>
                        <css>SLASHSTAR_STYLE</css>
                        <less>SLASHSTAR_STYLE</less>
                        <sass>SLASHSTAR_STYLE</sass>
                        <json>SLASHSTAR_STYLE</json>
                        <html>XML_STYLE</html>
                    </mapping>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>format</goal>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <repositories>
        <repository>
            <id>aliyun-maven</id>
            <name>Aliyun Maven Repository</name>
            <url>https://maven.aliyun.com/repository/public</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>aliyun-plugin</id>
            <name>Aliyun Plugin Repository</name>
            <url>https://maven.aliyun.com/repository/public</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

</project>
