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

    <groupId>com.cat2bug</groupId>
    <artifactId>cat2bug-common</artifactId>
    <version>0.0.1</version>
    <name>cat2bug-common</name>
    <url>https://www.cat2bug.com</url>
    <description>cat2bug sdk</description>
    <!-- 开源签名证书 -->
    <licenses>
        <license>
            <name>MIT License</name>
            <url>http://www.opensource.org/licenses/mit-license.php</url>
        </license>
    </licenses>
    <!-- 仓库信息 -->
    <scm>
        <connection>scm:https://gitee.com/cat2bug/cat2bug-spring-boot-junit.git</connection>
        <developerConnection>scm:https://gitee.com/cat2bug/cat2bug-spring-boot-junit.git
        </developerConnection>
        <url>https://gitee.com/cat2bug/cat2bug-spring-boot-junit</url>
    </scm>
    <!-- 开发人员信息 -->
    <developers>
        <developer>
            <name>yuzhantao</name>
            <email>yuzhantao@qq.com</email>
            <organization>https://www.cat2bug.com</organization>
            <timezone>+8</timezone>
        </developer>
    </developers>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.source>1.8</maven.compiler.source>
        <okhttp.version>4.12.0</okhttp.version>
        <fastjson.version>2.0.46</fastjson.version>
        <yaml.version>2.2</yaml.version>
    </properties>

    <dependencies>
        <!-- HTTP工具-->
        <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>okhttp</artifactId>
            <version>${okhttp.version}</version>
        </dependency>
        <!-- JSON解析工具-->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>${fastjson.version}</version>
        </dependency>
        <!-- yaml文件读取 -->
        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>${yaml.version}</version>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <!-- 生成java source.jar -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.6.3</version>
                <configuration>
                    <show>private</show>
                    <nohelp>true</nohelp>
                    <charset>UTF-8</charset>
                    <encoding>UTF-8</encoding>
                    <docencoding>UTF-8</docencoding>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>net.ju-n.maven.plugins</groupId>
                <artifactId>checksum-maven-plugin</artifactId>
                <version>1.3</version>
                <executions>
                    <execution>
                        <id>checksum-maven-plugin-files</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>files</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <fileSets>
                        <fileSet>
                            <directory>${project.build.directory}</directory>
                            <includes>
                                <include>*.jar</include>
                            </includes>
                        </fileSet>
                        <fileSet>
                            <directory>${project.build.directory}</directory>
                            <includes>
                                <include>*.pom</include>
                            </includes>
                        </fileSet>
                    </fileSets>
                    <algorithms>
                        <algorithm>SHA-1</algorithm>
                        <algorithm>MD5</algorithm>
                    </algorithms>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>3.3.0</version> <!-- 或适当的版本 -->
                <configuration>
                    <descriptors>
                        <descriptor>src/assembly/assembly.xml</descriptor>
                    </descriptors>
                    <appendAssemblyId>false</appendAssemblyId>
                    <finalName>com</finalName>
                    <attach>true</attach>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>verify</phase> <!-- 或者合适的阶段 -->
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>3.0.0</version> <!-- 或适当的版本 -->
                <executions>
                    <execution>
                        <id>rename-zip-file</id>
                        <phase>install</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <!-- 如果文件存在，则重命名 -->
                                <move file="${project.build.directory}/com.zip"
                                      tofile="${project.build.directory}/${project.artifactId}-${project.version}.zip"
                                />
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>