<?xml version="1.0" encoding="UTF-8"?>
<!--

    The MIT License (MIT)

    Copyright (c) 2019 Code Technology Studio

    Permission is hereby granted, free of charge, to any person obtaining a copy of
    this software and associated documentation files (the "Software"), to deal in
    the Software without restriction, including without limitation the rights to
    use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
    the Software, and to permit persons to whom the Software is furnished to do so,
    subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all
    copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
    FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
    COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
    IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
    CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

-->
<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">
    <parent>
        <artifactId>jpom-parent</artifactId>
        <groupId>org.dromara.jpom</groupId>
        <version>2.10.40</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <name>Jpom Server</name>
    <artifactId>server</artifactId>
    <version>2.10.40</version>
    <properties>
        <start-class>org.dromara.jpom.JpomServerApplication</start-class>
    </properties>
    <dependencies>

        <dependency>
            <groupId>org.dromara.jpom</groupId>
            <artifactId>common</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>org.dromara.jpom.plugins</groupId>
            <artifactId>webhook</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>org.dromara.jpom.plugins</groupId>
            <artifactId>git-clone</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>org.dromara.jpom.plugins</groupId>
            <artifactId>ssh-jsch</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>org.dromara.jpom.plugins</groupId>
            <artifactId>svn-clone</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>org.dromara.jpom.plugins</groupId>
            <artifactId>docker-cli</artifactId>
            <version>${project.version}</version>
        </dependency>

        <!--邮件-->
        <dependency>
            <groupId>org.dromara.jpom.plugins</groupId>
            <artifactId>email</artifactId>
            <version>${project.version}</version>
        </dependency>

        <!--Spring Junit Test-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>cn.hutool</groupId>
            <artifactId>hutool-jwt</artifactId>
        </dependency>

        <dependency>
            <groupId>cn.hutool</groupId>
            <artifactId>hutool-captcha</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>org.dromara.jpom.agent-transport</groupId>
            <artifactId>agent-transport-http</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-websocket</artifactId>
        </dependency>

        <dependency>
            <groupId>org.dromara.jpom.storage-module</groupId>
            <artifactId>storage-module-h2</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>org.dromara.jpom.storage-module</groupId>
            <artifactId>storage-module-mysql</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>me.zhyd.oauth</groupId>
            <artifactId>JustAuth</artifactId>
            <version>1.16.5</version>
            <exclusions>
                <exclusion>
                    <groupId>com.alibaba</groupId>
                    <artifactId>fastjson</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>${fastjson-version}</version>
        </dependency>

        <dependency>
            <groupId>cn.hutool</groupId>
            <artifactId>hutool-cache</artifactId>
        </dependency>
    </dependencies>
    <build>
        <resources>
            <!--版权文件,更新日志-->
            <resource>
                <filtering>false</filtering>
                <directory>../../</directory>
                <includes>
                    <include>CHANGELOG.md</include>
                    <include>CHANGELOG-BETA.md</include>
                    <include>LICENSE</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>false</filtering>
            </resource>
        </resources>
    </build>

    <profiles>
        <profile>
            <id>server-default-profile</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jar-plugin</artifactId>
                        <version>3.3.0</version>
                        <configuration>
                            <archive>
                                <manifest>
                                    <mainClass>${start-class}</mainClass>
                                    <!-- 是否指定项目classpath下的依赖 -->
                                    <addClasspath>true</addClasspath>
                                    <!-- 指定依赖的时候声明前缀 -->
                                    <classpathPrefix>./</classpathPrefix>
                                </manifest>
                                <manifestEntries>
                                    <!-- 项目版本号 -->
                                    <Jpom-Project-Version>${project.version}</Jpom-Project-Version>
                                    <!-- 打包时间 -->
                                    <Jpom-Timestamp>${maven.build.timestamp}</Jpom-Timestamp>
                                    <Jpom-Type>${project.artifactId}</Jpom-Type>
                                    <Implementation-URL>https://gitee.com/dromara/Jpom</Implementation-URL>
                                    <Jpom-Min-Version>${jpom-min-version}</Jpom-Min-Version>
                                </manifestEntries>
                                <addMavenDescriptor>true</addMavenDescriptor>
                            </archive>
                            <excludes>
                                <exclude>logback.xml</exclude>
                                <exclude>application*.yml</exclude>
                            </excludes>
                        </configuration>
                    </plugin>

                    <plugin>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-maven-plugin</artifactId>
                        <configuration>
                            <fork>true</fork>
                            <mainClass>${start-class}</mainClass>
                            <jvmArguments>-Dfile.encoding=UTF-8</jvmArguments>
                            <!--	<excludeGroupIds>org.dromara.jpom.plugins</excludeGroupIds>-->
                            <excludes>
                                <exclude>
                                    <groupId>org.projectlombok</groupId>
                                    <artifactId>lombok</artifactId>
                                </exclude>
                            </excludes>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>repackage</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <version>3.3.0</version>
                        <configuration>
                            <encoding>${project.build.sourceEncoding}</encoding>
                            <descriptors>
                                <descriptor>${basedir}/src/main/assembly/release.xml</descriptor>
                            </descriptors>
                            <outputDirectory>target/server-package</outputDirectory>
                        </configuration>
                        <executions>
                            <execution>
                                <id>make-assembly</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>single</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- 生成 sha1 校验文件 -->
                    <plugin>
                        <groupId>net.nicoulaj.maven.plugins</groupId>
                        <artifactId>checksum-maven-plugin</artifactId>
                        <version>1.11</version>
                        <executions>
                            <execution>
                                <id>checksum-maven-plugin-files</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>files</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <fileSets>
                                <fileSet>
                                    <directory>${project.build.directory}/server-package</directory>
                                    <includes>
                                        <include>*.zip</include>
                                        <include>*.tar.gz</include>
                                    </includes>
                                </fileSet>
                            </fileSets>
                            <algorithms>
                                <algorithm>SHA-1</algorithm>
                            </algorithms>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <!--  安装插件引人-->
        <profile>
            <id>install-plugin-profile</id>
        </profile>
        <profile>
            <id>release-plugin-profile</id>
        </profile>

        <!--  插件开发-->
        <profile>
            <id>develop-plugin-profile</id>
            <dependencies>
                <!--                <dependency>-->
                <!--                    <groupId>org.dromara.jpom.jpom-plugin</groupId>-->
                <!--                    <artifactId>netty</artifactId>-->
                <!--                    <version>LATEST</version>-->
                <!--                </dependency>-->
            </dependencies>
        </profile>
    </profiles>
</project>
