IntelliJ deploying webapp.xml twice
I am dealing with an issue where I have a specified portal.xml in my TOMCAT_HOME/conf/catalina/localhost directory. When I run the app in IntelliJ, portal.xml is correctly pulled into C:/users/xxx/.intellij/system/tomcat/webapps/portal/conf/catalina/localhost. However, once that artifact deploys, the portal.xml in C:/users/xxx/.intellij/system/tomcat/webapps/portal/conf/catalina/localhost is renamed to portal.xml.0 and a different, incorrect portal.xml is generated. Is there some way to make sure the incorrect portal.xml does not get generated?
Good portal.xml:
<?xml version="1.0" encoding="utf-8"?>
<Context path="/portal" docBase="C:[TOMCAT_HOME]portal" reloadable="true" crossContext="true">
<Manager className="org.apache.catalina.session.StandardManager" pathname=""/>
</Context>
bad portal.xml
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/portal" docBase="C:[TOMCAT_HOME]portal" />
Please sign in to leave a comment.
When you configure custom context and custom context descriptor please make that
1) context xml file name corresponds to the web app context path, if you need the context path to be 'my_app', you should specify '/my_app' as the value of the 'Application context' field on the Deployment tab of the run configuration -- then IDEA will create my_app.xml file on deploy.
2) if you need for the context xml file to have custom content, you should add 'Tomcat context descriptor' via the 'Web' facet in Project structure, then fill in the created context xml file under META-INF of the module.
No need to place it under "conf/catalina/localhost".