Skip to content

Commit

Permalink
fix duplicated classes in bootstrap jar (#2347)
Browse files Browse the repository at this point in the history
* fix duplicated classes in bootstrap jar

* update binary resources
  • Loading branch information
SylvainJuge authored Dec 16, 2021
1 parent 55ad185 commit e4a02a0
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
18 changes: 18 additions & 0 deletions apm-agent-bootstrap/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<!-- '.esclazz' resources have to be excluded as they are re-generated after shading from '.class' -->
<execution>
<id>default-jar</id>
<configuration>
<includes>**/*.class</includes>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<executions>
Expand Down Expand Up @@ -103,13 +115,19 @@
with regular classloading. Their content will be injected as resources into the bootstrap
classloader -->

<delete dir="${tmpdir}"/>
<mkdir dir="${tmpdir}"/>

<unzip dest="${tmpdir}" src="${project.basedir}/target/${project.build.finalName}.jar"/>

<delete dir="${tmpdir}/bootstrap"/>
<mkdir dir="${tmpdir}/bootstrap"/>

<move todir="${tmpdir}/bootstrap">
<fileset dir="${tmpdir}" includes="**/*.class"/>
<mapper type="regexp" from="^(.*)\.class$$" to="\1\.esclazz"/>
</move>

<delete dir="${tmpdir}/java"/>
<delete dir="${tmpdir}/co"/>
<delete dir="${tmpdir}/META-INF"/>
Expand Down
Binary file not shown.
Binary file not shown.
3 changes: 1 addition & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,6 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.7</version>
<configuration>
<excludes>**/*.esclazz</excludes>
</configuration>
Expand Down Expand Up @@ -477,7 +476,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.5</version>
<version>0.8.7</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
Expand Down

0 comments on commit e4a02a0

Please sign in to comment.