<?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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>net.isger</groupId>
        <artifactId>brick-primary</artifactId>
        <version>0.0.2-alpha</version>
    </parent>
    <artifactId>brick-core</artifactId>
    <packaging>jar</packaging>

    <name>brick-core</name>
    <description>Brick core library</description>
    <url>https://github.com/issing/brick-core</url>

    <scm>
        <connection>scm:git:https://github.com/issing/brick-core.git</connection>
        <developerConnection>scm:git:git@github.com:issing/brick-core.git</developerConnection>
        <url>https://github.com/issing/brick-core</url>
    </scm>

    <dependencies>
        <!-- 测试依赖 -->
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>net.isger</groupId>
            <artifactId>brick-raw-gson</artifactId>
            <version>${brick.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- 工具依赖 -->
        <dependency>
            <groupId>org.apache.avro</groupId>
            <artifactId>avro</artifactId>
        </dependency>
        <!-- 砖头依赖 -->
        <dependency>
            <groupId>net.isger</groupId>
            <artifactId>brick-raw</artifactId>
            <version>${brick.version}</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- 添加AVRO编译工具 -->
            <plugin>
                <groupId>org.apache.avro</groupId>
                <artifactId>avro-maven-plugin</artifactId>
                <version>${avro.version}</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>schema</goal>
                        </goals>
                        <configuration>
                            <sourceDirectory>${project.basedir}/src/main/avro/</sourceDirectory>
                            <outputDirectory>${project.basedir}/src/main/java/</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- 添加主源文件夹 -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.3.0</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${basedir}/src/main/dummy</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- 删除临时供应器 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.3</version>
                <executions>
                    <execution>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
                                <echo>Removing brick's dummy BrickCoreBinder</echo>
                                <delete
                                    dir="target/classes/net/isger/brick/bind" />
                            </tasks>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
