You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Karr, David" <da...@wamu.net> on 2005/10/27 19:17:08 UTC

Update manifest in jar with additional attribute

I have a need to build a target that updates the manifest of a jar file
with an additional attribute (perhaps replace if it's already present).
If I use a jar task, with 'update="true"' and an inline manifest element
containing the property I want to add, and no files specified, what is
it likely to do?  Would this do exactly what I want, or would it replace
the entire manifest, or replace the jar with no files, or something
else?

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


Re: Update manifest in jar with additional attribute

Posted by Antoine Levy-Lambert <an...@gmx.de>.
Karr, David wrote:

>I have a need to build a target that updates the manifest of a jar file
>with an additional attribute (perhaps replace if it's already present).
>If I use a jar task, with 'update="true"' and an inline manifest element
>containing the property I want to add, and no files specified, what is
>it likely to do?  Would this do exactly what I want, or would it replace
>the entire manifest, or replace the jar with no files, or something
>else?
>
>  
>
Hello David,

the inline manifest will do a full replace, so you will end up with only
the property that you specified in your build file.
I do not think that there is direct support in ant to update a manifest.

The semantics of jar update="true" are to add or replace any entries in
the filesets/zipfilesets nested in the jar element,
which are newer than corresponding entries in the preexisting jar file,
or which were not in the jar file previously.

In Ant 1.6, it also removes the entries which are in the preexisting jar
file, but which are not listed in the nested filesets or zipfilesets.

This will change in Ant 1.7.

Cheers,

Antoine

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


Re: Update manifest in jar with additional attribute

Posted by Rhino <rh...@sympatico.ca>.
Why not give it a try yourself? You'll probably get the answer more quickly
than waiting for the handful of people who have actually done what you
describe; you'll likely learn a few unexpected things along the way, too.

I've always found that it was better for me to answer a question via my own
experiments if they weren't too complicated to set up. Your question doesn't
sound like it would be difficult to set up.

Rhino

----- Original Message ----- 
From: "Karr, David" <da...@wamu.net>
To: "Ant Users List" <us...@ant.apache.org>
Sent: Thursday, October 27, 2005 1:17 PM
Subject: Update manifest in jar with additional attribute


I have a need to build a target that updates the manifest of a jar file
with an additional attribute (perhaps replace if it's already present).
If I use a jar task, with 'update="true"' and an inline manifest element
containing the property I want to add, and no files specified, what is
it likely to do?  Would this do exactly what I want, or would it replace
the entire manifest, or replace the jar with no files, or something
else?

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


-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.361 / Virus Database: 267.12.5/150 - Release Date: 27/10/2005




-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.361 / Virus Database: 267.12.5/150 - Release Date: 27/10/2005


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