<?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>

    <parent>
        <groupId>io.tiklab</groupId>
        <artifactId>tiklab-teston-agent</artifactId>
        <version>1.0.0</version>
    </parent>
    <artifactId>tiklab-teston-agent-starter</artifactId>
    <name>${project.artifactId}</name>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>io.tiklab</groupId>
            <artifactId>tiklab-rpc-spring-boot-starter</artifactId>
        </dependency>

        <dependency>
            <groupId>io.tiklab</groupId>
            <artifactId>tiklab-teston-agent-server</artifactId>
        </dependency>

    </dependencies>

    <profiles>
        <!--linux-->
        <profile>
            <id>system-linux</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <dependencies>

                <dependency>
                    <groupId>io.tiklab</groupId>
                    <artifactId>tiklab-jdk-linux</artifactId>
                    <version>${tiklab-jdk.version}</version>
                    <type>zip</type>
                    <scope>provided</scope>
                </dependency>
<!--                <dependency>-->
<!--                    <groupId>io.tiklab</groupId>-->
<!--                    <artifactId>tiklab-teston-chrome-linux</artifactId>-->
<!--                    <version>${tiklab-teston-chrome-linux.version}</version>-->
<!--                    <type>zip</type>-->
<!--                    <scope>provided</scope>-->
<!--                </dependency>-->
<!--                <dependency>-->
<!--                    <groupId>io.tiklab</groupId>-->
<!--                    <artifactId>tiklab-teston-node-linux</artifactId>-->
<!--                    <version>${tiklab-teston-node-linux.version}</version>-->
<!--                    <type>zip</type>-->
<!--                    <scope>provided</scope>-->
<!--                </dependency>-->
            </dependencies>
            <properties>
                <assembly>linux</assembly>
                <systemType>linux</systemType>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <version>2.8</version>

                        <executions>
                            <execution>
                                <id>unpack</id>
                                <phase>compile</phase>
                                <goals>
                                    <goal>unpack</goal>
                                </goals>
                                <configuration>
                                    <artifactItems>
<!--                                        <dependency>-->
<!--                                            <groupId>io.tiklab</groupId>-->
<!--                                            <artifactId>tiklab-teston-chrome-linux</artifactId>-->
<!--                                            <version>1.0.0.3</version>-->
<!--                                            <type>zip</type>-->
<!--                                            <outputDirectory>embbed</outputDirectory>-->
<!--                                        </dependency>-->
<!--                                        <dependency>-->
<!--                                            <groupId>io.tiklab</groupId>-->
<!--                                            <artifactId>tiklab-teston-node-linux</artifactId>-->
<!--                                            <version>1.0.0.3</version>-->
<!--                                            <type>zip</type>-->
<!--                                            <outputDirectory>embbed</outputDirectory>-->
<!--                                        </dependency>-->
                                        <artifactItem>
                                            <groupId>io.tiklab</groupId>
                                            <artifactId>tiklab-jdk-linux</artifactId>
                                            <version>${tiklab-jdk.version}</version>
                                            <type>zip</type>
                                            <outputDirectory>embbed</outputDirectory>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                        </executions>

                    </plugin>
                </plugins>
            </build>
        </profile>

<!--        <profile>-->
<!--            <id>system-windows</id>-->
<!--            <dependencies>-->
<!--                <dependency>-->
<!--                    <groupId>io.tiklab</groupId>-->
<!--                    <artifactId>tiklab-teston-driver-chrome</artifactId>-->
<!--                    <version>1.0.0.3</version>-->
<!--                    <type>zip</type>-->
<!--                    <scope>provided</scope>-->
<!--                </dependency>-->
<!--                <dependency>-->
<!--                    <groupId>io.tiklab</groupId>-->
<!--                    <artifactId>tiklab-teston-driver-nodejs</artifactId>-->
<!--                    <version>1.0.0.3</version>-->
<!--                    <type>zip</type>-->
<!--                    <scope>provided</scope>-->
<!--                </dependency>-->
<!--                <dependency>-->
<!--                    <groupId>io.tiklab</groupId>-->
<!--                    <artifactId>tiklab-teston-driver-appium</artifactId>-->
<!--                    <version>1.0.0.3</version>-->
<!--                    <type>zip</type>-->
<!--                    <scope>provided</scope>-->
<!--                </dependency>-->
<!--            </dependencies>-->
<!--            <properties>-->
<!--                <assembly>windows</assembly>-->
<!--                <systemType>windows</systemType>-->
<!--            </properties>-->
<!--            -->
<!--            -->
<!--        </profile>-->



        <!--dev-->
        <profile>
            <id>env-dev</id>
            <properties>
                <yaml-type>/config/dev</yaml-type>
            </properties>
        </profile>

        <!--test-->
        <profile>
            <id>env-test</id>
            <properties>
                <yaml-type>/config/test</yaml-type>
            </properties>
        </profile>

        <!--prd-->
        <profile>
            <id>env-prd</id>
            <properties>
                <yaml-type>/config/prd</yaml-type>
            </properties>
        </profile>


        <!--release-->
        <profile>
            <id>env-release</id>
            <properties>
                <yaml-type>/</yaml-type>
            </properties>
        </profile>

    </profiles>

    <build>
        <plugins>
<!--            &lt;!&ndash;跳过发包&ndash;&gt;-->
<!--            <plugin>-->
<!--                <groupId>org.apache.maven.plugins</groupId>-->
<!--                <artifactId>maven-deploy-plugin</artifactId>-->
<!--                <configuration>-->
<!--                    <skip>true</skip>-->
<!--                </configuration>-->
<!--            </plugin>-->

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>*.yaml</exclude>
                        <exclude>*.properties</exclude>
                        <exclude>*.xml</exclude>
                        <exclude>**/config/dev/**</exclude>
                        <exclude>**/config/test/**</exclude>
                        <exclude>**/config/prd/**</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <!--maven打包插件-->
<!--            <plugin>-->
<!--                <groupId>org.apache.maven.plugins</groupId>-->
<!--                <artifactId>maven-assembly-plugin</artifactId>-->
<!--                <configuration>-->
<!--                    <appendAssemblyId>false</appendAssemblyId>-->
<!--                    <descriptorRefs>-->
<!--                        <descriptorRef>jar-with-dependencies</descriptorRef>-->
<!--                    </descriptorRefs>-->
<!--                    <archive>-->
<!--                        <manifest>-->
<!--                            <mainClass>TestOnAgentStarter</mainClass>-->
<!--                        </manifest>-->
<!--                    </archive>-->
<!--                </configuration>-->
<!--                <executions>-->
<!--                    <execution>-->
<!--                        <id>make-assembly</id>-->
<!--                        <phase>package</phase>-->
<!--                        <goals>-->
<!--                            <goal>assembly</goal>-->
<!--                        </goals>-->
<!--                    </execution>-->
<!--                </executions>-->
<!--            </plugin>-->
            <!--maven打包插件-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <configuration>
                            <descriptors>
                                <descriptor>assembly/distribution-${assembly}.xml</descriptor>
                            </descriptors>
                            <finalName>tiklab-teston-agent-starter</finalName>
                            <appendAssemblyId>false</appendAssemblyId>
                        </configuration>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.5</version>
                <executions>
                    <execution>
                        <id>auto-clean</id>
                        <phase>initialize</phase>
                        <goals>
                            <goal>clean</goal>
                        </goals>
                        <configuration>
                            <skip>false</skip>
                            <filesets>
                                <fileset>
                                    <directory>${basedir}/driver</directory>
                                </fileset>
                            </filesets>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>

