pom.xml 13.1 KB
Newer Older
1
<!--
wu-sheng's avatar
wu-sheng 已提交
2 3 4 5 6 7
  ~ 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
8 9 10 11 12 13 14 15 16 17 18
  ~
  ~     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.
  ~
  -->

19
<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">
wu-sheng's avatar
wu-sheng 已提交
20
    <modelVersion>4.0.0</modelVersion>
21

wu-sheng's avatar
wu-sheng 已提交
22
    <parent>
23
        <groupId>org.apache.skywalking</groupId>
P
pengys5 已提交
24
        <artifactId>apm-sniffer</artifactId>
H
Hongtao Gao 已提交
25
        <version>8.4.0.4</version>
wu-sheng's avatar
wu-sheng 已提交
26
    </parent>
wu-sheng's avatar
wu-sheng 已提交
27

28
    <artifactId>apm-agent-core</artifactId>
wu-sheng's avatar
wu-sheng 已提交
29
    <packaging>jar</packaging>
30

31
    <name>apm-agent-core</name>
wu-sheng's avatar
wu-sheng 已提交
32
    <url>http://maven.apache.org</url>
33

wu-sheng's avatar
wu-sheng 已提交
34 35
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
D
dylan 已提交
36
        <guava.version>20.0</guava.version>
37
        <wiremock.version>2.6.0</wiremock.version>
wu-sheng's avatar
wu-sheng 已提交
38
        <netty-tcnative-boringssl-static.version>2.0.7.Final</netty-tcnative-boringssl-static.version>
39
        <os-maven-plugin.version>1.4.1.Final</os-maven-plugin.version>
40
        <shade.package>org.apache.skywalking.apm.dependencies</shade.package>
41 42
        <shade.com.google.source>com.google</shade.com.google.source>
        <shade.com.google.target>${shade.package}.${shade.com.google.source}</shade.com.google.target>
A
ascrutae 已提交
43 44 45 46
        <shade.io.grpc.source>io.grpc</shade.io.grpc.source>
        <shade.io.grpc.target>${shade.package}.${shade.io.grpc.source}</shade.io.grpc.target>
        <shade.io.netty.source>io.netty</shade.io.netty.source>
        <shade.io.netty.target>${shade.package}.${shade.io.netty.source}</shade.io.netty.target>
47 48
        <shade.io.opencensus.source>io.opencensus</shade.io.opencensus.source>
        <shade.io.opencensus.target>${shade.package}.${shade.io.opencensus.source}</shade.io.opencensus.target>
49 50
        <shade.io.perfmark.source>io.perfmark</shade.io.perfmark.source>
        <shade.io.perfmark.target>${shade.package}.${shade.io.perfmark.source}</shade.io.perfmark.target>
51 52
        <shade.org.slf4j.source>org.slf4j</shade.org.slf4j.source>
        <shade.org.slf4j.target>${shade.package}.${shade.org.slf4j.source}</shade.org.slf4j.target>
53
        <ststem-rules.version>1.18.0</ststem-rules.version>
54
        <slf4j.version>1.7.25</slf4j.version>
wu-sheng's avatar
wu-sheng 已提交
55
    </properties>
56

wu-sheng's avatar
wu-sheng 已提交
57
    <dependencies>
wu-sheng's avatar
wu-sheng 已提交
58
        <dependency>
59
            <groupId>org.apache.skywalking</groupId>
wu-sheng's avatar
wu-sheng 已提交
60 61 62
            <artifactId>apm-network</artifactId>
            <version>${project.version}</version>
        </dependency>
63
        <dependency>
64
            <groupId>org.apache.skywalking</groupId>
65 66 67
            <artifactId>apm-util</artifactId>
            <version>${project.version}</version>
        </dependency>
68 69 70 71
        <dependency>
            <groupId>net.bytebuddy</groupId>
            <artifactId>byte-buddy</artifactId>
        </dependency>
72 73 74 75 76
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>${gson.version}</version>
        </dependency>
77

