0%

springboot-7-类加载

重写 第三方 jar 的 类文件.

https://dzone.com/articles/spring-boot-classloader-and-class-override

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
+--- spring-boot-loader-play-0.0.1-SNAPSHOT.jar
+--- META-INF
+--- BOOT-INF
| +--- classes # 1 - project classes
| | +--- org.springframework.boot
| | | \--- SpringBootBanner.class # this is our fix
| | |
| | +--- pl.dk.loaderplay
| | \--- SpringBootLoaderApplication.class
| |
| +--- lib # 2 - nested jar libraries
| +--- javax.annotation-api-1.3.1
| +--- spring-boot-2.0.0.M7.jar # original banner class inside
| \--- (...)
|
+--- org.springframework.boot.loader # Spring Boot loader classes
+--- JarLauncher.class
+--- LaunchedURLClassLoader.class
\--- (...)