This need may seem a little confusing, and if so, I am open to suggestions regarding best implementation practices. My problem is as follows. I have a WAR web application that is contained in an EAR. Everything was stunned. From inside my webapp, I am trying to show artifact ids and ear and war version numbers.
War is a fairly simple case. I can use simple maven filtering to enter the required artifactId / versionId file into the war as it is created. However, the ear is harder.
I know that there is META-INF / maven /// pom.properties that I can look at in the ear, which contains this information, but I do not see access to it.
I tried (from inside the jsp page) the following without success (all with and without lead /); all calls return null:
getClass().getClassLoader().getResource( "/META-INF/maven/<group>/<artifact>/pom.properties"); getClass().getClassLoader().getResourceAsStream( "/META-INF/maven/<group>/<artifact>/pom.properties");
Is this possible with a class loader? Or does it depend on the configuration of the class loader? Is there a better way to get this information?
I am currently running tests on JBoss, but the final deployment will be in WebSphere. However, ideally, I would like the solution to be server-independent.
Thanks!
Eric
source share