测试管理,自动化测试、手机客户端测试、wap站点测试研究

eclipse下实现maven项目在tomcat容器热部署方法

上一篇 / 下一篇  2013-02-18 12:12:05 / 个人分类:敏捷开发与持续交互

eclipse下实现maven项目在tomcat容器热部署方法51Testing软件测试网.s/g;{ t^s1YMVv

黄进青2013-2-17

;SwP&If2wn0


}5R:j:U1\^2M051Testing软件测试网 yG pn4`U

1eclipse安装maven插件、svn插件

*q*E0\}l`E0

2、从svn检查maven结构web项目(可部署到tomcat下)51Testing软件测试网 K6[1On}j

3、修改远程或本地的tomcat配置文件apache-tomcat-6.0.29/conf/tomcat-users.xml,添加用户,如下所示:51Testing软件测试网l5L A L#Y

<role rolename="manager"/>

'N?"~a9I ^,r(h0

<user username="admin" password="admin" roles="manager"/>

y y/c'TB s0

4、修改mavensettings.xml,增加server,如下所示:51Testing软件测试网t+TX`O0MCky,]

<server>

/s,ahv Fe"Y^J0

<id>tomcat</id>51Testing软件测试网a`%Et)I&d

<username>admin</username>51Testing软件测试网;E2wPTg9b

<password>admin</password>

T3?tH9S%A0

</server>

E JXTL;Pl0

5、启动tomcat(进入http://localhost:8080/manager/html页面大家可以管理tomcat下的所有应用)51Testing软件测试网FCO-E'[0`

6、修改pom.xml文件,引入tomcat插件,以实现热部署,如下所示:

。。。51Testing软件测试网c'C2tZy8hs

<plugin>51Testing软件测试网tZ |:G!E"CxZ

<groupId>org.codehaus.mojo</groupId>

:tZ2P.}"@'x0d;S0

<artifactId>tomcat-maven-plugin</artifactId>

lm3I])u(UIYk0

<configuration>51Testing软件测试网^'hH]z,rZ F"k

<url>http://localhost:8080/manager/html</url>

L9pm L#UD0

<server>tomcat</server>51Testing软件测试网cK{.?4uT,G Tn

<path>/wallet</path>51Testing软件测试网6X"N2_"Z:i

</configuration>

*D}T!vuKN.F0

<version>1.1</version>51Testing软件测试网 o f as6v:rg&JX

</plugin>

.J,m7m{1U*jkL0

51Testing软件测试网p"|q$[A'h!A%Mn3m
51Testing软件测试网*Tv'_(Y^

。。。51Testing软件测试网XFpX2j

7、在eclipse中配置maven build,内容如下:clean tomcat:redeploy -Dmaven.test.skip=true,可参考附图

-M;iQ7T9O?z E l0

51Testing软件测试网$g(S{d0e-yh$q&V.D
51Testing软件测试网5A#Al$zh S `

8、执行maven build后的结果如下所示:51Testing软件测试网sc}J c7cJ,f)b@ h{v

。。。。。

y$U;H zx0

51Testing软件测试网t0NG:}8C:s

K)IFj S2S0

[INFO] Building 0.0.1-SNAPSHOT

VuD T \7`/V0

[INFO] ------------------------------------------------------------------------51Testing软件测试网*R3l$T5Q6le

[INFO]

d |\;Dr/cI"N0

[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ wallet ---

9j [:R)jb,| fM0

[INFO] Deleting /Users/junqinghuang/Documents/workspace/ewallet/target51Testing软件测试网*F3k{jC+["G

[INFO]

'_[3D%y;I8IY&K3m&i$n0

[INFO] >>> tomcat-maven-plugin:1.1:redeploy (default-cli) @ wallet >>>51Testing软件测试网|;t%_Id

[WARNING] The POM for apache-httpclient:commons-httpclient:jar:3.1 is missing, no dependency information available

V9s7Cd"j"[UY#Z R lY0

[INFO]

OIISIC0

[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ wallet ---

^uuFRC*v.X0

[WARNING] Using platform. encoding (EUC_CN actually) to copy filtered resources, i.e. build is platform. dependent!51Testing软件测试网h7\sXDy/o

[INFO] Copying 9 resources

t#pS&l.Wl(M1lvE\$Y0

[INFO]

k ~rf c?8W0

[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ wallet ---

c2[*M;F n7Lo P4U0

[INFO] Compiling 198 source files to /Users/junqinghuang/Documents/workspace/ewallet/target/classes

'D'TU T$P2^\0

[INFO]51Testing软件测试网TLD Tw

[INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @ wallet ---

8K'y Nn8E:o'V0

[WARNING] Using platform. encoding (EUC_CN actually) to copy filtered resources, i.e. build is platform. dependent!

:t$Apg#x uqCwT0

[INFO] skip non existing resourceDirectory /Users/junqinghuang/Documents/workspace/ewallet/src/test/resource

OFQe{a*E2M0

[INFO]

C!Zqj)C!`SA;I}2T&Q0

