ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 51096] jar task, nested element "service" not merged
Date Thu, 21 Apr 2011 22:02:20 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=51096

Jesse Glick <jglick@netbeans.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jglick@netbeans.org

--- Comment #3 from Jesse Glick <jglick@netbeans.org> 2011-04-21 18:02:18 EDT ---
(In reply to comment #1)
> Since the zip format does permit same-named entries, are you sure that C.jar
> isn't still capable of providing multiple service provider implementations
> despite these actually being represented in different jar entries?

sun.misc.URLClassPath.JarLoader.getResource can only return one resource, since
it is using JarFile.getJarEntry. Iterating all entries would be inefficient,
and there is no method in JarFile to get multiple entries with the same name.

Probably there is some way to write the script to concatenate
META-INF/services/* entries from its inputs, but it does not sound easy. Maybe
use a custom task - either a subclass of Zip which overrides zipFile and knows
how to merge these entries, or set duplicate=add and then run a separate task
to merge entries in the result.

In general it would be nice to have a helper type ResourceMerger, which you
could pass to <zip>, <copy>, etc.; one impl could simply concatenate the
incoming resources, but custom impls could perform more complex merges.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Mime
View raw message