wu-sheng's avatar
wu-sheng 已提交
78 79 80 81 82
        <dependency>
            <groupId>net.bytebuddy</groupId>
            <artifactId>byte-buddy-agent</artifactId>
            <version>${bytebuddy.version}</version>
            <scope>test</scope>
wu-sheng's avatar
wu-sheng 已提交
83
        </dependency>
A
ascrutae 已提交
84 85 86
        <dependency>
            <groupId>com.github.tomakehurst</groupId>
            <artifactId>wiremock</artifactId>
87
            <version>${wiremock.version}</version>
A
ascrutae 已提交
88
            <scope>test</scope>
89 90 91 92 93 94 95 96 97 98 99 100 101 102
            <exclusions>
                <exclusion>
                    <artifactId>jackson-annotations</artifactId>
                    <groupId>com.fasterxml.jackson.core</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jackson-core</artifactId>
                    <groupId>com.fasterxml.jackson.core</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>jackson-databind</artifactId>
                    <groupId>com.fasterxml.jackson.core</groupId>
                </exclusion>
            </exclusions>
A
ascrutae 已提交
103 104 105 106
        </dependency>
        <dependency>
            <groupId>io.grpc</groupId>
            <artifactId>grpc-testing</artifactId>
107
            <version>${grpc.version}</version>
A
ascrutae 已提交
108 109 110 111 112 113 114 115
            <exclusions>
                <exclusion>
                    <artifactId>mockito-core</artifactId>
                    <groupId>org.mockito</groupId>
                </exclusion>
            </exclusions>
            <scope>test</scope>
        </dependency>
A
ascrutae 已提交
116
        <dependency>
117
            <groupId>org.apache.skywalking</groupId>
A
ascrutae 已提交
118 119 120
            <artifactId>apm-datacarrier</artifactId>
            <version>${project.version}</version>
        </dependency>
121 122 123 124 125 126
        <dependency>
            <groupId>com.github.stefanbirkner</groupId>
            <artifactId>system-rules</artifactId>
            <version>${ststem-rules.version}</version>
            <scope>test</scope>
        </dependency>
127 128 129 130 131
        <dependency>
            <groupId>org.openjdk.jmh</groupId>
            <artifactId>jmh-generator-annprocess</artifactId>
            <scope>test</scope>
        </dependency>
132 133 134 135
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
wu-sheng's avatar
wu-sheng 已提交
136
    </dependencies>
D
dylan 已提交
137
    <dependencyManagement>
wu-sheng's avatar
wu-sheng 已提交
138 139 140 141 142 143
        <dependencies>
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${guava.version}</version>
            </dependency>
