You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Nau, Michael" <Mi...@cardinal.com> on 2006/10/31 03:28:45 UTC

Accessing the manifest within a jar file

Anyone know of an easy way to access the manifest file within a jar
file? I realize I can extract the manifest first using the <unjar> task,
but I was hoping for a way to directly access the manifest file.

I need to check for some specific info within the manifest of several
jar files from my ant script.

Thanks,
-Mike



_________________________________________________

This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.

Dansk - Deutsch - Espanol - Francais - Italiano - Japanese - Nederlands - Norsk - Portuguese - Svenska: www.cardinalhealth.com/legal/email

Re: Accessing the manifest within a jar file

Posted by Dominique Devienne <dd...@gmail.com>.
> I do not know the jarlib tasks.
> What are they ?

Optional tasks already in Ant and the manual. I think Conor may have
added them, but I could be wrong. --DD

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


Re: Accessing the manifest within a jar file

Posted by Antoine Levy-Lambert <an...@gmx.de>.
Hello Dominique,

I do not know the jarlib tasks.

What are they ?

Antoine
-------- Original-Nachricht --------
Datum: Tue, 31 Oct 2006 07:46:49 -0600
Von: "Dominique Devienne" <dd...@gmail.com>
An: "Ant Users List" <us...@ant.apache.org>
Betreff: Re: Accessing the manifest within a jar file

> > Actually, I am interested by the same sort of topic, for instance to
> > collect Vendor/Version/Name information from a set of jar files and
> > generate a report from this.
> 
> There are the optional jarlib-* tasks already, although their focus
> might be just optional extensions. Maybe these can be built on? --DD
> 

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


Re: Accessing the manifest within a jar file

Posted by Dominique Devienne <dd...@gmail.com>.
> Actually, I am interested by the same sort of topic, for instance to
> collect Vendor/Version/Name information from a set of jar files and
> generate a report from this.

There are the optional jarlib-* tasks already, although their focus
might be just optional extensions. Maybe these can be built on? --DD

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


Re: Accessing the manifest within a jar file

Posted by Matt Benson <gu...@yahoo.com>.
--- "Ivan \"Rambius\" Ivanov"
<ra...@yahoo.com> wrote:

> Hello,
> 
> You can also use Ant 1.7 zipentry resource:
> 
> <zipentry zipfile="my.jar"
>    name="META-INF/MANIFEST.MF"/>


Thanks for the resource plug, Ivan.  :) 
Alternatively, assuming ${jar} points to the relevant
jar file, you could use

<url url="jar:file:///${jar}!/META-INF/MANIFEST.MF" />

or

<javaresource name="META-INF/MANIFEST.MF"
classpath="${jar}" />

;)

Note that the <url>-based solution requires that the
${jar} property be an absolute path (not sure of the
rules regarding file: urls and relative paths). 
Finally, I don't know if it's good or bad that there
are three resource-based ways to access a manifest,
but it's interesting, anyway.

-Matt

