You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by jh...@netscape.net on 2010/01/18 13:45:19 UTC

split version

I have pom.xml, below is snippet of my pom.xml file:
pom.xml
-------
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.xkri.kill.tokens</groupId>
  <artifactId>tokens-active-dent</artifactId>
  <version>7.5.02.02</version> 
  <!-- default packaging -->
  <packaging>jar</packaging>
  <name>Colt and ADAM</name>
  <description>This package provides the ${name}</description>
  :
  :
  :
 </project>

 I want to pick the version from node
 <version>7.5.02.02</version>
 and replace it to another config.xml:
 config.xml
 ----------
 <?xml version="1.0" encoding="UTF-8"?>
<installationTaskConfiguration xmlns="http://www.colt.com"
                               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                               xsi:schemaLocation="http://www.colt.com InstallationTaskConfiguration.xsd">
                               
  <registryVersion product="" releaseVersion="7" majorVersion="5" minorVersion="02"/>
  <productFeature id="tokens-active-dent"
        parent="base-dent"
                    state="INSTALLING"
                    requiredDiskSpaceMode="default"
                    rebootRequiredOnInstall="false"
                    rebootRequiredOnUninstall="false"
                    rebootRequiredOnUpgrade="false"
                    backupOnUpgrade="false">
      <version product="" releaseVersion="7" majorVersion="5" minorVersion="02" subMinorVersion="SNAPSHOT"/>
      <requiredDiskSpaceMap>
        <requiredDiskSpace id="default" size="1MB"/>
        <requiredDiskSpace id="backup" size="0MB"/>
        <requiredDiskSpace id="temporary" size="0MB"/>
      </requiredDiskSpaceMap>
    </productFeature>
    :
    :
    :
 </installationTaskConfiguration>

 in config.xml file I want to reaplce in this format:
 <version product="" releaseVersion="7" majorVersion="5" minorVersion="02" subMinorVersion="02"/>
 can anyone give me an idea on how to copy and repace in above mentioned format? Also soe sit possible in ANT?





AW: split version

Posted by Ja...@rzf.fin-nrw.de.
You could try <replaceregexp/> or the external task XmlTask
http://ant.apache.org/external.html#XmlTask

Jan 

>-----Ursprüngliche Nachricht-----
>Von: jhoomsharabi@netscape.net [mailto:jhoomsharabi@netscape.net] 
>Gesendet: Montag, 18. Januar 2010 13:45
>An: user@ant.apache.org
>Betreff: split version 
>
>
>I have pom.xml, below is snippet of my pom.xml file:
>pom.xml
>-------
><?xml version="1.0" encoding="UTF-8"?>
><project xmlns="http://maven.apache.org/POM/4.0.0" 
>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
>xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
>http://maven.apache.org/maven-v4_0_0.xsd">
>  <modelVersion>4.0.0</modelVersion>
>  <groupId>com.xkri.kill.tokens</groupId>
>  <artifactId>tokens-active-dent</artifactId>
>  <version>7.5.02.02</version> 
>  <!-- default packaging -->
>  <packaging>jar</packaging>
>  <name>Colt and ADAM</name>
>  <description>This package provides the ${name}</description>
>  :
>  :
>  :
> </project>
>
> I want to pick the version from node
> <version>7.5.02.02</version>
> and replace it to another config.xml:
> config.xml
> ----------
> <?xml version="1.0" encoding="UTF-8"?>
><installationTaskConfiguration xmlns="http://www.colt.com"
>                               
>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>                               
>xsi:schemaLocation="http://www.colt.com 
>InstallationTaskConfiguration.xsd">
>                               
>  <registryVersion product="" releaseVersion="7" 
>majorVersion="5" minorVersion="02"/>
>  <productFeature id="tokens-active-dent"
>        parent="base-dent"
>                    state="INSTALLING"
>                    requiredDiskSpaceMode="default"
>                    rebootRequiredOnInstall="false"
>                    rebootRequiredOnUninstall="false"
>                    rebootRequiredOnUpgrade="false"
>                    backupOnUpgrade="false">
>      <version product="" releaseVersion="7" majorVersion="5" 
>minorVersion="02" subMinorVersion="SNAPSHOT"/>
>      <requiredDiskSpaceMap>
>        <requiredDiskSpace id="default" size="1MB"/>
>        <requiredDiskSpace id="backup" size="0MB"/>
>        <requiredDiskSpace id="temporary" size="0MB"/>
>      </requiredDiskSpaceMap>
>    </productFeature>
>    :
>    :
>    :
> </installationTaskConfiguration>
>
> in config.xml file I want to reaplce in this format:
> <version product="" releaseVersion="7" majorVersion="5" 
>minorVersion="02" subMinorVersion="02"/>
> can anyone give me an idea on how to copy and repace in above 
>mentioned format? Also soe sit possible in ANT?
>
>
>
>
>

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