Skip to content

Commit e4a02a0

Browse files
authored
fix duplicated classes in bootstrap jar (#2347)
* fix duplicated classes in bootstrap jar * update binary resources
1 parent 55ad185 commit e4a02a0

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

apm-agent-bootstrap/pom.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,18 @@
6060
</execution>
6161
</executions>
6262
</plugin>
63+
<plugin>
64+
<artifactId>maven-jar-plugin</artifactId>
65+
<executions>
66+
<!-- '.esclazz' resources have to be excluded as they are re-generated after shading from '.class' -->
67+
<execution>
68+
<id>default-jar</id>
69+
<configuration>
70+
<includes>**/*.class</includes>
71+
</configuration>
72+
</execution>
73+
</executions>
74+
</plugin>
6375
<plugin>
6476
<artifactId>maven-shade-plugin</artifactId>
6577
<executions>
@@ -103,13 +115,19 @@
103115
with regular classloading. Their content will be injected as resources into the bootstrap
104116
classloader -->
105117

118+
<delete dir="${tmpdir}"/>
106119
<mkdir dir="${tmpdir}"/>
120+
107121
<unzip dest="${tmpdir}" src="${project.basedir}/target/${project.build.finalName}.jar"/>
122+
123+
<delete dir="${tmpdir}/bootstrap"/>
108124
<mkdir dir="${tmpdir}/bootstrap"/>
125+
109126
<move todir="${tmpdir}/bootstrap">
110127
<fileset dir="${tmpdir}" includes="**/*.class"/>
111128
<mapper type="regexp" from="^(.*)\.class$$" to="\1\.esclazz"/>
112129
</move>
130+
113131
<delete dir="${tmpdir}/java"/>
114132
<delete dir="${tmpdir}/co"/>
115133
<delete dir="${tmpdir}/META-INF"/>
Binary file not shown.

pom.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,6 @@
362362
<plugin>
363363
<groupId>org.jacoco</groupId>
364364
<artifactId>jacoco-maven-plugin</artifactId>
365-
<version>0.8.7</version>
366365
<configuration>
367366
<excludes>**/*.esclazz</excludes>
368367
</configuration>
@@ -477,7 +476,7 @@
477476
<plugin>
478477
<groupId>org.jacoco</groupId>
479478
<artifactId>jacoco-maven-plugin</artifactId>
480-
<version>0.8.5</version>
479+
<version>0.8.7</version>
481480
</plugin>
482481
<plugin>
483482
<groupId>org.codehaus.mojo</groupId>

0 commit comments

Comments
 (0)