> 
> Regards
> Ivan
> 
> --- Antoine Levy-Lambert <an...@gmx.de> wrote:
> 
> > Hello Michael,
> > 
> > this is an interesting question.
> > 
> > I would write my own custom Ant task . You can use
> > java.util.jar.JarFile
> > and java.util.jar.Manifest to access whathever
> > information you want.
> > 
> > Actually, I am interested by the same sort of
> topic,
> > for instance to
> > collect Vendor/Version/Name information from a set
> > of jar files and
> > generate a report from this.
> > 
> > Regards,
> > 
> > Antoine
> > 
> > Nau, Michael wrote:
> > > Anyone know of an easy way to access the
> manifest
> > file within a jar
> > > file? I realize I can extract the manifest first
> > using the <unjar> task,
> > > but I was hoping for a way to directly access
> the
> > manifest file.
> > >
> > > I need to check for some specific info within
> the
> > manifest of several
> > > jar files from my ant script.
> > >
> > > Thanks,
> > > -Mike
> > >
> > >
> > >
> > >   
> > 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > user-unsubscribe@ant.apache.org
> > For additional commands, e-mail:
> > user-help@ant.apache.org
> > 
> > 
> 
> 
> 
>  
>
____________________________________________________________________________________
> Want to start your own business? Learn how on Yahoo!
> Small Business 
> (http://smallbusiness.yahoo.com) 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 



 
__________________________________________________________________________________________
Check out the New Yahoo! Mail - Fire up a more powerful email and get things done faster. 
(http://advision.webevents.yahoo.com/mailbeta) 


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


Re: Accessing the manifest within a jar file

Posted by "Ivan \"Rambius\" Ivanov" <ra...@yahoo.com>.
Hello,

You can also use Ant 1.7 zipentry resource:

<zipentry zipfile="my.jar"
   name="META-INF/MANIFEST.MF"/>

Regards
Ivan

--- Antoine Levy-Lambert <an...@gmx.de> wrote:

> Hello Michael,
> 
> this is an interesting question.
> 
> I would write my own custom Ant task . You can use
> java.util.jar.JarFile
> and java.util.jar.Manifest to access whathever
> information you want.
> 
> Actually, I am interested by the same sort of topic,
> for instance to
> collect Vendor/Version/Name information from a set
> of jar files and
> generate a report from this.
> 
> Regards,
> 
> Antoine
> 
> Nau, Michael wrote:
> > Anyone know of an easy way to access the manifest
> file within a jar
> > file? I realize I can extract the manifest first
> using the <unjar> task,
> > but I was hoping for a way to directly access the
> manifest file.
> >
> > I need to check for some specific info within the
> manifest of several
> > jar files from my ant script.
> >
> > Thanks,
> > -Mike
> >
> >
> >
> >   
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 



 
____________________________________________________________________________________
Want to start your own business? Learn how on Yahoo! Small Business 
(http://smallbusiness.yahoo.com) 


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


Re: Accessing the manifest within a jar file

Posted by Antoine Levy-Lambert <an...@gmx.de>.
Hello Michael,

this is an interesting question.

I would write my own custom Ant task . You can use java.util.jar.JarFile
and java.util.jar.Manifest to access whathever information you want.

Actually, I am interested by the same sort of topic, for instance to
collect Vendor/Version/Name information from a set of jar files and
generate a report from this.

Regards,

Antoine

Nau, Michael wrote:
> Anyone know of an easy way to access the manifest file within a jar
> file? I realize I can extract the manifest first using the <unjar> task,
> but I was hoping for a way to directly access the manifest file.
>
> I need to check for some specific info within the manifest of several
> jar files from my ant script.
>
> Thanks,
> -Mike
>
>
>
>   


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


RE: Accessing the manifest within a jar file

Posted by "Rebhan, Gilbert" <Gi...@huk-coburg.de>.
Hi, Mike


there's also another manifest reader task you may
look at =

http://www.codeproject.com/useritems/ManifestReader.asp

my task is much simpler, but enough for me
 
Regards, Gilbert

-----Original Message-----
From: Rebhan, Gilbert [mailto:Gilbert.Rebhan@huk-coburg.de] 
Sent: Tuesday, October 31, 2006 8:28 AM
To: Ant Users List
Subject: RE: Accessing the manifest within a jar file


Hi, Mike

i've written a ManifestScanner task that scans the manifest
of jar's in 1 - n filesets for a given key=value pair and writes
all matches in a separated list.

If you're interested, just let me know, please mail to =

ant@schillbaer.de

Regards,
Gilbert
 

-----Original Message-----
From: Nau, Michael [mailto:Michael.Nau@cardinal.com] 
Sent: Tuesday, October 31, 2006 3:29 AM
To: user@ant.apache.org
Subject: Accessing the manifest within a jar file

Anyone know of an easy way to access the manifest file within a jar
file? I realize I can extract the manifest first using the <unjar> task,
but I was hoping for a way to directly access the manifest file.

I need to check for some specific info within the manifest of several
jar files from my ant script.

Thanks,
-Mike

---------------------------------------------------------------------
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


RE: Accessing the manifest within a jar file

Posted by "Rebhan, Gilbert" <Gi...@huk-coburg.de>.
Hi, Mike

i've written a ManifestScanner task that scans the manifest
of jar's in 1 - n filesets for a given key=value pair and writes
all matches in a separated list.

If you're interested, just let me know, please mail to =

ant@schillbaer.de

Regards,
Gilbert
 

-----Original Message-----
From: Nau, Michael [mailto:Michael.Nau@cardinal.com] 
Sent: Tuesday, October 31, 2006 3:29 AM
To: user@ant.apache.org
Subject: Accessing the manifest within a jar file

Anyone know of an easy way to access the manifest file within a jar
file? I realize I can extract the manifest first using the <unjar> task,
but I was hoping for a way to directly access the manifest file.

I need to check for some specific info within the manifest of several
jar files from my ant script.

Thanks,
-Mike

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