<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one or more
  ~ contributor license agreements.  See the NOTICE file distributed with
  ~ this work for additional information regarding copyright ownership.
  ~ The ASF licenses this file to You under the Apache License, Version 2.0
  ~ (the "License"); you may not use this file except in compliance with
  ~ the License.  You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  ~
  -->

<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>org.apache.skywalking</groupId>
        <artifactId>java-agent-sniffer</artifactId>
        <version>9.4.0</version>
    </parent>

    <artifactId>apm-sdk-plugin</artifactId>
    <modules>
        <module>dubbo-plugin</module>
        <module>jdbc-commons</module>
        <module>httpClient-4.x-plugin</module>
        <module>redisson-3.x-plugin</module>
        <module>tomcat-7.x-8.x-plugin</module>
        <module>tomcat-10x-plugin</module>
        <module>motan-plugin</module>
        <module>mongodb-3.x-plugin</module>
        <module>mongodb-4.x-plugin</module>
        <module>feign-default-http-9.x-plugin</module>
        <module>okhttp-3.x-plugin</module>
        <module>okhttp-4.x-plugin</module>
        <module>okhttp-common</module>
        <module>spring-plugins</module>
        <module>struts2-2.x-plugin</module>
        <module>nutz-plugins</module>
        <module>jetty-plugin</module>
        <module>spymemcached-2.x-plugin</module>
        <module>xmemcached-2.x-plugin</module>
        <module>grpc-1.x-plugin</module>
        <module>mysql-5.x-plugin</module>
        <module>mysql-6.x-plugin</module>
        <module>mysql-8.x-plugin</module>
        <module>mysql-common</module>
        <module>h2-1.x-plugin</module>
        <module>postgresql-8.x-plugin</module>
        <module>rocketMQ-3.x-plugin</module>
        <module>rocketMQ-4.x-plugin</module>
        <module>elastic-job-2.x-plugin</module>
        <module>elasticjob-3.x-plugin</module>
        <module>mongodb-2.x-plugin</module>
        <module>httpasyncclient-4.x-plugin</module>
        <module>kafka-commons</module>
        <module>kafka-plugin</module>
        <module>servicecomb-plugin</module>
        <module>hystrix-1.x-plugin</module>
        <module>sofarpc-plugin</module>
        <module>activemq-5.x-plugin</module>
        <module>elasticsearch-common</module>
        <module>elasticsearch-5.x-plugin</module>
        <module>elasticsearch-6.x-plugin</module>
        <module>elasticsearch-7.x-plugin</module>
        <module>undertow-plugins</module>
        <module>rabbitmq-plugin</module>
        <module>dubbo-conflict-patch</module>
        <module>canal-1.x-plugin</module>
        <module>dubbo-2.7.x-plugin</module>
        <module>dubbo-2.7.x-conflict-patch</module>
        <module>dubbo-3.x-plugin</module>
        <module>dubbo-3.x-conflict-patch</module>
        <module>vertx-plugins</module>
        <module>resteasy-plugin</module>
        <module>solrj-7.x-plugin</module>
        <module>cassandra-java-driver-3.x-plugin</module>
        <module>light4j-plugins</module>
        <module>pulsar-2.2-2.7-plugin</module>
        <module>netty-socketio-plugin</module>
        <module>httpclient-3.x-plugin</module>
        <module>play-2.x-plugin</module>
        <module>lettuce-5.x-plugin</module>
        <module>avro-plugin</module>
        <module>finagle-6.25.x-plugin</module>
        <module>quasar-plugin</module>
        <module>mariadb-2.x-plugin</module>
        <module>influxdb-2.x-plugin</module>
        <module>baidu-brpc-plugin</module>
        <module>baidu-brpc-3.x-plugin</module>
        <module>hbase-1.x-2.x-plugin</module>
        <module>graphql-plugin</module>
        <module>xxl-job-2.x-plugin</module>
        <module>thrift-plugin</module>
        <module>httpclient-commons</module>
        <module>asynchttpclient-2.x-plugin</module>
        <module>dbcp-2.x-plugin</module>
        <module>mssql-commons</module>
        <module>mssql-jtds-1.x-plugin</module>
        <module>mssql-jdbc-plugin</module>
        <module>cxf-3.x-plugin</module>
        <module>jsonrpc4j-1.x-plugin</module>
        <module>neo4j-4.x-plugin</module>
        <module>shardingsphere-plugins</module>
        <module>druid-1.x-plugin</module>
        <module>hikaricp-3.x-4.x-plugin</module>
        <module>httpclient-5.x-plugin</module>
        <module>clickhouse-0.3.2.x-plugin</module>
        <module>clickhouse-0.3.1-plugin</module>
        <module>kylin-jdbc-2.6.x-3.x-4.x-plugin</module>
        <module>okhttp-2.x-plugin</module>
        <module>pulsar-common</module>
        <module>pulsar-2.8.x-plugin</module>
        <module>undertow-worker-thread-pool-plugin</module>
        <module>tomcat-thread-pool-plugin</module>
        <module>guava-eventbus-plugin</module>
        <module>hutool-plugins</module>
        <module>micronaut-plugins</module>
        <module>nats-2.14.x-2.16.5-plugin</module>
        <module>jedis-plugins</module>
        <module>apm-armeria-plugins</module>
        <module>jetty-thread-pool-plugin</module>
        <module>jersey-2.x-plugin</module>
        <module>jersey-3.x-plugin</module>
        <module>grizzly-2.3.x-4.x-plugin</module>
        <module>grizzly-2.3.x-4.x-work-threadpool-plugin</module>
        <module>rocketMQ-5.x-plugin</module>
        <module>websphere-liberty-23.x-plugin</module>
        <module>aerospike-plugin</module>
        <module>rocketMQ-client-java-5.x-plugin</module>
        <module>activemq-artemis-jakarta-client-2.x-plugin</module>
        <module>c3p0-0.9.x-plugin</module>
        <module>solon-2.x-plugin</module>
    </modules>
    <packaging>pom</packaging>

    <name>apm-sdk-plugin</name>
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <shade.net.bytebuddy.source>net.bytebuddy</shade.net.bytebuddy.source>
        <shade.net.bytebuddy.target>${shade.package}.${shade.net.bytebuddy.source}</shade.net.bytebuddy.target>

        <plugin.dest.dir>${maven.multiModuleProjectDirectory}/skywalking-agent/plugins</plugin.dest.dir>

        <ant-contrib.version>1.0b3</ant-contrib.version>
        <ant-nodeps.version>1.8.1</ant-nodeps.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.skywalking</groupId>
            <artifactId>apm-agent-core</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>net.bytebuddy</groupId>
            <artifactId>byte-buddy</artifactId>
            <version>${bytebuddy.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.skywalking</groupId>
            <artifactId>java-agent-util</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.skywalking</groupId>
            <artifactId>apm-test-tools</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-inline</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-shade-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <shadedArtifactAttached>false</shadedArtifactAttached>
                            <createDependencyReducedPom>true</createDependencyReducedPom>
                            <createSourcesJar>true</createSourcesJar>
                            <shadeSourcesContent>true</shadeSourcesContent>
                            <relocations>
                                <relocation>
                                    <pattern>${shade.net.bytebuddy.source}</pattern>
                                    <shadedPattern>${shade.net.bytebuddy.target}</shadedPattern>
                                </relocation>
                            </relocations>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="maven.runtime.classpath" />
                                <if>
                                    <equals arg1="${project.packaging}" arg2="jar" />
                                    <then>
                                        <mkdir dir="${plugin.dest.dir}" />
                                        <copy file="${project.build.directory}/${project.artifactId}-${project.version}.jar" tofile="${plugin.dest.dir}/${project.artifactId}-${project.version}.jar" overwrite="true" />
                                    </then>
                                </if>

                            </target>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>ant-contrib</groupId>
                        <artifactId>ant-contrib</artifactId>
                        <version>${ant-contrib.version}</version>
                        <exclusions>
                            <exclusion>
                                <groupId>ant</groupId>
                                <artifactId>ant</artifactId>
                            </exclusion>
                        </exclusions>
                    </dependency>
                    <dependency>
                        <groupId>org.apache.ant</groupId>
                        <artifactId>ant-nodeps</artifactId>
                        <version>${ant-nodeps.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>
</project>
