<?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>
    <name>Coze Java SDK</name>
    <description>The Java SDK for the Coze API</description>
    <url>https://github.com/coze-dev/coze-java</url>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>https://github.com/coze-dev/coze-java/blob/main/LICENSE</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Coze Dev Team</name>
            <email>dev@coze.com</email>
            <organization>Spring (SG) Pte. Ltd.</organization>
            <organizationUrl>https://www.coze.com</organizationUrl>
        </developer>
        <developer>
            <name>chyroc</name>
            <email>chyroc@bytedance.com</email>
            <organization>Spring (SG) Pte. Ltd.</organization>
            <organizationUrl>https://www.coze.com</organizationUrl>
        </developer>
        <developer>
            <name>Chris Gou</name>
            <email>gouqinggan@bytedance.com</email>
            <organization>Spring (SG) Pte. Ltd.</organization>
            <organizationUrl>https://www.coze.com</organizationUrl>
        </developer>
    </developers>
    <groupId>com.coze</groupId>
    <artifactId>coze</artifactId>
    <version>0.1.0</version>
    <packaging>pom</packaging>

    <modules>
        <module>api</module>
        <module>example</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <lombok.version>1.18.24</lombok.version>
        <junit.version>5.8.2</junit.version>
    </properties>

    <scm>
        <connection>scm:git:git://github.com/coze-dev/coze-java.git</connection>
        <developerConnection>scm:git:ssh://github.com/coze-dev/coze-java.git</developerConnection>
        <url>http://github.com/coze-dev/coze-java/tree/main</url>
    </scm>


    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>
    </distributionManagement>

    <dependencies>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${lombok.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.11</version>
                <configuration>
                    <outputDirectory>${project.reporting.outputDirectory}/jacoco</outputDirectory>
                    <formats>
                        <format>HTML</format>
                        <format>XML</format>
                        <format>CSV</format>
                    </formats>
                    <excludes>
                        <exclude>**/client/**/*</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <id>prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>check</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <rule>
                                    <element>BUNDLE</element>
                                </rule>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
                <version>2.22.8</version>
                <configuration>
                    <java>
                        <includes>
                            <include>src/main/java/**/*.java</include>
                            <include>src/test/java/**/*.java</include>
                        </includes>
                        <googleJavaFormat>
                            <version>1.7</version>
                            <style>GOOGLE</style>
                        </googleJavaFormat>
                        <removeUnusedImports />
                        <endWithNewline />
                        <importOrder>
                            <order>java,javax,org,com,</order>
                        </importOrder>
                        <licenseHeader>
                            <content>/* (C)$YEAR */</content>
                        </licenseHeader>
                    </java>
                </configuration>
                <executions>
                    <execution>
                        <id>spotless-check</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.2.5</version>
                        <configuration>
                            <gpgArguments>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                        </configuration>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.5.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <autoPublish>true</autoPublish>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project> 