ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Settle, William" <William.Set...@fnf.com>
Subject RE: Is there a way to update the Class-Path in a manifest?
Date Fri, 14 May 2004 17:04:27 GMT
Jan,

I appreciate the response but I don't want to replace, I want to append or prepend depending
on situation which requires reading the manifest Class-Path and appending to it.  Then it
could be replaced.  The manifest has to be read first.  Your procedure of unjar, replace,
jar does not take into account what was already in the manifest... it just overwrites it.

I'm still looking for a solution unless I'm just too blind to see ;>

Thanks,
Bill

-----Original Message-----
From: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de]
Sent: Friday, May 14, 2004 7:34 AM
To: user@ant.apache.org
Subject: RE: Is there a way to update the Class-Path in a manifest?


<unjar>
<replace> / <replaceregexp>
<jar>

Basically you are not aware of any manifest-specific thing.
You extract a text file, modify it and write it back.


Jan


> -----Original Message-----
> From: Settle, William [mailto:William.Settle@fnf.com]
> Sent: Friday, May 14, 2004 2:31 PM
> To: Ant Users List
> Subject: RE: Is there a way to update the Class-Path in a manifest?
> 
> 
> But how?  What is the ant task that will allow me to read the 
> existing manifest Class-Path so I can modify it?  My examples 
> show how to replace the Class-Path entry but I can't figure 
> out how to modify it using native ant tasks.  I can write a 
> custom task but that is not an option in this case.
>  
> Also, the script I'm writing has no knowledge about how the 
> Class-Path entry was created, it just needs to retrieve the 
> Class-Path entry, append a new jar to it and then update the original.
>  
> Thanks for the reply but still looking for an answer.
> 
> 	-----Original Message----- 
> 	From: Jan.Materne@rzf.fin-nrw.de 
> [mailto:Jan.Materne@rzf.fin-nrw.de] 
> 	Sent: Fri 5/14/2004 12:18 AM 
> 	To: user@ant.apache.org 
> 	Cc: 
> 	Subject: RE: Is there a way to update the Class-Path in 
> a manifest?
> 	
> 	
> 
> 	AFAIK there is "update"-way.
> 	Extract the manifest.mf, modify it and put it back into the jar.
> 	
> 	Jan
> 	
> 	
> 	> -----Original Message-----
> 	> From: Settle, William [mailto:William.Settle@fnf.com]
> 	> Sent: Thursday, May 13, 2004 5:36 PM
> 	> To: user@ant.apache.org
> 	> Subject: Is there a way to update the Class-Path in a 
> manifest?
> 	>
> 	>
> 	> Does anyone know how to update the Class-Path in an existing
> 	> JAR or Manifest file where I can add a JAR file to the
> 	> existing Class-Path attribute?
> 	> 
> 	> Lets assume the existing Class-Path attribute looks like this:
> 	>     Class-Path: mystuff.jar otherstuff.jar
> 	> 
> 	> And I want to add a new jar called new.jar.  I want the
> 	> attribute to be updated to look like:
> 	>     Class-Path: mystuff.jar otherstuff.jar new.jar
> 	> 
> 	> I don't care about order so it can be first, last or
> 	> somewhere in between.
> 	> 
> 	> I have tried:
> 	>         <ear destfile="${my.ear}" update="true">
> 	>             <manifest>
> 	>                 <attribute name="Class-Path" value="new.jar"/>
> 	>             </manifest>
> 	>         </ear>
> 	> 
> 	> But this just replaces the Class-Path attribute where I want
> 	> to append "new.jar" to the existing attribute.
> 	> 
> 	> I have tried:
> 	>         <manifest file="MANIFEST.MF" mode="update">
> 	>            <attribute name="Class-Path" value="new.jar"/>
> 	>         </manifest>
> 	>
> 	> And of course it just replaces the Class-Path as well.
> 	> 
> 	> Any ideas?  I would appreciate any help.
> 	> 
> 	> Thanks,
> 	> Bill
> 	>
> 	
> 
> 
Mime
View raw message