pom.xml 7.0 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">
A
ascrutae 已提交
20 21
    <modelVersion>4.0.0</modelVersion>

A
ascrutae 已提交
22
    <parent>
23
        <groupId>org.apache.skywalking</groupId>
P
pengys5 已提交
24
        <artifactId>apm-sniffer</artifactId>
25
        <version>8.3.0</version>
A
ascrutae 已提交
26 27
    </parent>

P
pengys5 已提交
28
    <artifactId>apm-agent</artifactId>
A
ascrutae 已提交
29 30
    <packaging>jar</packaging>

P
pengys5 已提交
31
    <name>apm-agent</name>
A
ascrutae 已提交
32 33 34 35
    <url>http://maven.apache.org</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
36
        <premain.class>org.apache.skywalking.apm.agent.SkyWalkingAgent</premain.class>
于玉桔 已提交
37 38
        <can.redefine.classes>true</can.redefine.classes>
        <can.retransform.classes>true</can.retransform.classes>
39 40
        <shade.net.bytebuddy.source>net.bytebuddy</shade.net.bytebuddy.source>
        <shade.net.bytebuddy.target>${shade.package}.${shade.net.bytebuddy.source}</shade.net.bytebuddy.target>
A
ascrutae 已提交
41 42 43
    </properties>

    <dependencies>
44
        <!-- plugin -->
A
ascrutae 已提交
45
        <dependency>
46
            <groupId>org.apache.skywalking</groupId>
wu-sheng's avatar
wu-sheng 已提交
47
            <artifactId>apm-agent-core</artifactId>
A
ascrutae 已提交
48 49 50
            <version>${project.version}</version>
        </dependency>

A
ascrutae 已提交
51 52
    </dependencies>
    <build>
wu-sheng's avatar
wu-sheng 已提交
53
        <finalName>skywalking-agent</finalName>
A
ascrutae 已提交
54 55 56 57 58 59 60 61 62 63
        <plugins>
            <plugin>
                <artifactId>maven-shade-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
64 65 66 67
                            <shadedArtifactAttached>false</shadedArtifactAttached>
                            <createDependencyReducedPom>true</createDependencyReducedPom>
                            <createSourcesJar>true</createSourcesJar>
                            <shadeSourcesContent>true</shadeSourcesContent>
A
ascrutae 已提交
68
                            <transformers>
69
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
A
ascrutae 已提交
70
                                    <manifestEntries>
71
                                        <Premain-Class>${premain.class}</Premain-Class>
于玉桔 已提交
72 73
                                        <Can-Redefine-Classes>${can.redefine.classes}</Can-Redefine-Classes>
                                        <Can-Retransform-Classes>${can.retransform.classes}</Can-Retransform-Classes>
A
ascrutae 已提交
74 75 76
                                    </manifestEntries>
                                </transformer>
                            </transformers>
77 78 79
                            <artifactSet>
                                <excludes>
                                    <exclude>*:gson</exclude>
A
ascrutae 已提交
80 81
                                    <exclude>io.grpc:*</exclude>
                                    <exclude>io.netty:*</exclude>
wu-sheng's avatar
wu-sheng 已提交
82
                                    <exclude>io.opencensus:*</exclude>
83
                                    <exclude>com.google.*:*</exclude>
A
ascrutae 已提交
84
                                    <exclude>com.google.guava:guava</exclude>
85 86 87
                                    <exclude>org.checkerframework:checker-compat-qual</exclude>
                                    <exclude>org.codehaus.mojo:animal-sniffer-annotations</exclude>
                                    <exclude>io.perfmark:*</exclude>
88
                                    <exclude>org.slf4j:*</exclude>
89 90
                                </excludes>
                            </artifactSet>
91
                            <relocations>
A
ascrutae 已提交
92 93 94 95
                                <relocation>
                                    <pattern>${shade.net.bytebuddy.source}</pattern>
                                    <shadedPattern>${shade.net.bytebuddy.target}</shadedPattern>
                                </relocation>
96
                            </relocations>
L
li.can 已提交
97 98 99 100 101 102 103 104
                            <filters>
                                <filter>
                                    <artifact>net.bytebuddy:byte-buddy</artifact>
                                    <excludes>
                                        <exclude>META-INF/versions/9/module-info.class</exclude>
                                    </excludes>
                                </filter>
                            </filters>
A
ascrutae 已提交
105 106 107 108
                        </configuration>
                    </execution>
                </executions>
            </plugin>
A
ascrutae 已提交
109 110 111 112
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
113 114
                        <id>clean</id>
                        <phase>clean</phase>
A
ascrutae 已提交
115 116 117 118 119
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
120
                                <delete dir="${project.basedir}/../../skywalking-agent" />
121 122 123 124 125 126 127 128 129 130 131
                            </tasks>
                        </configuration>
                    </execution>
                    <execution>
                        <id>package</id>
                        <phase>package</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
132 133 134 135 136
                                <mkdir dir="${project.basedir}/../../skywalking-agent" />
                                <copy file="${project.build.directory}/skywalking-agent.jar" tofile="${project.basedir}/../../skywalking-agent/skywalking-agent.jar" overwrite="true" />
                                <mkdir dir="${project.basedir}/../../skywalking-agent/config" />
                                <mkdir dir="${project.basedir}/../../skywalking-agent/logs" />
                                <copydir src="${project.basedir}/../config" dest="${project.basedir}/../../skywalking-agent/config" forceoverwrite="true" />
A
ascrutae 已提交
137 138 139 140 141
                            </tasks>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
A
ascrutae 已提交
142 143
        </plugins>
    </build>
144

145

A
ascrutae 已提交
146
</project>