手记

maven自带tomcat插件

方法一

        <plugin>            <groupId>org.codehaus.mojo</groupId>            <artifactId>tomcat-maven-plugin</artifactId>            <version>1.1</version>            <configuration>                <path>/appname</path>                <port>9090</port>                <uriEncoding>UTF-8</uriEncoding>                <url>http://localhost:9090/manager/html</url>                <server>tomcat6</server>            </configuration>        </plugin>

方法二

        <plugin>            <groupId>org.apache.tomcat.maven</groupId>            <artifactId>tomcat7-maven-plugin</artifactId>            <version>2.2</version>            <configuration>                <port>8090</port>                <path>/</path>            </configuration>        </plugin>

指定端口运行

mvn clean -Dmaven.tomcat.port=8181 tomcat:run

0人推荐
随时随地看视频
慕课网APP