I am using maven to build a java project. The java project has a pom file which contains the URL that I need to upload the build artifact to. I could use regex to extract the URL, however I'd like to know if there is a 'better' or more standard approach. Here is the top of my pom file. As you can see, there is a URL (example.com) that I want to extract.
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>ca.pensionsbc.services</groupId>
<artifactId>penc-utility-srv</artifactId>
<version>1.7.5</version>
<packaging>jar</packaging>
<name>penc-utility-srv</name>
<description>Utility Service</description>
<repositories>
<repository>
<id>nexus-public</id>
<url>https://example.com/path</url>
</repository>
</repositories>