[英]jmeter plugin maven test-jar
Hi I'm trying to automate my JMeter load balancing test with the jmeter-maven-plugin from lazerycode. 嗨,我正在尝试使用lazerycode的jmeter-maven-plugin自动化我的JMeter负载平衡测试。 My JMeter tests uses premade junit class files which I pack into a test-jar with the maven-jar-plugin.
我的JMeter测试使用premade junit类文件,我将其打包到带有maven-jar-plugin的测试jar中。 But before the jar file is installed on my local maven repository maven starts the jmeter test.
但是在我的本地maven存储库上安装jar文件之前,maven启动了jmeter测试。 Is there a way I can install the test-jar so I can use it as a dependency in the jmeter plugin?
有没有办法我可以安装测试jar,所以我可以用它作为jmeter插件的依赖? below you'll find my jmeter plugin configuration.
下面你会找到我的jmeter插件配置。
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>1.4.1</version>
<executions>
<execution>
<id>jmeter-test</id>
<phase>integration-test</phase>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>groupID</groupId>
<artifactId>artifactID</artifactId>
<version>${project-version}</version>
<type>test-jar</type>
</dependency>
</dependencies>
<configuration>
<propertiesUser>
<current.protocol>http</current.protocol>
<current.dns>localhost</current.dns>
<current.port>8088</current.port>
</propertiesUser>
<testFilesDirectory>${basedir}/src/jmeter/tests/</testFilesDirectory>
<ignoreResultErrors>true</ignoreResultErrors>
<ignoreResultFailures>true</ignoreResultFailures>
<useOldTestEndDetection>true</useOldTestEndDetection>
</configuration>
</plugin>
thx 谢谢
Put the test jar into a different module, then make the project with the jmeter plugin dependent on that module. 将测试jar放入不同的模块,然后使用jmeter插件使项目依赖于该模块。 You will then be able to install the tests then execute them in jmeter in a single Maven invocation.
然后,您将能够安装测试,然后在单个Maven调用中在jmeter中执行它们。
I solved this problem by using an activation profile :- 我通过使用激活配置文件解决了这个问题: -
<profiles>
<profile>
<id>ptest</id>
<activation>
<property>
<name>ptest</name>
</property>
</activation>
<build>
<resources>
<resource>
<directory>src/jmeter</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>1.4.1</version>
<executions>
<execution>
<id>jmeter-tests</id>
<phase>verify</phase>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
</executions>
<configuration>
<useOldTestEndDetection>true</useOldTestEndDetection>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
Using this approach you can install once, not using the profile, and then run subsequently with the profile turned on. 使用此方法,您可以安装一次,而不是使用配置文件,然后在打开配置文件的情况下运行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.