ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <>
Subject Re: Ant Jar doubt
Date Tue, 12 Apr 2005 12:17:13 GMT
Raja Nagendra Kumar wrote:
> Hi,
> Thanks for the reply. My reply in-line
> ----- Original Message ----- 
> From: "Steve Loughran" <>
> To: "Ant Developers List" <>
> Sent: Tuesday, April 12, 2005 4:41 PM
> Subject: Re: Ant Jar doubt
>>Raja Nagendra Kumar wrote:
>>>When ever we jar I see in the manifest 'Ant-Version: Apache Ant 1.6.2'
> this
>>>line. Could any one tell me how to avoid this.
>>I dont know if there is a way to do this (yet)
> Is there any custom tasks written by any one which could be used for this
> purpose.

no, but it isnt needed,

>>>in manifest. My observation here is sqence is altered.
>>I dont believe that code should depend on the order; its part of the
>>manifest specification. We'd only be encouraging bad practices if enabled.
> This is because, my client (J2ME Game publisher) is asking for this order..

Well, they -or the telephone provider- are not using the specification 

"The order of individual manifest entries is not significant."

If it is their code, their code is broken. If it is a particular phone. 
I'd like to know which one. Is it a motorola phone?

> Any case why should the oder be manipulated by the jar command. Why does it
> not take the things in way it has been provided ..

Because there are lots of things the task does with manifest fixup, such 
as correcting over-long lines using the official wrapping rules, and 
other aspects of the manifest specification. We intermittently get 
complaints about the ant code not understanding how to wrap lines or 
otherwise set up JAR files, but you have to remember: Ant probably 
creates the majority of the JAR files on the planet for production 
applications. We follow the specs to the letter, and have to be strict.

Also, re-ordering entries stops people writing code which makes 
assumptions about manifest entry order. Clearly, someone downstream from 
you has done exactly that, which is why you are suffering. But  we don't 
do it deliberatetly, it's probably just hashTable at work.

If you don't want Ant to do your manifest

1. write it by hand
2. use the <zip> task to create the JAR
3. import the manifest at META-INF/

That's all. no need for custom tasks.  I'd recommend you use <manifest> 
to create a stub manifest that you patch by hand. That reduces the 
likelihood of the manifest being wrong.

There are some extra ant tasks for j2me listed on our external task list:

The antic one looks like it does special J2ME stuff.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message