pom.xml 文件。apache
<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.text.tomcat</groupId> <artifactId>TextTomCat</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</packaging> <build> <plugins> <!-- tomcat7 啓動所需jar包 --> <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.1</version> <configuration> <!--端口 --> <port>8800</port> <!--注意名稱 --> <path>/TextTomCat</path> <uriEncoding>UTF-8</uriEncoding> <!--注意此名字 啓動時會用到 --> <server>tomcat7</server> </configuration> </plugin> </plugins> </build> </project>
以上就完成了 maven 建立,接下來完成tomcat 啓動。
注意 啓動時爲:tomcat7:run 不要忘記 :
點擊Run tomcat啓動
tomcat 啓動日誌 tomcat