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

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

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

eclipse下实现maven项目在tomcat容器热部署方法51Testing软件测试网9] dK_6D!O;G {2j+SZ

黄进青2013-2-1751Testing软件测试网M'UQ Fz['q


8A?-`/D B/`0

0A z$W*ty$I7T0

1eclipse安装maven插件、svn插件51Testing软件测试网4t#lug hz!siP

2、从svn检查maven结构web项目(可部署到tomcat下)51Testing软件测试网]N7C `Dx?

3、修改远程或本地的tomcat配置文件apache-tomcat-6.0.29/conf/tomcat-users.xml,添加用户,如下所示:

m:?$P(|)x0

<role rolename="manager"/>51Testing软件测试网`P4n!g5k+U0Z!X(^

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

,b M9e!^YF&u5v0

4、修改mavensettings.xml,增加server,如下所示:

N$M eyO3M3SgHzN0

<server>51Testing软件测试网K | v"w+Q

<id>tomcat</id>

%dY$OP(C(p"_7].gC0

<username>admin</username>

(E+L$y8H @Q&|3W7p0

<password>admin</password>51Testing软件测试网0j!i q)oZR

</server>51Testing软件测试网di$b6^6v'Gn

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

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

。。。

$UI-\H_0

<plugin>

Z8D|r/|1i#`0

<groupId>org.codehaus.mojo</groupId>51Testing软件测试网r m:e3vAE

<artifactId>tomcat-maven-plugin</artifactId>51Testing软件测试网&Z T4V.eU1h4a~n

<configuration>51Testing软件测试网2z"\1e;y1V kA

<url>http://localhost:8080/manager/html</url>51Testing软件测试网2u? MkJR w

<server>tomcat</server>51Testing软件测试网|&}!M|[8j

<path>/wallet</path>51Testing软件测试网hvIkD

</configuration>51Testing软件测试网*WK L7BXm

<version>1.1</version>51Testing软件测试网(zvL3D&A#h#y2v

</plugin>

9V9c\%b sZ&a;j0


|L fw9v|r051Testing软件测试网4eo1|h'[

。。。

;D3}4`LJ9bZ]p0

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

Cr(M tDfT6GQ0

51Testing软件测试网b,^ ^ePrNQ)u
51Testing软件测试网-v;ykE4Y3W'Os:atq0w]`

8、执行maven build后的结果如下所示:51Testing软件测试网 n`([&EoW1z6\

。。。。。

9u{&o*g(V0


/_!V]0nDq"{l ks9K0

IU$au$E Ll0

[INFO] Building 0.0.1-SNAPSHOT51Testing软件测试网B5HJ&oUQ3i.cY

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

s${G$I9\k!r,r7wN0

[INFO]

+?9M w2nd*Q)u0

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

5WR `2jIeNX0

[INFO] Deleting /Users/junqinghuang/Documents/workspace/ewallet/target51Testing软件测试网#M3ar;X"ws:`

[INFO]51Testing软件测试网)z&?qo;\

[INFO] >>> tomcat-maven-plugin:1.1:redeploy (default-cli) @ wallet >>>51Testing软件测试网"W'n*OZ1ZM!F8{{I

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

5Q.v.w u+v/q"Ae0

[INFO]51Testing软件测试网q/c#_vA|4]jJ

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

Ok8IHz'M F f0

[WARNING] Using platform. encoding (EUC_CN actually) to copy filtered resources, i.e. build is platform. dependent!51Testing软件测试网@0O'f;~i$~"g9o

[INFO] Copying 9 resources

'RqfD,IYrf*y4C+ZK0

[INFO]51Testing软件测试网(|[Y#FXyB

[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ wallet ---51Testing软件测试网nSsf%\ D;G3G6\:T

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

#@s.z)lJW#T^0

[INFO]51Testing软件测试网(K#^r:Gd:HSEU

[INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @ wallet ---51Testing软件测试网m,Rk;G8w/o2GU

[WARNING] Using platform. encoding (EUC_CN actually) to copy filtered resources, i.e. build is platform. dependent!51Testing软件测试网5D&a2d M%R-q S,lHO3g

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

\c"Txr0

[INFO]

'b}No}7I0K.[+pi0

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

ul%lh1w`0

[INFO] Not compiling test sources

9nS k"^2Y8Gm0

[INFO]

1pV[D4d/L0

[INFO] --- maven-surefire-plugin:2.7.1:test (default-test) @ wallet ---

h{?(F;[+MB9x0

[INFO] Tests are skipped.51Testing软件测试网 EoP$GI9Y9{2E

[INFO]51Testing软件测试网Ji'[ hpUQ8xg

[INFO] --- maven-war-plugin:2.1.1:war (default-war) @ wallet ---51Testing软件测试网4l6\1~j+G9\1T3^R j.D

[INFO] Packaging webapp51Testing软件测试网e:q9[!SpS8Yf

[INFO] Assembling webapp [wallet] in [/Users/junqinghuang/Documents/workspace/ewallet/src/main/webapp]51Testing软件测试网J^g\j*fQiBr

[INFO] Processing war project51Testing软件测试网}6X8_;\ H7?

[INFO] Webapp assembled in [518 msecs]

CN$ck:_\,f.v0

[INFO] Building war: /Users/junqinghuang/Documents/workspace/ewallet/target/wallet-0.0.1-SNAPSHOT.war

HQ p@0R+FI4j@/kf0

[INFO] WEB-INF/web.xml already added, skipping51Testing软件测试网 kpmB1~ _ \L

[INFO]

f8n#k9VcPB0

[INFO] <<< tomcat-maven-plugin:1.1:redeploy (default-cli) @ wallet <<<51Testing软件测试网!P-b^*p9wLgR

[INFO]51Testing软件测试网eh|6DtZ0r

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

dO1awQ\T@.w-e0

[INFO] Deploying war to http://localhost:8080/wallet51Testing软件测试网a,a7S@H J@

[INFO] OK - Undeployed application at context path /wallet51Testing软件测试网/qw%YQ&G\)GA{-E-l

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

} Fy2\ RP3a WM0

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

eH0HE@ W Bng{0

[INFO] BUILD SUCCESS51Testing软件测试网q F C;NP]UD]

[INFO] ------------------------------------------------------------------------51Testing软件测试网Xn3M:Q ky/Zfv

[INFO] Total time: 12.435s51Testing软件测试网6q\Q-`#g~'] H,U

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

;U#x@-CT2[p7i0

[INFO] Final Memory: 16M/113M

dZK5R$[^8w0

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

M9gE$A*Y0

[WARNING] The requested profile "develop" could not be activated because it does not exist.51Testing软件测试网3g/l [8ot'l


thL/k2TDz%OB0

LR~ E)k G2v0

TAG:

 

评分:0

我来说两句

Open Toolbar