Maven tomcat插件部署时修改docBase的方法

Tomcat自身可以通过修改配置文件server.xml,在之间插入如下语句:


对应maven的tomcat插件弄法如下:

                org.apache.tomcat.maven
                tomcat7-maven-plugin
                2.2
               
                    /xxxx

                    <warSourceDirectory>${project.build.directory}/${project.build.finalName}

                      .....................

                      .....................

参考:


http://tomcat.apache.org/maven-plugin-2.2/tomcat7-maven-plugin/deploy-mojo.html


汇总:

使用tomcat通用的maven编译启动选项,配置中模块名称全部引用前面的maven模块配置

 
   
     
        org.apache.tomcat.maven
        tomcat7-maven-plugin
        2.2
       
          localhost
          8099
          /${project.artifactId}
          UTF-8
          ${project.artifactId}
          tomcat7
          ${project.build.directory}/${project.build.finalName}
       

     


     
        maven-assembly-plugin
        2.3
       
          ${project.artifactId}-${project.version}
         
            src/main/assembly/dist.xml
         

       

       
         
            make-assembly
            package
           
              single
           

         

       

     


     
        org.apache.maven.plugins
        maven-compiler-plugin
        3.1
       
          1.7
          1.7
       

     

     
        org.apache.maven.plugins
        maven-surefire-plugin
       
          true
       

     


     
        org.apache.maven.plugins
        maven-war-plugin
       
          false
       

     

    ${project.artifactId}-${project.version}
 

  war

Tomcat的四种web应用部署方式详解

你可能感兴趣的:(Java,Web,Maven,B/S,MVC,框架搭建问题汇总)