码迷,mamicode.com
首页 > 系统相关 > 详细

maven拓展——eclipse中运行maven项目

时间:2017-06-27 00:03:12      阅读:291      评论:0      收藏:0      [点我收藏+]

标签:build   width   配置   描述   apache   mave   pid   技术   class   

首先,在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项目

标签:build   width   配置   描述   apache   mave   pid   技术   class   

原文地址:http://www.cnblogs.com/jiangbei/p/7082868.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!