pom.xml的
tomcat7-maven-plugin依赖于Tomcat的捆绑。Maven下载它们,然后该插件使用Web项目启动嵌入式Tomcat实例。
mvn -X tomcat7:run打印配置。一些有趣的部分:
[INFO] Preparing tomcat7:run[DEBUG] (s) resources = [Resource {targetPath: null, filtering: false, FileSet {directory: /workspace/webtest1/src/main/resources, PatternSet [includes: {}, excludes: {}]}}]...[DEBUG] (f) additionalConfigFilesDir = /workspace/webtest1/src/main/tomcatconf[DEBUG] (f) configurationDir = /workspace/webtest1/target/tomcat...[DEBUG] (f) path = /webtest1...[DEBUG] (f) port = 8080[DEBUG] (f) project = ...:webtest1:0.0.1-SNAPSHOT @ /workspace/webtest1/pom.xml...[DEBUG] (f) warSourceDirectory = /workspace/webtest1/src/main/webapp...[INFO] Creating Tomcat server configuration at /workspace/webtest1/target/tomcat...[DEBUG] adding classPathElementFile file:/workspace/webtest1/target/classes/[DEBUG] add dependency to webapploader org.slf4j:slf4j-api:1.5.6:compile...warSourceDirectory指向
src(not
target),因此它可以像通常的动态Web项目一样运行,您可以更改JSP,HTML并立即看到它。因此,该
target/tomcat/webapps文件夹为空。
v2.0站点比2.0-SNAPSHOT站点包含有关配置的更详细的文档:http : //mojo.prehaus.org/tomcat-maven-
plugin/plugin-info.html。



