You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Wayne T Richards <wa...@gmail.com> on 2008/02/22 05:40:33 UTC
Building a Jar for SPI application
I am having problems building my ant script to build my SPI jar file and
to create the MANIFEST.MF file. I have use the metainf directive to move
the SPI properties file to the META-INF/ directory. The problem that I
am getting into is the the SPI properties file should be located in the
META-INF/services directory. The task below shows what I am currently
doing (I hope).
<!-- Put everything in ${build} into the*.jar file -->
<jar
jarfile="${dist}/lib/${component.name}-${component.version}.jar"
basedir="${build}">
<include name="${build}"/>
<fileset dir="${build}" includes="**/*">
<include name="${build}/org/raven/**/*.class"/>
</fileset>
<fileset dir="${service.props}" includes="**/*">
<include name="${service.props}/services/**/*" />
</fileset>
<metainf
file="${service.props}/services/*.properties"></metainf>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<section name="${component.plainname}">
<attribute name="Sealed" value="false"/>
<attribute name="Specification-Title"
value="${component.name}" />
<attribute name="Specification-Version"
value="${component.version}" />
<attribute name="Specification-Vendor"
value="${component.vendor}" />
<attribute name="Implementation-Title"
value="${component.name}" />
<attribute name="Implementation-Version"
value="${component.version} ${TODAY}" />
<attribute name="Implementation-Vendor"
value="${component.vendor}" />
</section>
<attribute name="Class-Path"
value="${component.name}-${component.version}.jar" />
</manifest>
</jar>
</target>
I cannot figure out how to have ant to create the META-INF/services
directory and move the SPI properties file into that directory.
Any help would be greatly appreciated.
Wayne
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Building a Jar for SPI application
Posted by Peter Reilly <pe...@gmail.com>.
<service> does not work in ant 1.7.0 (due to a typeo error).
Easiest way to add services is simplly to create the service file
in the correct location:
src/jar-src/META-INF/services/com.example.apis.API
for example
<jar jarfile="x.jar">
<fileset dir="src/java-src"/>
</jar>
Peter
On Mon, Feb 25, 2008 at 6:27 AM, <Ja...@rzf.fin-nrw.de> wrote:
> <jar><service></jar> ?
>
> Jan
>
>
>
> > -----Ursprüngliche Nachricht-----
> > Von: Wayne T Richards [mailto:wayne.t.richards@gmail.com]
> > Gesendet: Freitag, 22. Februar 2008 05:41
> > An: user@ant.apache.org
> > Betreff: Building a Jar for SPI application
>
>
> >
> > I am having problems building my ant script to build my SPI
> > jar file and
> > to create the MANIFEST.MF file. I have use the metainf
> > directive to move
> > the SPI properties file to the META-INF/ directory. The
> > problem that I
> > am getting into is the the SPI properties file should be
> > located in the
> > META-INF/services directory. The task below shows what I am currently
> > doing (I hope).
> >
> > <!-- Put everything in ${build} into the*.jar file -->
> > <jar
> > jarfile="${dist}/lib/${component.name}-${component.version}.jar"
> > basedir="${build}">
> > <include name="${build}"/>
> > <fileset dir="${build}" includes="**/*">
> > <include name="${build}/org/raven/**/*.class"/>
> > </fileset>
> > <fileset dir="${service.props}" includes="**/*">
> > <include name="${service.props}/services/**/*" />
> > </fileset>
> > <metainf
> > file="${service.props}/services/*.properties"></metainf>
> > <manifest>
> > <attribute name="Built-By" value="${user.name}"/>
> > <section name="${component.plainname}">
> > <attribute name="Sealed" value="false"/>
> > <attribute name="Specification-Title"
> > value="${component.name}" />
> > <attribute name="Specification-Version"
> > value="${component.version}" />
> > <attribute name="Specification-Vendor"
> > value="${component.vendor}" />
> > <attribute name="Implementation-Title"
> > value="${component.name}" />
> > <attribute name="Implementation-Version"
> > value="${component.version} ${TODAY}" />
> > <attribute name="Implementation-Vendor"
> > value="${component.vendor}" />
> > </section>
> > <attribute name="Class-Path"
> > value="${component.name}-${component.version}.jar" />
> > </manifest>
> > </jar>
> > </target>
> >
> > I cannot figure out how to have ant to create the META-INF/services
> > directory and move the SPI properties file into that directory.
> > Any help would be greatly appreciated.
> > Wayne
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
AW: Building a Jar for SPI application
Posted by Ja...@rzf.fin-nrw.de.
<jar><service></jar> ?
Jan
> -----Ursprüngliche Nachricht-----
> Von: Wayne T Richards [mailto:wayne.t.richards@gmail.com]
> Gesendet: Freitag, 22. Februar 2008 05:41
> An: user@ant.apache.org
> Betreff: Building a Jar for SPI application
>
> I am having problems building my ant script to build my SPI
> jar file and
> to create the MANIFEST.MF file. I have use the metainf
> directive to move
> the SPI properties file to the META-INF/ directory. The
> problem that I
> am getting into is the the SPI properties file should be
> located in the
> META-INF/services directory. The task below shows what I am currently
> doing (I hope).
>
> <!-- Put everything in ${build} into the*.jar file -->
> <jar
> jarfile="${dist}/lib/${component.name}-${component.version}.jar"
> basedir="${build}">
> <include name="${build}"/>
> <fileset dir="${build}" includes="**/*">
> <include name="${build}/org/raven/**/*.class"/>
> </fileset>
> <fileset dir="${service.props}" includes="**/*">
> <include name="${service.props}/services/**/*" />
> </fileset>
> <metainf
> file="${service.props}/services/*.properties"></metainf>
> <manifest>
> <attribute name="Built-By" value="${user.name}"/>
> <section name="${component.plainname}">
> <attribute name="Sealed" value="false"/>
> <attribute name="Specification-Title"
> value="${component.name}" />
> <attribute name="Specification-Version"
> value="${component.version}" />
> <attribute name="Specification-Vendor"
> value="${component.vendor}" />
> <attribute name="Implementation-Title"
> value="${component.name}" />
> <attribute name="Implementation-Version"
> value="${component.version} ${TODAY}" />
> <attribute name="Implementation-Vendor"
> value="${component.vendor}" />
> </section>
> <attribute name="Class-Path"
> value="${component.name}-${component.version}.jar" />
> </manifest>
> </jar>
> </target>
>
> I cannot figure out how to have ant to create the META-INF/services
> directory and move the SPI properties file into that directory.
> Any help would be greatly appreciated.
> Wayne
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org