ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject RE: Is there a way to update the Class-Path in a manifest?
Date Mon, 17 May 2004 07:10:21 GMT
search="Class-Path: (.*)"
replace="$1;${newValues}"

The trick is the group '()' and the backreference '$1'.
Maybe you have to play with the flags (gms).

Jan


> -----Original Message-----
> From: Settle, William [mailto:William.Settle@fnf.com]
> Sent: Friday, May 14, 2004 8:19 PM
> To: Ant Users List
> Subject: RE: Is there a way to update the Class-Path in a manifest?
> 
> 
> Jan mentioned the replaceregexp task but from reading the 
> doc, it looks like it allows me to use a regular expression 
> to search for a string but it looks like it still just does a 
> replace on the string it finds.  I don't see a way to append 
> to an existing string in a file.  Hum... perplexing.  I just 
> have to think that ant has something native that will do this.
> 
> Just a note about why I'm wanting this.  We have yet another 
> services oriented architecture (yasoa) where I create an 
> unconfigured ear file using ant.  I want to provide our 
> customers (internal applications) with an ant script that 
> allows them to plop their services jars and dependencies, 
> resource and configuration files in a known directory 
> structure, then script will blow the ear apart as well as the 
> internal ejb jars and wars then repackage specifically for 
> their environment.  Everything is easy with ant except for 
> updating the manifest information in the ear, jars and wars.  
> What I am currently doing is writing out the manifest 
> classpath information for each archive to a property file 
> that goes along with the configure/deploy script.  The script 
> uses that information and adds the additional customer 
> specific jars and resources to it then updates the manifest 
> for each archive.  Not a lot of extra work but it is ugly.  
> It just seems unnecessary if ant provides a mechanism to do 
> it.  I don't want the end user (deployer) to have to add 
> custom tasks to his build environment, hence wanting a native 
> ant way to perform the task.
> 
> Thanks,
> Bill
> 
> -----Original Message-----
> From: Matt Benson [mailto:gudnabrsam@yahoo.com]
> Sent: Friday, May 14, 2004 12:14 PM
> To: Ant Users List
> Subject: RE: Is there a way to update the Class-Path in a manifest?
> 
> 
> What if you <unjar> and use a replaceregexp and/or
> other filters to append to the file, then update with
> the resulting manifest?
> 
> -Matt
> 
> --- "Settle, William" <William.Settle@fnf.com> wrote:
> > 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
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message