Reputation: 7106
I have a web application (WAR) that I want to deploy in Tomcat 5. I'm using Maven 3 and the problem is that when I deploy the WAR, Tomcat automatically copies the context.xml file located in META-INF directory. The file is then renamed with the WAR name and the context path of the application will be the WAR name. By default, it is artifactId-version.war.
The problem is that some client code uses the context path to connect to the web application and I don't want to change the code each time a new version of the web application is deployed. Is there a way to set the context path to another fixed value?
I can't use the tomcat plugin for now. Setting the Context path in the context.xml doesn't help. Also, tomcat documentation precises that it's not recommended to set the Context path in the server.xml. Also, I don't want to change the WAR name, it's important for me to always keep track of the artifact version.
Thanks
Upvotes: 3
Views: 5355
Reputation: 6499
You should use the ${project.build.finalName} parameter in your war plugin config so that you can ensure that the war never changes names.
Upvotes: 2