pom.xml snippet:
<modelVersion>4.0.0</modelVersion>
<groupId>com.xyz</groupId>
<artifactId>xyzservice</artifactId>
<version>2.2.2-SNAPSHOT</version>
<packaging>war</packaging>
result file: xyzservice-2.2.2-SNAPSHOT.war
I copied the war file to webapps directory, renamed it to: xyzservice.war
. Then after extraction by Tomcat, this code:
AImpl.class.getResource("/abc/d.pdf").getFile();
gave me: /usr/local/tomcat-8.0.36-8082/webapps/xyzservice-2.2.2-SNAPSHOT/WEB-INF/classes/abc/d.pdf
but I am expecting /usr/local/tomcat-8.0.36-8082/webapps/xyzservice/WEB-INF/classes/abc/d.pdf
without version information. Can anyone explain to me what went wrong & how to fix? Thanks in advance.