<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>com.a.eye</groupId>
        <artifactId>skywalking-sniffer</artifactId>
        <version>3.0-2017</version>
    </parent>

    <artifactId>skywalking-agent</artifactId>
    <packaging>jar</packaging>

    <name>skywalking-agent</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <shade.package>com.a.eye.skywalking.api.dependencies</shade.package>
        <premain.class>com.a.eye.skywalking.agent.SkyWalkingAgent</premain.class>
        <shade.net.bytebuddy.source>net.bytebuddy</shade.net.bytebuddy.source>
        <shade.net.bytebuddy.target>${shade.package}.${shade.net.bytebuddy.source}</shade.net.bytebuddy.target>
        <!-- queue -->
        <shade.com.lmax.disruptor.source>com.lmax.disruptor</shade.com.lmax.disruptor.source>
        <shade.com.lmax.disruptor.target>${shade.package}.${shade.com.lmax.disruptor.source}</shade.com.lmax.disruptor.target>
    </properties>

    <dependencies>
        <!-- plugin -->
        <dependency>
            <groupId>com.a.eye</groupId>
            <artifactId>skywalking-jedis-2.x-plugin</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.a.eye</groupId>
            <artifactId>skywalking-jdbc-plugin</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.a.eye</groupId>
            <artifactId>skywalking-httpClient-4.x-plugin</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.a.eye</groupId>
            <artifactId>skywalking-dubbo-plugin</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.a.eye</groupId>
            <artifactId>tomcat-7.x-8.x-plugin</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.a.eye</groupId>
            <artifactId>motan-plugin</artifactId>
            <version>${project.version}</version>
        </dependency>

        <!-- activation -->
        <dependency>
            <groupId>com.a.eye</groupId>
            <artifactId>skywalking-toolkit-log4j-1.x-activation</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.a.eye</groupId>
            <artifactId>skywalking-toolkit-log4j-2.x-activation</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>com.a.eye</groupId>
            <artifactId>skywalking-toolkit-logback-1.x-activation</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>com.a.eye</groupId>
            <artifactId>skywalking-toolkit-trace-context-activation</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>com.a.eye</groupId>
            <artifactId>skywalking-toolkit-opentracing-activation</artifactId>
            <version>${project.version}</version>
        </dependency>

    </dependencies>
    <build>
        <finalName>${artifactId}</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>2.4.1</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <shadedArtifactAttached>false</shadedArtifactAttached>
                            <createDependencyReducedPom>true</createDependencyReducedPom>
                            <createSourcesJar>true</createSourcesJar>
                            <shadeSourcesContent>true</shadeSourcesContent>
                            <transformers>
                                <transformer
                                        implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                    <resource>skywalking-plugin.def</resource>
                                </transformer>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                    <manifestEntries>
                                        <Premain-Class>${premain.class}</Premain-Class>
                                    </manifestEntries>
                                </transformer>
                            </transformers>
                            <relocations>
                                <relocation>
                                    <pattern>${shade.net.bytebuddy.source}</pattern>
                                    <shadedPattern>${shade.net.bytebuddy.target}</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>${shade.com.lmax.disruptor.source}</pattern>
                                    <shadedPattern>${shade.com.lmax.disruptor.target}</shadedPattern>
                                </relocation>
                            </relocations>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <distributionManagement>
        <repository>
            <id>bintray-wu-sheng-sky-walking-repository</id>
            <name>wu-sheng-sky-walking-repository</name>
            <url>https://api.bintray.com/maven/wu-sheng/skywalking/com.a.eye.skywalking-agent/;publish=1</url>
        </repository>
    </distributionManagement>
</project>
