参考
http://code.google.com/p/jmeter-maven-plugin/wiki/HOWTOUsePlugin。
从如上url下载maven plugin及depenent。先按原文细致执行。
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库。我个人机器repo dir为:"C:Documents and Settingsjianzhao.liangjz.m2 epository"
命令行实际执行如下:
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工程实施 Mvn clean install出现多个错误,控制台上错误提示可能误导人。
在工程目录: target/jmeter/jmeter.log提供真正价值的异常信息。如:
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
调整细节如下:
1.0 前提部署好maven/jmeter环境
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