ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 51096] jar task, nested element "service" not merged
Date Thu, 21 Apr 2011 22:02:20 GMT

Jesse Glick <> changed:

           What    |Removed                     |Added
                 CC|                            |

--- Comment #3 from Jesse Glick <> 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:
------- You are receiving this mail because: -------
You are the assignee for the bug.

View raw message