VersionUtils { public static String getVersionFromPomProperties(Class clazz, String groupId, String artifactId) { final String classpathLocation = "META-INF/maven/" + groupId + "/" + artifactId + "/pom.properties"; final Properties pomProperties = PropertyFileConfigurationSource.getFromClasspath(classpathLocation, clazz.getClassLoader()); if (pomProperties != null) { return pomProperties.getProperty("version"); } return null; } private  VersionUtils(); static String getVersionFromPomProperties(Class clazz, String groupId, String artifactId); static Integer getMajorVersionFromPomProperties(Class clazz, String groupId, String artifactId); static Integer getMajorVersion(String version); static String getMavenCentralDownloadLink(String groupId, String artifactId, String version);  }
@Test public void getVersionFromPomProperties() throws Exception { assertThat(VersionUtils.getVersionFromPomProperties(ByteBuddy.class, BYTEBUDDY_GROUP, "byte-buddy")).matches(VERSION_PATTERN); }