class ArtifactUtil {

	public static String getLatestVersion(String gav) throws IOException {
		checkNotNull(gav);

		var coordinate = ParsedCoordinate.fromCoordinate(gav);
		String url = MAVEN_HOST + "/maven2/" // Base URL
				+ coordinate.groupId.replaceAll("\\.", "/") + "/"// Group name
				+ coordinate.artifactId // Artifact name
				+ "/maven-metadata.xml";

		try (var in = new URL(url).openStream()) {
			return XPathFactory.newDefaultInstance().newXPath().evaluate("/metadata/versioning/latest",
					DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(in));
		} catch (XPathExpressionException | SAXException | ParserConfigurationException e) {
			throw new IOException(e);
		}
	}

	private  ArtifactUtil();

}