bug: jar task with nested service does not create META-INF/services

View: New views
3 Messages — Rating Filter:   Alert me  

bug: jar task with nested service does not create META-INF/services

by Robert Koberg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I am trying to use the nested service element in the jar class. It
produces a META-INF/service rather than META-INF/services:


    /**
     * Write SPI Information to JAR
     */
    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(),
                         System.currentTimeMillis(), null,
                         ZipFileSet.DEFAULT_FILE_MODE);
        }
    }

Bug?

best,
-Rob




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


Re: bug: jar task with nested service does not create META-INF/services

by Peter Reilly-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks,
this has already been noticed and a fix will be in ant 1.7.1.

In the meantime, the <service> nested element should not be used.

Peter


On Wed, Feb 27, 2008 at 3:12 PM, Robert Koberg <rob@...> wrote:

> Hi,
>
>  I am trying to use the nested service element in the jar class. It
>  produces a META-INF/service rather than META-INF/services:
>
>
>     /**
>      * Write SPI Information to JAR
>      */
>     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(),
>                          System.currentTimeMillis(), null,
>                          ZipFileSet.DEFAULT_FILE_MODE);
>         }
>     }
>
>  Bug?
>
>  best,
>  -Rob
>
>
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: dev-unsubscribe@...
>  For additional commands, e-mail: dev-help@...
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...


OT: META-INF/services - was Re: bug: jar task with nested service does not create META-INF/services

by Robert Koberg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

OK, sounds good.

And apologies for this OT response, but what do you guys think of using
this? I just found out about it and really like it, but have only read a
few articles. Any pros or cons? Perhaps it is a nice, clean way for Ant
to go?

best,
-Rob


On Wed, 2008-02-27 at 15:15 +0000, Peter Reilly wrote:

> Thanks,
> this has already been noticed and a fix will be in ant 1.7.1.
>
> In the meantime, the <service> nested element should not be used.
>
> Peter
>
>
> On Wed, Feb 27, 2008 at 3:12 PM, Robert Koberg <rob@...> wrote:
> > Hi,
> >
> >  I am trying to use the nested service element in the jar class. It
> >  produces a META-INF/service rather than META-INF/services:
> >
> >
> >     /**
> >      * Write SPI Information to JAR
> >      */
> >     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(),
> >                          System.currentTimeMillis(), null,
> >                          ZipFileSet.DEFAULT_FILE_MODE);
> >         }
> >     }
> >
> >  Bug?
> >
> >  best,
> >  -Rob
> >
> >
> >
> >
> >  ---------------------------------------------------------------------
> >  To unsubscribe, e-mail: dev-unsubscribe@...
> >  For additional commands, e-mail: dev-help@...
> >
> >


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@...
For additional commands, e-mail: dev-help@...