设计本官方网站广告,源码买卖网站,公众号开发公司排行榜,seo博客写作针对eclipse中的Run on Server有些情况下并不是那么好操作#xff0c;比如配置maven下的springmvc插件#xff0c;如果使用此方法运行会很容易出现组件缺少导致错误出现一大堆的问题。 那么针对这种情况#xff0c;maven下的容器插件tomcat和jetty做了很好的支持。比如在mav…针对eclipse中的Run on Server有些情况下并不是那么好操作比如配置maven下的springmvc插件如果使用此方法运行会很容易出现组件缺少导致错误出现一大堆的问题。 那么针对这种情况maven下的容器插件tomcat和jetty做了很好的支持。比如在maven下配置了这两个组件 project xmlnshttp://maven.apache.org/POM/4.0.0 xmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd...buildfinalNametestmvchelloworld/finalNameplugins!-- Config: Maven Tomcat Plugin --!-- http://mvnrepository.com/artifact/org.apache.tomcat.maven/tomcat7-maven-plugin --!-- http://tomcat.apache.org/maven-plugin-2.0/tomcat7-maven-plugin/plugin-info.html --plugingroupIdorg.apache.tomcat.maven/groupIdartifactIdtomcat7-maven-plugin/artifactIdversion2.2/version!-- Config: contextPath and Port (Default:8080) --!-- configuration path//path port8899/port /configuration--/plugin!-- Config: Maven Jetty Plugin --!-- http://mvnrepository.com/artifact/org.mortbay.jetty/jetty-maven-plugin --!-- http://www.eclipse.org/jetty/documentation/current/jetty-maven-plugin.html --plugingroupIdorg.eclipse.jetty/groupIdartifactIdjetty-maven-plugin/artifactIdversion9.4.3.v20170317/version!-- Config: contextPath and Port (Default:8080) --!-- configurationhttpConnectorport8899/port/httpConnectorwebAppConfigcontextPath//contextPath/webAppConfig/configuration--/plugin/plugins/build
/project 提示如果想要带上引用名可以在contextPath标签上加上/${project.artifactId} 那么在调试运行项目时可以直接使用maven的命令直接进行 //tomcat7
mvn tomcat7:run
//jetty
mvn jetty:run 其中控制台上输出的信息和本身Run on Server保持了一致。转载于:https://www.cnblogs.com/EasonJim/p/6687272.html