# File lib/buildr/java/packaging.rb, line 495
        def update_classpath(component)
          package = file(component[:artifact].to_s)
          package.manifest = (package.manifest || {}).dup # avoid mofifying parent projects manifest
          package.prepare do
            header = case package.manifest
              when Hash then package.manifest
              when Array then package.manifest.first
            end
            if header
              # Determine which libraries are already included.
              class_path = header['Class-Path'].to_s.split
              included_libs = class_path.map { |fn| File.basename(fn) }
              included_libs += package.path('WEB-INF/lib').sources.map { |fn| File.basename(fn) }
              # Include all other libraries in the classpath.
              class_path += libs_classpath(component).reject { |path| included_libs.include?(File.basename(path)) }
              header['Class-Path'] = class_path.join(' ')
            end
          end
        end