Isolate Aether in a separate class loader
Prior to this commit, the Aether-based GrapeEngine was loaded in the same class loader as the rest of Boot. This led to Aether's and its dependencies' types polluting the application's class path. Most notably, this caused problems with logging as the logging framework could be permaturely initialized. This commit isolates AetherGrapeEngine, Aether and its dependencies into a separate class loader. This is done by customizing the packaging of the CLI's jar file with the internal directory housing all of the types that will be loaded by the separate class loader.
This commit is contained in:
@@ -23,13 +23,11 @@
|
||||
<directoryMode>755</directoryMode>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
<dependencySets>
|
||||
<dependencySet>
|
||||
<includes>
|
||||
<include>org.springframework.boot:spring-boot-cli:jar:*</include>
|
||||
</includes>
|
||||
<outputDirectory>lib</outputDirectory>
|
||||
<directoryMode>755</directoryMode>
|
||||
</dependencySet>
|
||||
</dependencySets>
|
||||
<files>
|
||||
<file>
|
||||
<source>${project.build.directory}/${project.artifactId}-${project.version}-repackaged.jar</source>
|
||||
<outputDirectory>/lib</outputDirectory>
|
||||
<destName>${project.build.finalName}.jar</destName>
|
||||
</file>
|
||||
</files>
|
||||
</assembly>
|
||||
25
spring-boot-cli/src/main/assembly/repackage-jar.xml
Normal file
25
spring-boot-cli/src/main/assembly/repackage-jar.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<assembly>
|
||||
<id>repackaged</id>
|
||||
<formats>
|
||||
<format>jar</format>
|
||||
</formats>
|
||||
<includeBaseDirectory>false</includeBaseDirectory>
|
||||
<dependencySets>
|
||||
<dependencySet>
|
||||
<includes>
|
||||
<include>org.springframework.boot:spring-boot-cli:jar:*</include>
|
||||
</includes>
|
||||
<unpack>true</unpack>
|
||||
<directoryMode>755</directoryMode>
|
||||
</dependencySet>
|
||||
<dependencySet>
|
||||
<includes>
|
||||
<include>org.springframework.boot:spring-boot-cli-grape:jar:*</include>
|
||||
</includes>
|
||||
<outputDirectory>internal</outputDirectory>
|
||||
<directoryMode>755</directoryMode>
|
||||
<scope>provided</scope>
|
||||
<unpack>true</unpack>
|
||||
</dependencySet>
|
||||
</dependencySets>
|
||||
</assembly>
|
||||
Reference in New Issue
Block a user