Maven构建:Tomcat服务器无法启动

时间:2014-07-21 06:06:17

标签: java eclipse maven tomcat

我是Maven的新手,并尝试使用Maven设置一个Web项目。我在Eclipse中设置了项目,我使用的是Tomcat 7.0.53。在Maven构建的运行配置中,我在tomcat:run中设置了Goals
当我运行此配置时,可以在Eclipse控制台中看到以下日志:

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Chat sample using the Spring MVC Servlet-based async support 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> tomcat-maven-plugin:1.1:run (default-cli) > compile @ spring-mvc-chat >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ spring-mvc-chat ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ spring-mvc-chat ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] <<< tomcat-maven-plugin:1.1:run (default-cli) < compile @ spring-mvc-chat <<<
[INFO] 
[INFO] --- tomcat-maven-plugin:1.1:run (default-cli) @ spring-mvc-chat ---
[INFO] Running war on http://localhost:8080/spring-mvc-chat
[INFO] Using existing Tomcat server configuration at D:\Workspace\spring-mvc-chat-master\target\tomcat
Jul 21, 2014 11:26:44 AM org.apache.catalina.startup.Embedded start
INFO: Starting tomcat server
Jul 21, 2014 11:26:45 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.29
Jul 21, 2014 11:26:45 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Jul 21, 2014 11:26:45 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080

此后没有任何事情发生。没有服务器启动信息,因此项目根本无法运行。 在这里错过任何一步吗?或者这是正确的行为?

1 个答案:

答案 0 :(得分:7)

对于Tomcat 7,请使用mvn tomcat7:run参考:Maven Tomcat 7