Tomcat:
http://tomcat.apache.org/maven-plugin-2.1/
pom.xml
settings.xml
jetty: http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin
pom.xml
部署方式
1. 参考 http://www.cnblogs.com/fnng/archive/2011/12/16/2290587.html
2. 点击工具条的小虫子,然后选择Debug config(调试配置), 或者点击项目右键,Debug as(调试方式)-->选择Debug config(调试配置),选择Maven Build, 然后点右上角创建一个配置,在Goals输入:jetty:run, 这里可以使用多个命令,比如:clean jetty:run。然后点击debug(调试),开始以Debug方式运行工程。下次运行的时候,不用配置,右键或者点工具栏那里的debug,会多出刚才的这个配置,然后直接运行。
3.使用server(服务器) of eclipse的方式运行。参考: http://blog.youkuaiyun.com/laoshuisheng/article/details/6420003
注意:第2种方式,在包含多Module的时候,很难对代码进行调试,这种情况最好使用的3种。
pom.xml
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat6-maven-plugin</artifactId>
<version>2.1</version>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
</plugin>
</plugins>
</pluginManagement>
settings.xml
<pluginGroups>
....
<pluginGroup>org.apache.tomcat.maven</pluginGroup>
....
</pluginGroups> 命令:
tomcat:run
jetty: http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin
pom.xml
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.10</version>
<configuration>
<stopPort>9966</stopPort>
<stopKey>foo</stopKey>
</configuration>
</plugin> 或者
<plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>maven-jetty-plugin</artifactId> <version>6.1.20</version> <configuration> <contextPath>/jbpm5</contextPath> <!--<webDefaultXml>webdefault.xml</webDefaultXml> --> <scanIntervalSeconds>0</scanIntervalSeconds> <scanTargetPatterns> <scanTargetPattern> <directory>src/main/webapp/WEB-INF</directory> <excludes> <exclude>**/*.jsp</exclude> </excludes> <includes> <include>**/*.properties</include> <include>**/*.xml</include> </includes> </scanTargetPattern> </scanTargetPatterns> </configuration> </plugin>setting.xml
<profile>
...
<pluginGroups>
<pluginGroup>org.mortbay.jetty</pluginGroup>
</pluginGroups>
</profile> 命令:
jetty:run
部署方式
1. 参考 http://www.cnblogs.com/fnng/archive/2011/12/16/2290587.html
2. 点击工具条的小虫子,然后选择Debug config(调试配置), 或者点击项目右键,Debug as(调试方式)-->选择Debug config(调试配置),选择Maven Build, 然后点右上角创建一个配置,在Goals输入:jetty:run, 这里可以使用多个命令,比如:clean jetty:run。然后点击debug(调试),开始以Debug方式运行工程。下次运行的时候,不用配置,右键或者点工具栏那里的debug,会多出刚才的这个配置,然后直接运行。
3.使用server(服务器) of eclipse的方式运行。参考: http://blog.youkuaiyun.com/laoshuisheng/article/details/6420003
注意:第2种方式,在包含多Module的时候,很难对代码进行调试,这种情况最好使用的3种。
本文详细介绍了如何在Maven项目中使用Tomcat和Jetty插件进行应用程序部署与调试,包括配置文件设置、命令使用及多模块项目的调试注意事项。
510

被折叠的 条评论
为什么被折叠?



