參考
http://code.google.com/p/jmeter-maven-plugin/wiki/HOWTOUsePlugin。
從如上url下載maven plugin及depenent。先按原文細(xì)致執(zhí)行。
mvn deploy:deploy-file -DgroupId=org.apache.jmeter -DartifactId=jmeter -Dversion=2.3 -Dpackaging=jar -Dfile=jmeter-2.3.jar -DpomFile=jmeter-2.3.pom -Durl=file://<repo dir>
如上命令是把jar部署到本地maven reposity庫。我個(gè)人機(jī)器repo dir為:"C:Documents and Settingsjianzhao.liangjz.m2 epository"
命令行實(shí)際執(zhí)行如下:
mvn deploy:deploy-file -DgroupId=org.apache.jmeter -DartifactId=jmeter -Dversion=2.3 -Dpackaging=jar -Dfile=jmeter-2.3.jar -DpomFile=jmeter-2.3.pom -Durl=file://"C:Documents and Settingsjianzhao.liangjz.m2 epository"
按原文配置后,對maven工程實(shí)施 Mvn clean install出現(xiàn)多個(gè)錯(cuò)誤,控制臺(tái)上錯(cuò)誤提示可能誤導(dǎo)人。
在工程目錄: target/jmeter/jmeter.log提供真正價(jià)值的異常信息。如:
jmeter.save.SaveService: Conversion error com.thoughtworks.xstream.converters.ConversionException: org/apache/commons/logging/LogFactory : org/apache/commons/logging/LogFactory。
源代碼可參考:http://jmeter-maven-plugin.googlecode.com/svn/trunk/src/main/java/org/apache/jmeter/JMeterMojo.java
調(diào)整細(xì)節(jié)如下:
1.0 前提部署好maven/jmeter環(huán)境
D:src etty_websocket>mvn -version
Apache Maven 2.2.1 (r801777; 2009-08-07 03:16:01+0800)
Java version: 1.6.0_11
Java home: D:devtoolsjdk1.6.0_11jre
Default locale: zh_CN, platform. encoding: GBK
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
D:src etty_websocket> jmeter -v
Copyright (c) 1998-2008 The Apache Software Foundation
Version 2.3.2 r665936