<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         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>xyz.erupt</groupId>
    <artifactId>erupt</artifactId>
    <version>1.13.1</version>

    <packaging>pom</packaging>
    <name>erupt</name>
    <description>erupt common data framework pom parent</description>
    <url>https://www.erupt.xyz</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <erupt.groupId>xyz.erupt</erupt.groupId>
        <java.version>17</java.version>
        <spring.boot.version>3.5.6</spring.boot.version>
    </properties>

    <!--
    When compiling multi-module projects such as Spring Boot, it is often the case that...
    Non-resolvable parent POM: Could not find artifact
    Following this is a series of other information. Most of the online solutions involve modifying the 'relativePath' configuration item. However, this is not an elegant approach. Here, we introduce another solution.
    The solution is as follows: Comment out or delete all the configurations in the 'modules' directory of the parent project, then compile, package, and install. After the prompt indicates success, restore the original commented and deleted configurations, and then compile again to achieve success.
    -->
    <modules>
        <module>erupt-annotation</module>
        <module>erupt-core</module>
        <module>erupt-excel</module>
        <module>erupt-toolkit</module>
        <module>erupt-ai</module>

        <!-- JPA Data Implementation -->
        <module>erupt-data/erupt-jpa</module>
        <!-- MongoDB Data Implementation -->
        <module>erupt-data/erupt-mongodb</module>

        <!-- User Permission Management -->
        <module>erupt-upms</module>
        <!-- API Interface Security -->
        <module>erupt-security</module>
        <module>erupt-admin</module>
        <!-- WebSocket -->
        <module>erupt-websocket</module>
        <!-- Front-end Code -->
        <module>erupt-web</module>

        <module>erupt-tpl</module>
        <module>erupt-tpl-ui/ant-design</module>
        <module>erupt-tpl-ui/element-ui</module>
        <module>erupt-tpl-ui/amis</module>
        <module>erupt-tpl-ui/element-plus</module>

        <!-- Task Scheduling -->
        <module>erupt-extra/erupt-job</module>
        <!-- Code Generation -->
        <module>erupt-extra/erupt-generator</module>
        <!-- Service Monitoring -->
        <module>erupt-extra/erupt-monitor</module>
        <!-- magic-api Interface Configuration -->
        <module>erupt-extra/erupt-magic-api</module>

        <!-- erupt cloud -->
        <module>erupt-cloud/erupt-cloud-common</module>
        <!-- Main Service Node -->
        <module>erupt-cloud/erupt-cloud-server</module>
        <!-- Cloud Node -->
        <module>erupt-cloud/erupt-cloud-node</module>
        <!-- Cloud Node (Aggregated JPA) -->
        <module>erupt-cloud/erupt-cloud-node-jpa</module>

        <!-- Sample Project Using H2 as Data Source -->
        <module>erupt-sample</module>

        <!-- erupt deploy -->
        <module>deploy/erupt-cloud-server-docker</module>

        <!-- unittest -->
        <module>erupt-test</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>3.19.0</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-parent</artifactId>
                <version>${spring.boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

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

    <distributionManagement>
        <snapshotRepository>
            <id>central</id>
            <url>https://central.sonatype.com/repository/maven-snapshots/</url>
        </snapshotRepository>
    </distributionManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <encoding>utf-8</encoding>
                    <verbose>true</verbose>
                    <fork>true</fork>
                    <compilerArgs>
                        <compilerArg>-parameters</compilerArg>
                    </compilerArgs>
                    <!--<executable>/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/bin/javac</executable>-->
                </configuration>
            </plugin>
            <!-- One-click update of sub-module version numbers plugins -> versions -> version:set  -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>2.7</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-scm-plugin</artifactId>
                <version>1.8.1</version>
            </plugin>
        </plugins>
    </build>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <scm>
        <tag>master</tag>
        <url>git@github.com:erupts/erupt.git</url>
        <connection>scm:git:git@github.com:erupts/erupt.git</connection>
        <developerConnection>scm:git:git@github.com:erupts/erupt.git</developerConnection>
    </scm>
    <developers>
        <developer>
            <name>YuePeng</name>
            <email>erupts@126.com</email>
            <roles>
                <role>owner</role>
            </roles>
            <timezone>+8</timezone>
        </developer>
    </developers>

    <profiles>
        <profile>
            <id>disable-javadoc-doclint</id>
            <activation>
                <jdk>[1.8,)</jdk>
            </activation>
            <properties>
                <javadoc.opts>-Xdoclint:none</javadoc.opts>
                <javadocExecutable>${java.home}/../bin/javadoc</javadocExecutable>
            </properties>
        </profile>
        <profile>
            <id>release</id>
            <dependencies>
                <dependency>
                    <groupId>javax.interceptor</groupId>
                    <artifactId>javax.interceptor-api</artifactId>
                    <version>1.2</version>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.8.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.2.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- Javadoc -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.5.0</version>
                        <configuration>
                            <doclint>none</doclint>
                            <javadocExecutable>
                                ${java.home}/bin/javadoc
                            </javadocExecutable>
                        </configuration>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- GPG -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
