i have an xml file in which i need to find the parent version and replace with a new value.
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.test.proj</groupId>
<artifactId>proj-core</artifactId>
<version>1.1.0.0</version>
</parent>
<groupId>com.test.child</groupId>
<artifactId>sub-module</artifactId>
<version>2.20.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>test</name>
<description>test suite</description>
</project>
in the above xml, I am able to change the module version using mvn command, but unable to change the parent version using script. Is there any ways to grep and replace the value?
I tried to change using the python script
from xml.etree.ElementTree import ElementTree
print ElementTree(file="pom.xml").findtext("{http://maven.apache.org/POM/4.0.0}parent/version")
By default is is taking the snapshot version only.