Maven配置覆盖内嵌tomcat虚拟映射路径
解决方案
下载tomcat7-maven-plugin-2.2.jar.zip 文件,解压并覆盖本地仓库中的tomcat7-maven-plugin-2.2.jar
, 比如我的本地仓库在:D:\M2REPO\org\apache\tomcat\maven\tomcat7-maven-plugin\2.2
下,那么我们只需要解压并此目录下的 tomcat7-maven-plugin-2.2.jar
覆盖此文件就ok.
pom.xml
配置
< plugins>
< plugin>
< groupId> org.apache.maven.plugins</ groupId>
< artifactId> maven-compiler-plugin</ artifactId>
< version> 2.3.2</ version>
< configuration>
< source> 1.7</ source>
< target> 1.7</ target>
< encoding> UTF-8</ encoding>
</ configuration>
</ plugin>
< plugin>
< groupId> org.apache.tomcat.maven</ groupId>
< artifactId> tomcat7-maven-plugin</ artifactId>
< version> 2.2</ version>
< configuration>
< update> true</ update>
< port> 8080</ port>
< uriEncoding> UTF-8</ uriEncoding>
< server> tomcat7</ server>
< staticContextPath> /store</ staticContextPath>
< staticContextDocbase> d:/file/store/</ staticContextDocbase>
< contextReloadable> false</ contextReloadable>
< useTestClasspath> true</ useTestClasspath>
</ configuration>
</ plugin>
</ plugins>