[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ wallet ---51Testing软件测试网 LtFB[ L9MBmp

[INFO] Not compiling test sources51Testing软件测试网"FP:F@5T _ eA*o

[INFO]

W&fv1M+F$^3z?E#o0

[INFO] --- maven-surefire-plugin:2.7.1:test (default-test) @ wallet ---51Testing软件测试网I8b/Ud8~w c6X-x.Ye

[INFO] Tests are skipped.

W lNa\8O?Ge{ x0

[INFO]

XN)`6Z,T!H0

[INFO] --- maven-war-plugin:2.1.1:war (default-war) @ wallet ---

Fl{9O;v0

[INFO] Packaging webapp51Testing软件测试网]`6FlFL

[INFO] Assembling webapp [wallet] in [/Users/junqinghuang/Documents/workspace/ewallet/src/main/webapp]51Testing软件测试网9xrpOR.Q5G_

[INFO] Processing war project51Testing软件测试网hu KV)I1x

[INFO] Webapp assembled in [518 msecs]

*^i6lqaM8e#^;bS'U0

[INFO] Building war: /Users/junqinghuang/Documents/workspace/ewallet/target/wallet-0.0.1-SNAPSHOT.war51Testing软件测试网tp4S F*Z h%{"S

[INFO] WEB-INF/web.xml already added, skipping

1h CP)L}"v,O0

[INFO]51Testing软件测试网na"jUF

[INFO] <<< tomcat-maven-plugin:1.1:redeploy (default-cli) @ wallet <<<

QyV j,w B0

[INFO]51Testing软件测试网6?vY(BG'o|

[INFO] --- tomcat-maven-plugin:1.1:redeploy (default-cli) @ wallet ---51Testing软件测试网N#Lc:N!v*_sc

[INFO] Deploying war to http://localhost:8080/wallet

`9Gfl!g[#?-t0

[INFO] OK - Undeployed application at context path /wallet

&o!l%|u7]*} P CSP0

[INFO] OK - Deployed application at context path /wallet51Testing软件测试网4R)m1N["z["j

[INFO] ------------------------------------------------------------------------51Testing软件测试网-f9`/ujdHL

[INFO] BUILD SUCCESS

0vG{;g6TNg+S0

[INFO] ------------------------------------------------------------------------51Testing软件测试网3X\ K'UNl6A'_

[INFO] Total time: 12.435s

J%KX["F}.M CoJ0

[INFO] Finished at: Mon Feb 18 11:52:05 CST 2013

2V)[ Y,|*`1X'T0

[INFO] Final Memory: 16M/113M

MgEI~d3Y0

[INFO] ------------------------------------------------------------------------

_1ZxL i/Z0

[WARNING] The requested profile "develop" could not be activated because it does not exist.

!o4m0tP.S0

51Testing软件测试网}r)oD0Nn6a
51Testing软件测试网f#q]9_8v7dP*N os NC


TAG:

 

评分:0

我来说两句

Open Toolbar