maven嵌入tomcat启动

 <plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <version>2.1</version>
                <configuration>
                    <port>9090</port>
                    <path>/mgr</path>
                    <uriEncoding>UTF-8</uriEncoding>
                    <finalName>mgr</finalName>
                    <server>tomcat7</server>
                </configuration>
            </plugin>


idea中配置tomcat启动

Command line 为

tomcat7:run


eclipse中配置启动

maven嵌入tomcat启动_第1张图片

就可以了


maven嵌入jetty的配置

<plugin>
    <groupId>org.mortbay.jetty</groupId>
    <artifactId>maven-jetty-plugin</artifactId>
    <version>6.1.5</version>
    <configuration>
        <webAppSourceDirectory>src/main/webapp</webAppSourceDirectory>
        <scanIntervalSeconds>3</scanIntervalSeconds>
        <contextPath>/</contextPath>
        <connectors>
            <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
                <port>8088</port>
            </connector>
        </connectors>
    </configuration>
</plugin>

jetty:run

或者

			<plugin>
				<groupId>org.eclipse.jetty</groupId>
				<artifactId>jetty-maven-plugin</artifactId>
				<configuration>
					<webApp>
						<contextPath>/dandan</contextPath>
					</webApp>
					<httpConnector>
						<port>9001</port>
					</httpConnector>
				</configuration>
			</plugin>


你可能感兴趣的:(maven,tomcat,jetty)