Add support for unpacking nested JARs
Update the executable JAR code to automatically unpack any entries which include an entry comment starting `UNPACK:` to the temp folder. The existing Maven and Gradle plugins have been updated with new configuration options and the `spring-boot-tools` project has been updated to write the appropriate entry comment based on a flag passed in via the `Library` class. This support has been added to allow libraries such a JRuby (which assumes that `jruby-complete.jar` is always accessible as file) to work with Spring Boot executable jars. Fixes gh-1070
This commit is contained in:
@@ -56,6 +56,8 @@ import org.springframework.boot.cli.jar.PackagedSpringApplicationLauncher;
|
||||
import org.springframework.boot.loader.tools.JarWriter;
|
||||
import org.springframework.boot.loader.tools.Layout;
|
||||
import org.springframework.boot.loader.tools.Layouts;
|
||||
import org.springframework.boot.loader.tools.Library;
|
||||
import org.springframework.boot.loader.tools.LibraryScope;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||
import org.springframework.util.Assert;
|
||||
@@ -248,7 +250,8 @@ public class JarCommand extends OptionParsingCommand {
|
||||
private void addDependency(JarWriter writer, File dependency)
|
||||
throws FileNotFoundException, IOException {
|
||||
if (dependency.isFile()) {
|
||||
writer.writeNestedLibrary("lib/", dependency);
|
||||
writer.writeNestedLibrary("lib/", new Library(dependency,
|
||||
LibraryScope.COMPILE));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user