我是maven的新手,我想使用maven tomcat插件运行我的web应用程序,我已经创建了maven项目并在pom.xml中添加了对tomcat的依赖。我试图运行构建项目,每次它停止在tomcat启动的中间。
我的pom.xml:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.pratik.spring</groupId>
<artifactId>TestingProj</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>TestingProj Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>TestingProj</finalName>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<!-- Config: contextPath and Port (Default - /SimpleMavenWebApp : 8080) -->
<!--<configuration>
<path>/</path>
<port>8899</port>
</configuration>-->
</plugin>
</plugins>
</build>
</project>
控制台消息是
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building TestingProj Maven Webapp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> tomcat-maven-plugin:1.1:run (default-cli) > compile @ TestingProj >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ TestingProj ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ TestingProj ---
[INFO] No sources to compile
[INFO]
[INFO] <<< tomcat-maven-plugin:1.1:run (default-cli) < compile @ TestingProj <<<
[INFO]
[INFO] --- tomcat-maven-plugin:1.1:run (default-cli) @ TestingProj ---
[INFO] Running war on http://localhost:8080/TestingProj
[INFO] Using existing Tomcat server configuration at D:\seleniumRM\TestingProj\target\tomcat
Oct 06, 2016 4:28:56 AM org.apache.catalina.startup.Embedded start
INFO: Starting tomcat server
Oct 06, 2016 4:28:57 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.29
Oct 06, 2016 4:28:58 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Oct 06, 2016 4:28:58 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080e