首页 > 代码库 > maven拓展——eclipse中运行maven项目
maven拓展——eclipse中运行maven项目
首先,在pom.xml中配置插件:
<build> <plugins> <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <version>2.1</version> <configuration> <port>8080</port> <path>/ssm-crud</path> <uriEncoding>UTF-8</uriEncoding> <finalName>ssm-crud</finalName> <server>tomcat7</server> </configuration> </plugin> </plugins> </build>
在eclipse中配置maven插件(见另外一篇博客):
选择pom.xml文件——>右键——>选择 Run As——> Maven build ...
几个常用的maven命令:
命令 | 描述 |
tomcat:deploy | 部署一个web war包 |
tomcat:reload | 重新加载web war包 |
tomcat:start | 启动tomcat |
tomcat:stop | 停止tomcat |
tomcat:undeploy | 停止一个war包 |
tomcat:run | 启动嵌入式tomcat ,并运行当前项目 |
在这里要注意一下,该插件命名方式有些不同,比如启动tomcat ,对应的目标命令是: tomcat7:run ,同样,其它命令也是这样,需要更改为:tomcat7:<插件执行点>
//maven在网络不稳定时会产生一些奇怪的问题,解决方案是删掉重新下载!
maven拓展——eclipse中运行maven项目
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。