一区二区三区在线-一区二区三区亚洲视频-一区二区三区亚洲-一区二区三区午夜-一区二区三区四区在线视频-一区二区三区四区在线免费观看

服務(wù)器之家:專注于服務(wù)器技術(shù)及軟件下載分享
分類導(dǎo)航

PHP教程|ASP.NET教程|Java教程|ASP教程|編程技術(shù)|正則表達(dá)式|C/C++|IOS|C#|Swift|Android|VB|R語(yǔ)言|JavaScript|易語(yǔ)言|vb.net|

服務(wù)器之家 - 編程語(yǔ)言 - Java教程 - IntelliJ IDEA使用maven實(shí)現(xiàn)tomcat的熱部署

IntelliJ IDEA使用maven實(shí)現(xiàn)tomcat的熱部署

2021-05-12 15:24豬腳踏浪 Java教程

這篇文章主要介紹了IntelliJ IDEA使用maven實(shí)現(xiàn)tomcat的熱部署,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧

tomcat的conf目錄 tomcat-users.xml配置以下內(nèi)容(<tomcat-users>標(biāo)簽內(nèi)</tomcat-users>),用于部署:

?
1
2
3
4
5
6
<role rolename="manager"/>   
<role rolename="manager-gui"/>   
<role rolename="admin"/>   
<role rolename="admin-gui"/>  
<role rolename="manager-script"/>  
<user username="tomcat" password="tomcat" roles="admin-gui,admin,manager-gui,manager,manager-script"/

啟動(dòng)tomcat,訪問(wèn) http:ip:8080/manager 驗(yàn)證tomcat用戶是否配置成功

IntelliJ IDEA使用maven實(shí)現(xiàn)tomcat的熱部署

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

?
1
2
3
4
5
6
7
8
9
10
11
<plugin>
  <groupid>org.apache.tomcat.maven</groupid>
  <artifactid>tomcat7-maven-plugin</artifactid>
  <configuration>
    <port>8080</port>
    <path>/mvc</path>
    <url>http://192.168.43.128:8080/manager/text</url>
    <username>tomcat</username>
    <password>tomcat</password>
  </configuration>
</plugin>

運(yùn)行配置

點(diǎn)擊run-->edit configurations

點(diǎn)擊+號(hào),選擇maven ,

輸入信息

name 給運(yùn)行配置取的名稱

working directory(工程目錄)

command line 命令 tomcat7:deploy 或 tomcat7:redeploy

IntelliJ IDEA使用maven實(shí)現(xiàn)tomcat的熱部署

點(diǎn)擊確定,保存。

在run菜單下找到剛做好的配置,運(yùn)行

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
[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

發(fā)布成功。

在tomcat的manager可以看到新發(fā)布的應(yīng)用。

IntelliJ IDEA使用maven實(shí)現(xiàn)tomcat的熱部署

方法2:

IntelliJ IDEA使用maven實(shí)現(xiàn)tomcat的熱部署

這幾個(gè)標(biāo)紅的菜單都能遠(yuǎn)程發(fā)布

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持服務(wù)器之家。

原文鏈接:https://blog.csdn.net/zsg88/article/details/58049206

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 日日摸日日添日日透 | 午夜理论片日本中文在线 | 邪恶肉肉全彩色无遮琉璃神社 | 我与么公激情性完整视频 | 精品亚洲视频在线观看 | 国产欧美一区二区三区久久 | 欧美亚洲国产精品久久第一页 | 国自产精品手机在线视频 | 天天做天天爰夜夜爽 | 色综合视频一区二区三区 | 四虎www | nxgx欧美 | 亚洲毛片网 | 国产乱子伦一区二区三区 | 国产精自产拍久久久久久 | 色聚网久久综合 | 欧美式禁忌| 无人区国产大片 | 国产99在线a视频 | 嗯啊视频在线观看 | chinesegay黑袜玩奴 | 被黑人同学彻底征服全文小说阅读 | 国产一区二区在线免费观看 | 视频在线观看入口一二三2021 | 特级淫片欧美高清视频蜜桃 | 国产高清免费在线 | 国产成人精品午夜视频' | 丝袜老师好湿好紧我要进去了 | 甜性涩爱| 亚洲123区| 亚洲视频999 | 亚洲国产精品热久久 | 毛茸茸的大逼 | 免费视频完整版在线观看网站 | 91影视永久福利免费观看 | 热久久天天拍天天拍热久久2018 | 精品亚洲综合久久中文字幕 | 1024免费永久福利视频 | 第一次做m被调教经历 | 潘金莲西门庆一级淫片aaaaaa | 精品一区二区三区免费站 |