@@ -43,9 +43,18 @@ def is?(application)
4343 # @param [Droplet] droplet the droplet to search
4444 # @return [String] the lib directory of Spring Boot used by the application
4545 def lib ( droplet )
46- return boot_inf_lib_dir ( droplet ) if boot_inf_lib_dir ( droplet ) . exist?
47- return web_inf_lib_dir ( droplet ) if web_inf_lib_dir ( droplet ) . exist?
48- return lib_dir ( droplet ) if lib_dir ( droplet ) . exist?
46+ candidate = manifest_lib_dir ( droplet )
47+ return candidate if candidate && candidate . exist?
48+
49+ candidate = boot_inf_lib_dir ( droplet )
50+ return candidate if candidate && candidate . exist?
51+
52+ candidate = web_inf_lib_dir ( droplet )
53+ return candidate if candidate && candidate . exist?
54+
55+ candidate = lib_dir ( droplet )
56+ return candidate if candidate && candidate . exist?
57+
4958 fail ( 'No lib directory found' )
5059 end
5160
@@ -60,14 +69,21 @@ def version(application)
6069
6170 private
6271
72+ SPRING_BOOT_LIB = 'Spring-Boot-Lib' . freeze
73+
6374 SPRING_BOOT_VERSION = 'Spring-Boot-Version' . freeze
6475
65- private_constant :SPRING_BOOT_VERSION
76+ private_constant :SPRING_BOOT_LIB , : SPRING_BOOT_VERSION
6677
6778 def boot_inf_lib_dir ( droplet )
6879 droplet . root + 'BOOT-INF/lib'
6980 end
7081
82+ def manifest_lib_dir ( droplet )
83+ value = JavaBuildpack ::Util ::JavaMainUtils . manifest ( droplet ) [ SPRING_BOOT_LIB ]
84+ value ? droplet . root + value : nil
85+ end
86+
7187 def lib_dir ( droplet )
7288 droplet . root + 'lib'
7389 end
0 commit comments