<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         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>
    <parent>
        <groupId>cn.bunny</groupId>
        <artifactId>netty</artifactId>
        <version>0.0.1-SNAPSHOT</version>
    </parent>

    <artifactId>service</artifactId>
    <packaging>jar</packaging>
    <name>service</name>
    <url>https://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <docker.repostory>192.168.3.98:1100</docker.repostory>
        <docker.host>192.168.3.98:2375</docker.host>
        <docker.registry.name>bunny-service</docker.registry.name>
    </properties>

    <dependencies>
        <dependency>
            <groupId>cn.bunny</groupId>
            <artifactId>spring-security</artifactId>
            <version>0.0.1-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>cn.bunny</groupId>
            <artifactId>module-mail</artifactId>
            <version>0.0.1-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>cn.bunny</groupId>
            <artifactId>module-minio</artifactId>
            <version>0.0.1-SNAPSHOT</version>
        </dependency>
        <!-- 单元测试 -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
        </dependency>
        <!-- spring-test -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
        </dependency>
        <!-- websocket -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-websocket</artifactId>
        </dependency>
        <!-- asp 切面 -->
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjrt</artifactId>
        </dependency>
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjweaver</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.spotify</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <version>1.2.2</version>
                <!--将插件绑定在某个phase执行-->
                <executions>
                    <execution>
                        <id>build-image</id>
                        <!--将插件绑定在package这个phase(阶段)上。也就是说，用户只需执行mvn package，就会自动执行mvn docker:build-->
                        <phase>package</phase>
                        <goals>
                            <goal>build</goal>
                            <goal>push</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <serverId>harbor</serverId>
                    <registryUrl>http://${docker.repostory}</registryUrl>
                    <!-- 配置docker主机地址 -->
                    <dockerHost>http://${docker.host}</dockerHost>
                    <!--指定生成的镜像名-->
                    <imageName>
                        ${docker.repostory}/${docker.registry.name}/${project.artifactId}:${project.version}
                    </imageName>
                    <!-- 指定 dockerfile 路径-->
                    <dockerDirectory>${project.basedir}</dockerDirectory>
                    <!-- 是否跳过docker构建 -->
                    <skipDockerBuild>false</skipDockerBuild>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>21</source>
                    <target>21</target>
                    <compilerArgs>--enable-preview</compilerArgs>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
