You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Bala Paranj <bp...@yahoo.com> on 2006/07/17 23:06:58 UTC

Manifest doesn't support the "file" attribute

I am using the following ant section to generate the manifest file so that I can run the program
by using the generated jar file. 

	<target name="compress" description="Compression target" depends="compile">
		
		<jar destfile="${output}/MyClient.jar" basedir="${output}">
			<include name="**/*.*" />
			
			<manifest file="${output}/MANIFEST.MF">
				<attribute name="Built-By" value="${user.name}" />
				<attribute name="Built-On" value="${timestamp.isoformat}" />
				<attribute name="Main-Class" value="com.swing.client.MainFrame" />
				<attribute name="Build" value="${build.number}" />
				<attribute name="Date" value="${TODAY}" />
			</manifest>
		</jar>
	</target>
I am getting the following error message when I run the ant script.

C:\Java\AntBuildProject\ Class org.apache.tools.ant.taskdefs.Manifest doesn't support the "file"
attribute.

How can I fix this? TIA.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Manifest doesn't support the "file" attribute

Posted by Robert Clark <ro...@quest.com>.
On Monday July 17, 2006 17:06, Bala Paranj <bp...@yahoo.com> wrote:
> I am using the following ant section to generate the manifest file
> so that I can run the program by using the generated jar file.
>
> 	<target name="compress" description="Compression target"
> depends="compile">
>
> 		<jar destfile="${output}/MyClient.jar" basedir="${output}">
> 			<include name="**/*.*" />
>
> 			<manifest file="${output}/MANIFEST.MF">

[snip]

> I am getting the following error message when I run the ant script.
>
> C:\Java\AntBuildProject\ Class
> org.apache.tools.ant.taskdefs.Manifest doesn't support the "file"
> attribute.
>
> How can I fix this? TIA.

Delete the file attribute, you don't need it.

When the manifest task is used as a nested element of the Jar task, 
the "file" and "mode" attributes must be removed as the location and 
name of a manifest file in a jar file is fixed and cannot be changed, 
so you don't need to specify the output location.

- Rob

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Manifest doesn't support the "file" attribute

Posted by Matt Benson <gu...@yahoo.com>.
--- Bala Paranj <bp...@yahoo.com> wrote:

> I am using the following ant section to generate the
> manifest file so that I can run the program
> by using the generated jar file. 
> 
> 	<target name="compress" description="Compression
> target" depends="compile">
> 		
> 		<jar destfile="${output}/MyClient.jar"
> basedir="${output}">
> 			<include name="**/*.*" />
> 			
> 			<manifest file="${output}/MANIFEST.MF">
> 				<attribute name="Built-By" value="${user.name}"
> />
> 				<attribute name="Built-On"
> value="${timestamp.isoformat}" />
> 				<attribute name="Main-Class"
> value="com.swing.client.MainFrame" />
> 				<attribute name="Build" value="${build.number}"
> />
> 				<attribute name="Date" value="${TODAY}" />
> 			</manifest>
> 		</jar>
> 	</target>
> I am getting the following error message when I run
> the ant script.
> 
> C:\Java\AntBuildProject\ Class
> org.apache.tools.ant.taskdefs.Manifest doesn't
> support the "file"
> attribute.
> 
> How can I fix this? TIA.

According to the manual:

"The manifest nested element allows the manifest for
the Jar file to be provided inline in the build file
rather than in an external file. This element is
identical to the manifest task, but the file and mode
attributes must be omitted."

-Matt

> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org