ANT: how to create a jar file including service provider configuration files in META-INF/services








According to ANT jar task, you can define your ant jar task like below (to write service provider configuration files in META-INF/services/):
<jar filesonly="true" destfile="${dist}/${ant.project.name}.jar">
    <manifest></manifest>
    <service type="javax.imageio.spi.ImageReaderSpi">
        <provider classname="my.image.My1ImageReaderSpi" />
        <provider classname="my.image.My2ImageReaderSpi" />
    </service>
    <service type="javax.imageio.spi.ImageWriterSpi">
        <provider classname="my.image.My1ImageWriterSpi" />
        <provider classname="my.image.My2ImageWriterSpi" />
    </service>
    <fileset dir="${build}" includes="**/*" />
</jar>



No comments:

Post a Comment