I am trying to get application's version and name/artifact-id from server at runtime for the plugin I am developing.
I know I can get the details from pom.properties that is generated on the server, using below code
java.io.InputStream inputStream = getServletContext().getResourceAsStream("/META-INF/maven/<application-directory-structure>/pom.properties");
Properties mavenProperties= new Properties();
mavenProperties.load(inputStream );
String version = (String) mavenProperties.get("version");
String name = (String) mavenProperties.get("artifactId");
But I am not able to reach to the pom.properties.
I tried using JarFile.getEntries()
but as I am not able to get the name of the war at runtime, its not working.
Any suggestions how I can get the details I am looking for?
I can't modify the maven plugin to get the artifact details. I am making a plugin myself and can't force all the apps for that.