-
Notifications
You must be signed in to change notification settings - Fork 14
/
pom.xml
115 lines (110 loc) · 6.05 KB
/
pom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<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>
<artifactId>java-agent</artifactId>
<groupId>cloud.erda</groupId>
<version>1.0.0</version>
</parent>
<artifactId>agent-main</artifactId>
<packaging>jar</packaging>
<name>agent-main</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<premain.class>cloud.erda.agent.JavaAgent</premain.class>
<shade.package>cloud.erda.agent.dependencies</shade.package>
<shade.net.bytebuddy.source>net.bytebuddy</shade.net.bytebuddy.source>
<shade.net.bytebuddy.target>${shade.package}.${shade.net.bytebuddy.source}</shade.net.bytebuddy.target>
<shade.io.opentelemetry.source>io.opentelemetry</shade.io.opentelemetry.source>
<shade.io.opentelemetry.target>${shade.package}.${shade.io.opentelemetry.source}</shade.io.opentelemetry.target>
<agent.package.dest.dir>${project.basedir}/../dist/erda-java-agent</agent.package.dest.dir>
</properties>
<dependencies>
<!-- plugin -->
<dependency>
<groupId>cloud.erda</groupId>
<artifactId>agent-core</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<finalName>erda-agent</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<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>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Premain-Class>${premain.class}</Premain-Class>
<Can-Redefine-Classes>true</Can-Redefine-Classes>
<Can-Retransform-Classes>true</Can-Retransform-Classes>
</manifestEntries>
</transformer>
</transformers>
<artifactSet>
<excludes>
<exclude>com.lmax:*</exclude>
<exclude>org.apache.httpcomponents:*</exclude>
<exclude>commons-logging:*</exclude>
<exclude>commons-codec:*</exclude>
<exclude>*:gson</exclude>
<exclude>io.grpc:*</exclude>
<exclude>io.netty:*</exclude>
<exclude>com.google.*:*</exclude>
<exclude>com.google.guava:guava</exclude>
</excludes>
</artifactSet>
<relocations>
<relocation>
<pattern>${shade.net.bytebuddy.source}</pattern>
<shadedPattern>${shade.net.bytebuddy.target}</shadedPattern>
</relocation>
<relocation>
<pattern>${shade.io.opentelemetry.source}</pattern>
<shadedPattern>${shade.io.opentelemetry.target}</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<delete dir="${agent.package.dest.dir}/plugins" />
<delete dir="${agent.package.dest.dir}/integrations" />
<mkdir dir="${agent.package.dest.dir}" />
<delete dir="${agent.package.dest.dir}/logs" />
<delete dir="${agent.package.dest.dir}/licenses" />
<mkdir dir="${agent.package.dest.dir}/licenses" />
<copy file="${project.basedir}/../LICENSE-apache-skywalking.txt" tofile="${agent.package.dest.dir}/licenses/LICENSE-apache-skywalking.txt" overwrite="true" />
<copy file="${project.basedir}/../NOTICE-apache-skywalking.txt" tofile="${agent.package.dest.dir}/licenses/NOTICE-apache-skywalking.txt" overwrite="true" />
<copy file="${project.build.directory}/erda-agent.jar" tofile="${agent.package.dest.dir}/erda-agent.jar" overwrite="true" />
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>