网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

怎么在IDEA中使用maven实现tomcat热部署

本篇文章给大家分享的是有关怎么在IDEA中使用maven实现tomcat热部署,小编觉得挺实用的,因此分享给大家学习,希望大家阅读完这篇文章后可以有所收获,话不多说,跟着小编一起来看看吧。

创新互联专注为客户提供全方位的互联网综合服务,包含不限于网站制作、成都做网站、万安网络推广、微信小程序、万安网络营销、万安企业策划、万安品牌公关、搜索引擎seo、人物专访、企业宣传片、企业代运营等,从售前售中售后,我们都将竭诚为您服务,您的肯定,是我们最大的嘉奖;创新互联为所有大学生创业者提供万安建站搭建服务,24小时服务热线:18980820575,官方网址:www.cdcxhl.com

在tomcat的conf目录 tomcat-users.xml配置以下内容(标签内),用于部署:

    
    
    
   
   

启动tomcat,访问 http:ip:8080/manager 验证tomcat用户是否配置成功

怎么在IDEA中使用maven实现tomcat热部署

在maven工程的pom.xml中配置插件

  
        org.apache.tomcat.maven
        tomcat7-maven-plugin
        
          8080
          /mvc
          http://192.168.43.128:8080/manager/text
          tomcat
          tomcat
        
      

运行配置

点击Run-->Edit Configurations

点击+号,选择Maven ,

输入信息

Name 给运行配置取的名称

Working directory(工程目录)

Command line 命令 tomcat7:deploy 或 tomcat7:redeploy

怎么在IDEA中使用maven实现tomcat热部署

点击确定,保存。

在Run菜单下找到刚做好的配置,运行

[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for org.jstudioframework:jstudio-mvc:war:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.tomcat.maven:tomcat7-maven-plugin is missing. @ line 91, column 21
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO]                                     
[INFO] ------------------------------------------------------------------------
[INFO] Building jstudio-mvc 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> tomcat7-maven-plugin:2.2:redeploy (default-cli) @ jstudio-mvc >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ jstudio-mvc ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 5 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ jstudio-mvc ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ jstudio-mvc ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory E:\JstudioProject1\JstudioMvc\src\test\resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ jstudio-mvc ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.14:test (default-test) @ jstudio-mvc ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-war-plugin:2.1.1:war (default-war) @ jstudio-mvc ---
[INFO] Packaging webapp
[INFO] Assembling webapp [jstudio-mvc] in [E:\JstudioProject1\JstudioMvc\target\jstudio-mvc-1.0-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources [E:\JstudioProject1\JstudioMvc\src\main\webapp]
[INFO] Webapp assembled in [177 msecs]
[INFO] Building war: E:\JstudioProject1\JstudioMvc\target\jstudio-mvc-1.0-SNAPSHOT.war
[WARNING] Warning: selected war files include a WEB-INF/web.xml which will be ignored 
(webxml attribute is missing from war task, or ignoreWebxml attribute is specified as 'true')
[INFO] 
[INFO] <<< tomcat7-maven-plugin:2.2:redeploy (default-cli) @ jstudio-mvc <<<
[INFO] 
[INFO] --- tomcat7-maven-plugin:2.2:redeploy (default-cli) @ jstudio-mvc ---
[INFO] Deploying war to http://192.168.43.128:8080/mvc 
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Uploading: http://192.168.43.128:8080/manager/text/deploy?path=%2Fmvc&update=true
Uploaded: http://192.168.43.128:8080/manager/text/deploy?path=%2Fmvc&update=true (7445 KB at 7083.3 KB/sec)
[INFO] tomcatManager status code:200, ReasonPhrase:OK
[INFO] OK - Deployed application at context path /mvc
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.720s
[INFO] Finished at: Sun Jul 23 19:35:01 CST 2017
[INFO] Final Memory: 15M/322M
[INFO] ------------------------------------------------------------------------
Process finished with exit code 0

发布成功。

在tomcat的manager可以看到新发布的应用。

怎么在IDEA中使用maven实现tomcat热部署

方法2:

怎么在IDEA中使用maven实现tomcat热部署

以上就是怎么在IDEA中使用maven实现tomcat热部署,小编相信有部分知识点可能是我们日常工作会见到或用到的。希望你能通过这篇文章学到更多知识。更多详情敬请关注创新互联行业资讯频道。


网页名称:怎么在IDEA中使用maven实现tomcat热部署
网页路径:http://bjjierui.cn/article/gdiiip.html

其他资讯