Bug 43028 - jar task's <service> element generates incorrect directory name
Summary: jar task's <service> element generates incorrect directory name
Status: RESOLVED DUPLICATE of bug 41201
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.7.0
Hardware: Macintosh Mac OS X 10.4
: P2 normal (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-03 19:56 UTC by Amy Fowler
Modified: 2008-02-22 12:18 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Amy Fowler 2007-08-03 19:56:02 UTC
I'm using the <service> element in the jar task to generate the appropriate
files to load a service via Java6's java.util.ServiceLoader.

The jar task is incorrectly generating the directory as "service" when it should
be "services", and thus the service loading fails.

I believe the error could easily be fixed in org/apache/tools/ant/taskdefs;

     private void writeServices(ZipOutputStream zOut) throws IOException {
        Iterator serviceIterator;
        Service service;

        serviceIterator = serviceList.iterator();
        while (serviceIterator.hasNext()) {
           service = (Service) serviceIterator.next();
           //stolen from writeManifest
           super.zipFile(service.getAsStream(), zOut,
                         "META-INF/service/" + service.getType(), //should be
"services"
                         System.currentTimeMillis(), null,
                         ZipFileSet.DEFAULT_FILE_MODE);
        }
    }
Comment 1 Matt Benson 2007-08-03 20:13:18 UTC

*** This bug has been marked as a duplicate of 41201 ***