My .war file is created with a version in it. For example: myproject-1.0.0-SNAPSHOT.war
For next version it would be second version : myproject-2.0.0-SNAPSHOT.war
and so on.
Now if I deploy to tomcat the path would change with every new version as Tomcat just takes the filename as the context path.
Of course this is not acceptable as the path should be fixed.
So I already tried to create a context.xml file in META-INF folder and set path there , but did not help.
What else could I do ?
You can include a context version in your war's file name by using "##" as delimiter, see https://tomcat.apache.org/tomcat-9.0-doc/config/context.html#Naming
It will be stripped on deployment, leaving you with the same context path as before.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With