im looking for a structured method in JAVA to retrieve value from tag in pom.xml then set a new value to this same tag and save it back to the same pom.xml .
for example i like to get the value of : parent.version and change it to 1.3.33 and save it to the same pom.xml
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.foo</groupId>
<artifactId>test1</artifactId>
<version>1.2.1</version>
</parent>
<groupId>com.foo.s.xxx</groupId>
<artifactId>xx-xx</artifactId>
<version>1.1.1</version>
<name>xxx</name>
<packaging>pom</packaging>
<properties>
<ww.version>1.1.3</ww.version>
</properties>
currently i do it in very naive way :
File pomFile = new File(pomxml);
String content = FileUtils.readFileToString(pomFile);
content = content.replaceAll(oldVersion, newVersion);