What is currently the best and secure way to extract a certain text using jenkins in a pom.xml file. I have read many articles mentioning not to use readMavenPom because it's already depreciated. I would like to extract item in groupId, artifactId, version and name.
<groupId>**LoveMyGroup**</groupId>
<artifactId>**portal**</artifactId>
<version>**0.0.1-SNAPSHOT**</version>
<packaging>war</packaging>
<name>**My first Project**</name>
<description>My first Project ever</description>
<properties>
<java.version>1.8</java.version>
</properties>