【发布时间】:2014-09-19 08:50:00
【问题描述】:
我有一个 maven 项目,我想使用 apache tomcat7 进行调试。以下是我的 pom.xml 的内容。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<overlays>
<overlay>
<groupId>org.apache.manifoldcf</groupId>
<artifactId>mcf-crawler-ui</artifactId>
<type>war</type>
<includes>
<include>*.jsp</include>
<include>*.css</include>
<include>*.png</include>
</includes>
<targetPath>/</targetPath>
</overlay>
<overlay>
<groupId>org.apache.manifoldcf</groupId>
<artifactId>mcf-crawler-ui</artifactId>
<type>war</type>
<includes>
<include>WEB-INF/jsp/*</include>
</includes>
<targetPath>/</targetPath>
</overlay>
</overlays>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<server>mytomcatserver</server>
<path>/mcf-combined-service</path>
<tomcatConfigurationFilesDirectory>/Servers/mytomcatserver-config</tomcatConfigurationFilesDirectory>
<url>http://localhost:8080/manager/text</url>
<username>admin</username>
<password>admin</password>
<!-- <goal>deploy</goal>
<goal>run</goal> -->
</configuration>
</plugin>
</plugins>
我在eclipse中创建了一个tomcat服务器,名称为mytomcatserver,并让它使用安装目录。我还在 .m2/settings.xml 中指定了这个 tomcat 服务器。 当我在 maven build 中运行 tomcat7:deploy 时,它会将 war 部署到指定的 tomcat 实例,然后我可以从浏览器访问 Web 应用程序。 但我想调试 Web 应用程序,因此当我说 tomcat7:run in maven build 时,它会在目标目录中创建单独的 tomcat 安装,并尝试将 tomcat 部署到无法部署 war 文件的那个安装。
提前致谢。
【问题讨论】:
标签: maven tomcat maven-tomcat-plugin