<?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>work.guigen.projects</groupId>
    <artifactId>guigen-code-generator</artifactId>
    <version>1.0.5</version>
    <packaging>pom</packaging>
    <modules>
        <module>code-parser</module>
        <module>test-code-generator</module>
        <module>code-generator</module>
        <module>code-generator-ast</module>
        <module>code-generator-ast-generator</module>
        <module>code-generator-io</module>
    </modules>

    <!--    <name>Maven deploy example application</name>-->
    <name>${project.groupId}:${project.artifactId}</name>
    <description>Guigen Code Generator</description>
    <url>https://www.guigen.work/</url>

    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>guigen5464</name>
            <email>guigen5464@outlook.com</email>
            <organization>Guigen</organization>
            <organizationUrl>https://www.guigen.work</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:https://gitee.com/guigen-projects/guigen-code-generator.git</connection>
        <developerConnection>scm:git:https://gitee.com/guigen-projects/guigen-code-generator.git</developerConnection>
        <url>https://gitee.com/guigen-projects/guigen-code-generator</url>
        <tag>master</tag>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <guigen.projects.version>2.1.9</guigen.projects.version>
    </properties>

    <dependencies>

        <!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.30</version>
            <scope>provided</scope>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>5.10.1</version>
            <scope>test</scope>
        </dependency>

        <!-- slf4j-->
        <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>2.0.9</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-simple -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>2.0.9</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.14.0</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-collections4 -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
            <version>4.4</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.15.0</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-text -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-text</artifactId>
            <version>1.11.0</version>
        </dependency>

    </dependencies>

    <dependencyManagement>
        <dependencies>
            <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>3.2.1</version>
                <type>pom</type>
                <scope>provided</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <!-- To use the plugin goals in your POM or parent POM -->
        <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-deploy-plugin -->
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>3.1.1</version>
                <configuration>
                    <!-- !!!!!!!!! 需要发布的子模块都需要手动配置成false                   -->
                    <!-- 和后面的central-publishing-maven-plugin一样                   -->
                    <!-- 父模块不发布的话，子模块好像需要手动配置 project url, license, scm, developer等信息                   -->
                    <skip>false</skip>
                    <!--                    <skip>true</skip>-->
                </configuration>
            </plugin>
            <!--  ！！！注意安全问题。          -->
            <!--  上传源码不是必要的,特别是在公司,发布的时候因为安全问题不应该上传源码          -->
            <!--  上传源码          -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.4.0</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- 上传javadoc jar包           -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.12.0</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>3.2.8</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                        <configuration>
                            <!--                            <keyname>秘钥ID（可选）</keyname>-->
                            <passphraseServerId>gpg-server</passphraseServerId>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

        </plugins>
        <pluginManagement>
            <plugins>
                <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-dependency-plugin -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>3.6.1</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>deploy-central</id>
            <build>
                <plugins>
                    <!--            https://central.sonatype.org/publish/publish-portal-maven/#automatic-publishing-->
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.9.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>maven-central-repo</publishingServerId>
                            <!-- 发布到maven-central后会自动发布，要不然需要手动到中央仓库点发布                   -->
                            <!-- 目前还是改成手动发布，要不然有点小报错也会自动发布上去                   -->
                            <autoPublish>true</autoPublish>
                            <!--                    <autoPublish>false</autoPublish>-->
                            <!--                    <centralSnapshotsUrl>https://central.sonatype.com/repository/maven-snapshots/</centralSnapshotsUrl>-->
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <distributionManagement>
        <!--   https://maven.apache.org/pom.html#Repository     -->
        <repository>
            <uniqueVersion>false</uniqueVersion>
            <id>nexus-release</id>
            <name>Nexus Releases</name>
            <url>http://nexus.guigen.work/repository/maven-releases/</url>
        </repository>
        <snapshotRepository>
            <uniqueVersion>true</uniqueVersion>
            <id>nexus-snapshot</id>
            <name>Nexus Snapshots</name>
            <url>http://nexus.guigen.work/repository/maven-snapshots/</url>
        </snapshotRepository>
    </distributionManagement>

    <repositories>
        <repository>
            <id>nexus</id>
            <name>nexus</name>
            <url>http://nexus.guigen.work/repository/maven-public/</url>
        </repository>
        <!--        https://developer.aliyun.com/mvn/guide-->
        <repository>
            <id>aliyunmaven</id>
            <name>阿里云公共仓库</name>
            <url>https://maven.aliyun.com/repository/public</url>
        </repository>
    </repositories>

</project>
