jenkins+maven+jmeter

jmeter 3.3  + jmeter-maven-plugin  version 2.5 

 主体:pom.xml + *.jmx

maven结构


总结:

        1)*.jmx 脚本文件  由 jmete生成

        jmeter-maven-plugin

        参考资料:https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/wiki/Advanced-Configuration

主体:pow.xml

<!-- jmeter插件 -->
			<plugin>
				<groupId>com.lazerycode.jmeter</groupId>
				<artifactId>jmeter-maven-plugin</artifactId>
				<version>2.5.0</version>
				<executions>
					<execution>
						<id>jmeter-tests</id>
						<!-- 启动命令 -->
						<phase>verify</phase>
						<goals>
							<goal>jmeter</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<resultsFileFormat>xml</resultsFileFormat>
					<jmeterExtensions>
						<!-- jmeter第三方插件 -->
						<artifact>kg.apc:jmeter-plugins-json:2.6</artifact>
					</jmeterExtensions>
					<overrideRootLogLevel>debug</overrideRootLogLevel>
					<ignoreResultFailures>true</ignoreResultFailures>
					<testResultsTimestamp>false</testResultsTimestamp>
					<!-- 限制测试的脚本 -->
					<testFilesIncluded>
						<jMeterTestFile>chengdu.jmx</jMeterTestFile>
					</testFilesIncluded>
					<!-- 解决报错     依赖关系树还是什么的   -->
					<downloadExtensionDependencies>false</downloadExtensionDependencies>
					<excludedArtifacts>
						<exclusion>commons-pool2:commons-pool2</exclusion>
						<exclusion>commons-math3:commons-math3</exclusion>
					</excludedArtifacts>
				</configuration>

			</plugin>

<!--根据xsl模版把jtl文件转换成html,官网地址: http://www.mojohaus.org/xml-maven-plugin/examples/transform-saxon.html -->
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>xml-maven-plugin</artifactId>
				<version>1.0-beta-3</version>
				<executions>
					<execution>
						<phase>verify</phase>
						<goals>
							<goal>transform</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<transformationSets>
						<transformationSet>
							<dir>${jmeter.result.jtl.dir}</dir>
							<stylesheet>src/test/resources/jmeter-results-report_21.xsl</stylesheet>
							<outputDir>${jmeter.result.html.dir}</outputDir>
							<!-- 把jtl格式转传承html -->
							<fileMappers>
								<fileMapper
									implementation="org.codehaus.plexus.components.io.filemappers.FileExtensionMapper">
									<targetExtension>html</targetExtension>
								</fileMapper>
							</fileMappers>
						</transformationSet>
					</transformationSets>
				</configuration>
				<dependencies>
					<!-- using XSLT 2.0 -->
					<dependency>
						<groupId>net.sf.saxon</groupId>
						<artifactId>saxon</artifactId>
						<version>8.7</version>
					</dependency>
				</dependencies>

			</plugin>

成功运行;

jmeter集成jenkins:






  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值