<?xml version="1.0" encoding="UTF-8"?>
<!--
 * Copyright (c) 2025 Unikue Ltd. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
-->


<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>cn.unikue.forkextension.whvcse</groupId>
    <artifactId>easy-captcha</artifactId>
    <version>2.0.0</version>

    <name>${project.artifactId}</name>
    <description>Unikue Fork Extension of Whvcse Easy Captcha. Web graphics verification code.</description>
    <url>https://github.com/unikueltd/whvcse-easy-captcha</url>
    <inceptionYear>2025</inceptionYear>

    <organization>
        <name>Unikue Ltd</name>
        <url>https://unikue.cn</url>
    </organization>

    <properties>
        <java.version>17</java.version>
        <file.encoding>UTF-8</file.encoding>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <maven.compiler.testSource>${java.version}</maven.compiler.testSource>
        <maven.compiler.testTarget>${java.version}</maven.compiler.testTarget>
        <maven.build.timestamp.format>yyyy-MM-dd HH:mm:ss</maven.build.timestamp.format>
        <maven.test.skip>true</maven.test.skip>
        <project.build.sourceEncoding>${file.encoding}</project.build.sourceEncoding>
        <project.build.resourceEncoding>${file.encoding}</project.build.resourceEncoding>
        <project.reporting.outputEncoding>${file.encoding}</project.reporting.outputEncoding>

        <jakarta-annotation.version>2.1.1</jakarta-annotation.version>
        <jakarta-servlet.version>6.0.0</jakarta-servlet.version>
        <lombok.version>1.18.38</lombok.version>

        <!-- shaded versions -->
        <easy-captcha.version>1.6.2</easy-captcha.version>

        <maven-compiler-plugin.version>3.14.0</maven-compiler-plugin.version>
        <maven-dependency-plugin.version>3.8.1</maven-dependency-plugin.version>
        <maven-install-plugin.version>3.1.4</maven-install-plugin.version>
        <maven-jar-plugin.version>3.4.2</maven-jar-plugin.version>
        <maven-javadoc-plugin.version>3.11.3</maven-javadoc-plugin.version>
        <maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
        <maven-shade-plugin.version>3.6.0</maven-shade-plugin.version>
        <maven-source-plugin.version>3.3.1</maven-source-plugin.version>
        <maven-gpg-plugin.version>3.2.8</maven-gpg-plugin.version>
        <central-publishing-maven-plugin.version>0.8.0</central-publishing-maven-plugin.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.github.whvcse</groupId>
            <artifactId>easy-captcha</artifactId>
            <version>${easy-captcha.version}</version>
            <optional>true</optional>
            <exclusions>
                <exclusion>
                    <groupId>javax.servlet</groupId>
                    <artifactId>javax.servlet-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>jakarta.annotation</groupId>
            <artifactId>jakarta.annotation-api</artifactId>
            <version>${jakarta-annotation.version}</version>
        </dependency>
        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
            <version>${jakarta-servlet.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${lombok.version}</version>
            <optional>true</optional>
        </dependency>
    </dependencies>

    <build>
        <finalName>${project.artifactId}</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <excludes>
                        <exclude>**/._*</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>${maven-dependency-plugin.version}</version>
                <executions>
                    <execution>
                        <id>unpack</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>com.github.whvcse</groupId>
                                    <artifactId>easy-captcha</artifactId>
                                    <version>${easy-captcha.version}</version>
                                    <type>jar</type>
                                    <overWrite>true</overWrite>
                                    <outputDirectory>${project.build.directory}/classes/META-INF/fonts</outputDirectory>
                                    <includes>*.ttf</includes>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <version>${maven-install-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${maven-jar-plugin.version}</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                        </manifest>
                        <manifestEntries>
                            <GroupId>${project.groupId}</GroupId>
                            <ArtifactId>${project.artifactId}</ArtifactId>
                            <Version>${project.version}</Version>
                            <Url>${project.url}</Url>
                            <Organization-Name>${project.organization.name}</Organization-Name>
                            <Organization-Url>${project.organization.url}</Organization-Url>
                            <Build-Time>${maven.build.timestamp}</Build-Time>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
                <configuration>
                    <detectLinks>false</detectLinks>
                    <detectOfflineLinks>false</detectOfflineLinks>
                    <doclint>none</doclint>
                    <locale>en_US</locale>
                    <notimestamp>true</notimestamp>
                    <quiet>true</quiet>
                    <skip>false</skip>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                        </manifest>
                    </archive>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>${maven-shade-plugin.version}</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                            <artifactSet>
                                <includes>
                                    <include>com.github.whvcse:easy-captcha</include>
                                </includes>
                            </artifactSet>
                            <filters>
                                <filter>
                                    <artifact>com.github.whvcse:easy-captcha</artifact>
                                    <excludes>
                                        <exclude>com/wf/captcha/base/Captcha.*</exclude>
                                        <exclude>com/wf/captcha/base/ChineseCaptchaAbstract.*</exclude>
                                        <exclude>com/wf/captcha/servlet/CaptchaServlet.*</exclude>
                                        <exclude>com/wf/captcha/utils/CaptchaUtil.*</exclude>
                                        <exclude>com/wf/captcha/ArithmeticCaptcha.*</exclude>
                                        <exclude>com/wf/captcha/ChineseGifCaptcha.*</exclude>
                                        <exclude>com/wf/captcha/GifCaptcha.*</exclude>
                                        <exclude>com/wf/captcha/PngCaptcha.*</exclude>
                                        <exclude>com/wf/captcha/SpecCaptcha.*</exclude>
                                        <exclude>META-INF/**</exclude>
                                        <exclude>*.ttf</exclude>
                                    </excludes>
                                </filter>
                                <filter>
                                    <artifact>cn.unikue.forkextension.whvcse:easy-captcha</artifact>
                                    <includes>
                                        <include>com/github/whvcse/easycaptcha/base/Captcha.*</include>
                                        <include>com/github/whvcse/easycaptcha/base/ChineseCaptchaAbstract.*</include>
                                        <include>com/github/whvcse/easycaptcha/servlet/CaptchaServlet.*</include>
                                        <include>com/github/whvcse/easycaptcha/utils/CaptchaUtil.*</include>
                                        <include>com/github/whvcse/easycaptcha/ArithmeticCaptcha.*</include>
                                        <include>com/github/whvcse/easycaptcha/ChineseGifCaptcha.*</include>
                                        <include>com/github/whvcse/easycaptcha/GifCaptcha.*</include>
                                        <include>com/github/whvcse/easycaptcha/PngCaptcha.*</include>
                                        <include>com/github/whvcse/easycaptcha/SpecCaptcha.*</include>
                                        <include>META-INF/**</include>
                                    </includes>
                                </filter>
                            </filters>
                            <relocations>
                                <relocation>
                                    <pattern>com.wf.captcha</pattern>
                                    <shadedPattern>com.github.whvcse.easycaptcha</shadedPattern>
                                </relocation>
                            </relocations>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven-source-plugin.version}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>${maven-gpg-plugin.version}</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>${central-publishing-maven-plugin.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <deploymentName>${project.artifactId}</deploymentName>
                    <autoPublish>true</autoPublish>
                    <checksums>required</checksums>
                    <publishingServerId>central</publishingServerId>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <scm>
        <url>https://github.com/unikueltd/whvcse-easy-captcha</url>
        <connection>scm:git:https://github.com/unikueltd/whvcse-easy-captcha.git</connection>
        <developerConnection>scm:git:https://github.com/unikueltd/whvcse-easy-captcha.git</developerConnection>
    </scm>

    <issueManagement>
        <system>Github</system>
        <url>https://github.com/unikueltd/whvcse-easy-captcha/issues</url>
    </issueManagement>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Unikue Ltd</name>
        </developer>
        <developer>
            <id>davidhsing</id>
            <name>David Hsing</name>
            <email>davidhsing@163.com</email>
            <properties>
                <realName>Xin Binghong</realName>
            </properties>
            <roles>
                <role>developer</role>
            </roles>
            <organization>Unikue Ltd</organization>
            <organizationUrl>https://unikue.cn</organizationUrl>
            <timezone>China/Beijing</timezone>
        </developer>
    </developers>
</project>
