From 2a7fedecc2b01d9e12ebe82d6fec2b95da3122eb Mon Sep 17 00:00:00 2001 From: qibaoguang Date: Tue, 14 Apr 2015 00:33:22 +0800 Subject: [PATCH] Update 73.4. Extract specific libraries when an executable jar runs.md --- ...cific libraries when an executable jar runs.md | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/IX. ‘How-to’ guides/73.4. Extract specific libraries when an executable jar runs.md b/IX. ‘How-to’ guides/73.4. Extract specific libraries when an executable jar runs.md index e69de29..06f0ec2 100644 --- a/IX. ‘How-to’ guides/73.4. Extract specific libraries when an executable jar runs.md +++ b/IX. ‘How-to’ guides/73.4. Extract specific libraries when an executable jar runs.md @@ -0,0 +1,29 @@ +### 73.4. 在可执行jar运行时提取特定的版本 + +在一个可执行jar中,为了运行,多数内嵌的库不需要拆包(unpacked),然而有一些库可能会遇到问题。例如,JRuby包含它自己的内嵌jar,它假定`jruby-complete.jar`本身总是能够直接作为文件访问的。 + +为了处理任何有问题的库,你可以标记那些特定的内嵌jars,让它们在可执行jar第一次运行时自动解压到一个临时文件夹中。例如,为了将JRuby标记为使用Maven插件拆包,你需要添加如下的配置: +```xml + + + + org.springframework.boot + spring-boot-maven-plugin + + + + org.jruby + jruby-complete + + + + + + +``` +使用Gradle完全上述操作: +```gradle +springBoot { + requiresUnpack = ['org.jruby:jruby-complete'] +} +```