There is /META-INF/context.xml with this content.

<?xml version="1.0" encoding="UTF-8"?> <Context antiJARLocking="true" path="/battleship"/> 

I deploy applications like this: mvn tomcat7: deploy. As a result, a WAR file with the name Battleship-Web.war appears in the folder with the webapps applications. But the application does not start at localhost: 8080 / battleship, it starts at the URL localhost: 8080 / Battleship-Web - i.e. by file name. Guide on Tomkata context read

Here is what I did:

  • deleted files from conf / Catalina / localhost. There was rubbish from past projects (I don’t know where it came from)
  • in the server.xml file put autoDeploy = "false"
  • in the server.xml file I added the attribute deployOnStartup = "false" to the Host element. In this case, the application application generally ceased to occur, the maven gave an error. Removed this attribute.

How can I get Tomkat to see /META-INF/context.xml file of my applications?

  • And if override = "true" add? - serg.nechaev
  • This problem was relevant in April. today is june. I'm afraid I already forgot what the nonsense was - arg

1 answer 1

If you read the guide on Tomkata context, you should have seen the text there

This attribute must be used when statically defining a context in server.xml. It can be inferred from the context file or the docBase.

Because If you do not register it in server.xml , then nothing should work.

I can offer to set the path for deployment in pom.xml, an example is here https://tomcat.apache.org/maven-plugin-trunk/tomcat7-maven-plugin/usage.html