File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -134,7 +134,8 @@ def add_gemjar(jar)
134134 def move_jars_to_webinf_lib ( jar , selector = nil )
135135 return unless selector # default is false
136136 selector = /.*/ if selector == true # move all if not a RegExp given
137- default_jars = default_jar_files . map { |file | File . basename ( file ) }
137+ default_jar_paths = default_jar_files
138+ default_jars = default_jar_paths . map { |file | File . basename ( file ) }
138139 jar . files . keys . select { |k | k =~ /^WEB-INF\/ .*\. jar$/ } . each do |k |
139140 if k . start_with? ( 'WEB-INF/lib/' ) # .jar already in WEB-INF/lib
140141 if default_jars . include? k . sub ( 'WEB-INF/lib/' , '' )
@@ -144,6 +145,8 @@ def move_jars_to_webinf_lib(jar, selector = nil)
144145 next
145146 end
146147 next unless selector =~ File . basename ( k )
148+ # default jars might end up mapped twice as they're part of gems
149+ next if default_jar_paths . include? ( jar . files [ k ] )
147150 name = k . sub ( 'WEB-INF' , '' ) [ 1 ..-1 ] . gsub ( /[\/ \\ ]/ , '-' )
148151 jar . files [ "WEB-INF/lib/#{ name } " ] = jar . files [ k ]
149152 jar . files [ k ] = empty_jar
You can’t perform that action at this time.
0 commit comments