144 145 146 147 148 149 150 151 152 153
            <dependency>
                <groupId>net.bytebuddy</groupId>
                <artifactId>byte-buddy</artifactId>
                <version>${bytebuddy.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
wu-sheng's avatar
wu-sheng 已提交
154
        </dependencies>
D
dylan 已提交
155
    </dependencyManagement>
wu-sheng's avatar
wu-sheng 已提交
156
    <build>
157 158
        <plugins>
            <plugin>
wu-sheng's avatar
wu-sheng 已提交
159 160
                <groupId>kr.motd.maven</groupId>
                <artifactId>os-maven-plugin</artifactId>
161
                <version>${os-maven-plugin.version}</version>
162 163 164 165 166 167 168 169 170
                <executions>
                    <execution>
                        <phase>initialize</phase>
                        <goals>
                            <goal>detect</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
wu-sheng's avatar
wu-sheng 已提交
171
            <plugin>
172 173 174 175 176 177 178 179 180 181 182
                <artifactId>maven-shade-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <artifactSet>
                                <excludes>
                                    <exclude>net.bytebuddy:byte-buddy:jar:</exclude>
A
ascrutae 已提交
183 184
                                    <exclude>com.google.errorprone:error_prone_annotations:jar:</exclude>
                                    <exclude>com.google.code.findbugs:jsr305:jar:</exclude>
185 186 187 188
                                    <exclude>com.google.android:annotations:jar:</exclude>
                                    <exclude>com.google.api.grpc:proto-google-common-protos:jar:</exclude>
                                    <exclude>org.checkerframework:checker-compat-qual:jar:</exclude>
                                    <exclude>org.codehaus.mojo:animal-sniffer-annotations:jar:</exclude>
189 190 191 192 193 194 195
                                </excludes>
                            </artifactSet>
                            <relocations>
                                <relocation>
                                    <pattern>${shade.com.google.source}</pattern>
                                    <shadedPattern>${shade.com.google.target}</shadedPattern>
                                </relocation>
A
ascrutae 已提交
196 197 198 199 200 201 202 203
                                <relocation>
                                    <pattern>${shade.io.grpc.source}</pattern>
                                    <shadedPattern>${shade.io.grpc.target}</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>${shade.io.netty.source}</pattern>
                                    <shadedPattern>${shade.io.netty.target}</shadedPattern>
                                </relocation>
204 205 206 207
                                <relocation>
                                    <pattern>${shade.io.opencensus.source}</pattern>
                                    <shadedPattern>${shade.io.opencensus.target}</shadedPattern>
                                </relocation>
208 209 210 211
                                <relocation>
                                    <pattern>${shade.io.perfmark.source}</pattern>
                                    <shadedPattern>${shade.io.perfmark.target}</shadedPattern>
                                </relocation>
212 213 214 215
                                <relocation>
                                    <pattern>${shade.org.slf4j.source}</pattern>
                                    <shadedPattern>${shade.org.slf4j.target}</shadedPattern>
                                </relocation>
216
                            </relocations>
217 218 219 220
                            <filters>
                                <filter>
                                    <artifact>com.google.protobuf:protobuf-java</artifact>
                                    <excludes>
A
ascrutae 已提交
221 222
                                        <exclude>google/protobuf/*.proto</exclude>
                                        <exclude>google/protobuf/compiler/*.proto</exclude>
223 224 225
                                    </excludes>
                                </filter>
                            </filters>
226
                            <transformers>
227
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
228
                            </transformers>
229 230 231 232
                        </configuration>
                    </execution>
                </executions>
            </plugin>
wu-sheng's avatar
wu-sheng 已提交
233 234 235 236 237 238 239 240 241
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
242
                            <target>
243
                                <delete dir="${project.basedir}/../../packages" />
244
                            </target>
wu-sheng's avatar
wu-sheng 已提交
245 246
                        </configuration>
                    </execution>
247 248 249 250 251
                    <execution>
                        <id>unpack</id>
                        <phase>package</phase>
                        <configuration>
                            <target>
252 253 254 255 256 257 258 259
                                <echo message="unjar" />
                                <unzip src="${project.build.directory}/${project.artifactId}-${project.version}.jar" dest="${project.build.directory}/unpacked/" />
                                <echo message="rename service providers in META-INF/services" />
                                <move file="${project.build.directory}/unpacked/META-INF/native/libnetty_tcnative_osx_x86_64.jnilib" tofile="${project.build.directory}/unpacked/META-INF/native/liborg_apache_skywalking_apm_dependencies_netty_tcnative_osx_x86_64.jnilib" />
                                <move file="${project.build.directory}/unpacked/META-INF/native/libnetty_tcnative_linux_x86_64.so" tofile="${project.build.directory}/unpacked/META-INF/native/liborg_apache_skywalking_apm_dependencies_netty_tcnative_linux_x86_64.so" />
                                <move file="${project.build.directory}/unpacked/META-INF/native/netty_tcnative_windows_x86_64.dll" tofile="${project.build.directory}/unpacked/META-INF/native/org_apache_skywalking_apm_dependencies_netty_tcnative_windows_x86_64.dll" />
                                <echo message="jar back" />
                                <jar destfile="${project.build.directory}/${project.artifactId}-${project.version}.jar" basedir="${project.build.directory}/unpacked" />
260 261 262 263 264 265
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
wu-sheng's avatar
wu-sheng 已提交
266 267
                </executions>
            </plugin>
wu-sheng's avatar
wu-sheng 已提交
268 269
        </plugins>
    </build>
270
</project>