Run Tomcat and deploy project with own server.xml

前端 未结 3 1322
忘掉有多难
忘掉有多难 2020-12-06 11:10

I just want to run a web project that has been configured in a maven project with the pom.xml. It uses the maven tomcat7-maven-plugin to deploy the web app artifact and all

3条回答
  •  一生所求
    2020-12-06 12:16

    The tomcat7-maven-plugin documentation says for :

    server.xml to use Note if you use this you must configure in this file your webapp paths.

    I think this means that you have to insert a element with the path of your war inside the element, like so:

    
        
    
    

    Where "webapp" is my generated war name. Apparently, appBase is relative to target/tomcat (and "webapps" seems to be the default value). docBase is relative to appBase so for simplicity I used the relative path to the build directory.

    This is working for me, and without that element I get a white page.

    If you are using filtering you can probably replace docBase by a property. However take care to exclude the server.xml (and tomcat-users.xml) from your war file!

提交回复
热议问题