{"id":1467,"date":"2024-05-08T11:25:36","date_gmt":"2024-05-08T03:25:36","guid":{"rendered":"http:\/\/oneai.eu.org\/?p=1467"},"modified":"2024-05-08T12:05:47","modified_gmt":"2024-05-08T04:05:47","slug":"jenkins%e4%b8%8ejmeter%e9%9b%86%e6%88%90","status":"publish","type":"post","link":"https:\/\/oneai.eu.org\/?p=1467","title":{"rendered":"jenkins\u4e0ejmeter\u96c6\u6210"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"1467\" class=\"elementor elementor-1467\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-6d9dbeb2 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"6d9dbeb2\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-52dccb87\" data-id=\"52dccb87\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-ca6a5f1 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"ca6a5f1\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-1357803\" data-id=\"1357803\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-2731b90 elementor-widget elementor-widget-text-editor\" data-id=\"2731b90\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Jenkins\u4e2d\u96c6\u6210jmeter-maven\u63d2\u4ef6<\/p>\n<p>2015-11-05 15:00 4\u4eba\u9605\u8bfb \u8bc4\u8bba(0) \u6536\u85cf \u4e3e\u62a5<\/p>\n<p>jmeterjekins<\/p>\n<p>\u76ee\u5f55(?)[+]<\/p>\n<p>\u7b2c\u4e00\u6b65.\u5148\u5728maven\u5de5\u7a0b\u4e2d\u5355\u72ec\u4f7f\u7528jmeter-maven\u63d2\u4ef6<\/p>\n<p>0.\u73af\u5883<\/p>\n<p>1.\u5728POM.xml\u6587\u4ef6\u52a0\u5165<\/p>\n<p>2.\u65b0\u5efascr\/test\/jmeter\u76ee\u5f55\uff08\u8fd9\u662fjmeter-maven\u63d2\u4ef6\u9ed8\u8ba4\u627ejmeter\u7684jmx\u6587\u4ef6\u7684\u4f4d\u7f6e\uff0c\u82e5\u8981\u66f4\u6539\u5728POM\u4e2d\u4f5c\u914d\u7f6e\uff09\uff0c\u628a\u5df2\u7ecf\u6d4b\u8bd5\u597d\u7684jmeter\u6587\u4ef6\u5982test1.jmx\u62f7\u8d1d\u8fdb\u53bb\u3002<\/p>\n<p>\u7b2c\u4e8c\u6b65.\u5728Jenkins\u4e2d\u96c6\u6210\u4f7f\u7528jmeter-maven\u63d2\u4ef6<\/p>\n<p>0.\u73af\u5883<\/p>\n<p>1.\u5728\u5b89\u88c5Jenkins\u4e2d\u5b89\u88c5Performance Plugin<\/p>\n<p>2.\u5728\u9700\u8981\u96c6\u6210jmeter-maven\u63d2\u4ef6\u7684\u5de5\u7a0b\u914d\u7f6e\u9875\u9762\uff0c\u6784\u5efa\u540e\u64cd\u4f5c\u52a0\u5165\u4e00\u4e2aPublish Performance test result report\uff0c\u5982\u56fe\u6240\u793a<\/p>\n<p>3.\u5728MAVEN Build\u7684Goals\u4e2d\u586b\u5165verify\u3002<\/p>\n<p>4.\u6267\u884cJenkins\u6784\u5efa\uff0c\u89c2\u5bdf\u7ed3\u679c\u3002<\/p>\n<p>\u7b2c\u4e00\u6b65.\u5148\u5728maven\u5de5\u7a0b\u4e2d\u5355\u72ec\u4f7f\u7528jmeter-maven\u63d2\u4ef6<\/p>\n<p><br><\/p>\n<p>0.\u73af\u5883<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; Windows7 64bit<\/p>\n<p>&nbsp; &nbsp; SUN JDK 1.7 64bit<\/p>\n<p>&nbsp; &nbsp; eclipse v3.7<\/p>\n<p>&nbsp; &nbsp; m2e v1.0.100.20110804-1717<\/p>\n<p>&nbsp; &nbsp; eclipse\u4e2d\u5916\u6302maven 3.02<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; &nbsp; \u6ce8\u610f: \u7531\u4e8ejmeter-maven\u63d2\u4ef6\u8fd0\u884c\u65f6\u81ea\u52a8\u4f1a\u5f15\u5165jmeter\u6240\u9700\u7684\u7c7b\u5e93\uff0c\u6240\u4ee5\u673a\u5668\u4e0a\u4e0d\u9700\u8981\u5355\u72ec\u5b89\u88c5jmeter\u3002<\/p>\n<p><br><\/p>\n<p>1.\u5728POM.xml\u6587\u4ef6\u52a0\u5165<\/p>\n<p>&lt;build&gt;<\/p><p><br><\/p><p>&nbsp; &nbsp; &#8230;<\/p><p><br><\/p><p>&nbsp; &nbsp; &lt;plugins&gt;<\/p><p><br><\/p><p>&nbsp; &nbsp; &nbsp; &nbsp; &lt;plugin&gt;<\/p><p><br><\/p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;groupId&gt;com.lazerycode.jmeter&lt;\/groupId&gt;<\/p><p><br><\/p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;artifactId&gt;jmeter-maven-plugin&lt;\/artifactId&gt;<\/p><p><br><\/p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;version&gt;1.8.2-SNAPSHOT&lt;\/version&gt;<\/p><p><br><\/p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;configuration&gt;<\/p><p><br><\/p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;resultsFileFormat&gt;xml&lt;\/resultsFileFormat&gt;<\/p><p><br><\/p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;ignoreResultFailures&gt;true&lt;\/ignoreResultFailures&gt;<\/p><p><br><\/p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;testResultsTimestamp&gt;false&lt;\/testResultsTimestamp&gt;<\/p><p><br><\/p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/configuration&gt;<\/p><p><br><\/p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;executions&gt;<\/p><p><br><\/p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;execution&gt;<\/p><p><br><\/p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;id&gt;jmeter-tests&lt;\/id&gt;<\/p><p><br><\/p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;phase&gt;verify&lt;\/phase&gt;<\/p><p><br><\/p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;goals&gt;<\/p><p><br><\/p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;goal&gt;jmeter&lt;\/goal&gt;<\/p><p><br><\/p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/goals&gt;<\/p><p><br><\/p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/execution&gt;<\/p><p><br><\/p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/executions&gt;<\/p><p><br><\/p><p>&nbsp; &nbsp; &lt;plugins&gt;<\/p><p><br><\/p><p>&nbsp; &nbsp; &nbsp; &nbsp; &lt;span&gt;&lt;\/span&gt;&#8230;<\/p><p><br><\/p><p>&lt;build&gt;<\/p>\n<p><br><\/p>\n<p>\u5982\u679c\u51fa\u73b0\u627e\u4e0d\u5230\u6784\u4ef6(artifact)\u7684\u60c5\u51b5\uff0c\u8003\u8651\u5207\u6362\u4e00\u4e0bMaven Repository\uff0c\u6700\u76f4\u63a5\u7684\u65b9\u6cd5\u662f\u5728POM\u4e2d\u52a0\u5165\u7c7b\u4f3c\u5982\u4e0b\u4ee3\u7801\u3002<\/p>\n<p><br><\/p>\n<p>&lt;pluginRepositories&gt;<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; &lt;pluginRepository&gt;<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &lt;id&gt;Codehaus<\/p>\n<p>&nbsp;repository&lt;\/id&gt;<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &lt;url&gt;http:\/\/repository.codehaus.org\/&lt;\/url&gt;<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &lt;releases&gt;<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;enabled&gt;true&lt;\/enabled&gt;<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;updatePolicy&gt;always&lt;\/updatePolicy&gt;<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &lt;\/releases&gt;<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &lt;snapshots&gt;<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;enabled&gt;true&lt;\/enabled&gt;<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;updatePolicy&gt;always&lt;\/updatePolicy&gt;<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &lt;\/snapshots&gt;<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; &lt;\/pluginRepository&gt;<\/p>\n<p><br><\/p>\n<p>&lt;\/pluginRepositories&gt;<\/p>\n<p><br><\/p>\n<p>2.\u65b0\u5efascr\/test\/jmeter\u76ee\u5f55\uff08\u8fd9\u662fjmeter-maven\u63d2\u4ef6\u9ed8\u8ba4\u627ejmeter\u7684jmx\u6587\u4ef6\u7684\u4f4d\u7f6e\uff0c\u82e5\u8981\u66f4\u6539\u5728POM\u4e2d\u4f5c\u914d\u7f6e\uff09\uff0c\u628a\u5df2\u7ecf\u6d4b\u8bd5\u597d\u7684jmeter\u6587\u4ef6\u5982test1.jmx\u62f7\u8d1d\u8fdb\u53bb\u3002<\/p>\n<p><br><\/p>\n<p>\u5728Eclipse\u4e2dRun Configurations -&gt; Maven Build&nbsp; -&gt; new\u4e2dGoals\u8f93\u5165\u6846\u586b\u5165 verify\uff0c\u786e\u5b9a\u3002<\/p>\n<p><br><\/p>\n<p>\u7b14\u8005\u5728\u8fd0\u884c\u8fc7\u7a0b\u66fe\u9047\u5230\u5f02\u5e38<\/p>\n<p>[ERROR]<\/p>\n<p>&nbsp;Failed to execute goal com.lazerycode.jmeter:jmeter-maven-plugin:1.8.1:jmeter<\/p>\n<p>&nbsp;(jmeter-tests) on project mytodo: Execution jmeter-tests of goal com.lazerycode.jmeter:jmeter-maven-plugin:1.8.1:jmeter<\/p>\n<p>&nbsp;failed. NullPointerException -&gt; [Help 1]<\/p>\n<p><br><\/p>\n<p>org.apache.maven.lifecycle.LifecycleExecutionException:<\/p>\n<p>&nbsp;Failed to execute goal com.lazerycode.jmeter:jmeter-maven-plugin:1.8.1:jmeter<\/p>\n<p>&nbsp;(jmeter-tests) on project mytodo: Execution jmeter-tests of goal com.lazerycode.jmeter:jmeter-maven-plugin:1.8.1:jmeter<\/p>\n<p>&nbsp;failed.<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; at<\/p>\n<p>&nbsp;org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; at<\/p>\n<p>&nbsp;org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; at<\/p>\n<p>&nbsp;org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; at<\/p>\n<p>&nbsp;org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; at<\/p>\n<p>&nbsp;org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; at<\/p>\n<p>&nbsp;org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; at<\/p>\n<p>&nbsp;org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; at<\/p>\n<p>&nbsp;org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; at<\/p>\n<p>&nbsp;org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; at<\/p>\n<p>&nbsp;org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; at<\/p>\n<p>&nbsp;org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; at<\/p>\n<p>&nbsp;org.apache.maven.cli.MavenCli.main(MavenCli.java:141)<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; at<\/p>\n<p>&nbsp;sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; at<\/p>\n<p>&nbsp;sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; at<\/p>\n<p>&nbsp;sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; at<\/p>\n<p>&nbsp;java.lang.reflect.Method.invoke(Method.java:601)<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; at<\/p>\n<p>&nbsp;org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; at<\/p>\n<p>&nbsp;org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; at<\/p>\n<p>&nbsp;org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; at<\/p>\n<p>&nbsp;org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)<\/p>\n<p><br><\/p>\n<p>Caused<\/p>\n<p>&nbsp;by: org.apache.maven.plugin.PluginExecutionException: Execution jmeter-tests of goal com.lazerycode.jmeter:jmeter-maven-plugin:1.8.1:jmeter<\/p>\n<p>&nbsp;failed.<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; at<\/p>\n<p>&nbsp;org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:116)<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; at<\/p>\n<p>&nbsp;org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; &#8230;<\/p>\n<p><br><\/p>\n<p>more<\/p>\n<p><br><\/p>\n<p>Caused<\/p>\n<p>&nbsp;by: java.lang.NullPointerException<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; at<\/p>\n<p>&nbsp;com.lazerycode.jmeter.JMeterAbstractMojo.setJMeterResultFileFormat(JMeterAbstractMojo.java:382)<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; at<\/p>\n<p>&nbsp;com.lazerycode.jmeter.JMeterMojo.execute(JMeterMojo.java:43)<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; at<\/p>\n<p>&nbsp;org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; &#8230;<\/p>\n<p><br><\/p>\n<p><br><\/p>\n<p>more<\/p>\n<p>\u67e5\u627e\u8d44\u6599\u672a\u89e3\u51b3\u540e\uff0c\u627e\u5230com.lazerycode.jmeter.JMeterAbstractMojo\u7c7b\u7b2c382\u884c\u4e2d\uff0csetJMeterResultFileFormat\u4e2d\u5bf9\u5e94\u7684\u4ee3\u7801\uff1a<\/p>\n<p>protected<\/p>\n<p><br><\/p>\n<p>void&nbsp;<\/p>\n<p>setJMeterResultFileFormat() {<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; if<\/p>\n<p><br><\/p>\n<p>(resultsFileFormat.toLowerCase().equals(&#8220;csv&#8221;))<\/p>\n<p>&nbsp;{<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; propertiesJMeter.put(&#8220;jmeter.save.saveservice.output_format&#8221;,<\/p>\n<p>&#8220;csv&#8221;);<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; resultsOutputIsCSVFormat<\/p>\n<p>&nbsp;= true;<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; }<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; else<\/p>\n<p><br><\/p>\n<p>{<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; propertiesJMeter.put(&#8220;jmeter.save.saveservice.output_format&#8221;,<\/p>\n<p>&#8220;xml&#8221;);<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; resultsOutputIsCSVFormat<\/p>\n<p>&nbsp;= false;<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; }<\/p>\n<p><br><\/p>\n<p>}<\/p>\n<p><br><\/p>\n<p>\u65ad\u5b9a\u662fpropertiesJMeter\u4e3anull\u6240\u81f4\uff0c\u4e3a\u4ec0\u4e48\u8fd9\u4e2a\u5bf9\u8c61\u6ca1\u521d\u59cb\u5316\uff0c\u7b54\u6848\u76ee\u524d\u4e0d\u5f97\u800c\u77e5\u3002\u4e8e\u662f\u53bbgithub\u628ajmeter-maven\u63d2\u4ef6\u6700\u65b0\u4ee3\u7801clone\u5230\u672c\u5730\uff0c\u4f7f\u7528new\u521d\u59cb\u5316propertiesJMeter\u5bf9\u8c61\uff0c\u5728eclipse\u4e2d\u91cd\u65b0\u6253\u5305\uff0c\u5f97\u5230jmeter-maven-plugin-1.8.2-SNAPSHOT.jar\uff0c\u518d\u628aPOM.xml\u4e2djmeter-maven-plugin\u63d2\u4ef6\u7248\u672c\u4ece1.8.1\u66f4\u6362\u4e3a1.8.2-SNAPSHOT\uff0c\u518d\u6b21\u8fd0\u884cmvn verify \uff0c\u5c31\u770b\u5230\u6253\u5370\u51faBuild Success\u5b57\u6837\u3002<\/p>\n<p><br><\/p>\n<p><br><\/p>\n<p>\u66f4\u591ajmeter-maven\u63d2\u4ef6\u5e2e\u52a9\uff1ahttps:\/\/github.com\/Ronnie76er\/jmeter-maven-plugin\/wiki<\/p>\n<p><br><\/p>\n<p><br><\/p>\n<p>\u7b2c\u4e8c\u6b65.\u5728Jenkins\u4e2d\u96c6\u6210\u4f7f\u7528jmeter-maven\u63d2\u4ef6<\/p>\n<p><br><\/p>\n<p>0.\u73af\u5883<\/p>\n<p><br><\/p>\n<p>&nbsp; &nbsp; CentOS Linux 6.0 x64&nbsp;<\/p>\n<p>&nbsp; &nbsp; SUN JDK 1.7 64bit&nbsp;<\/p>\n<p>&nbsp; &nbsp; Jenkins ver. 1.529<\/p>\n<p>1.\u5728\u5b89\u88c5Jenkins\u4e2d\u5b89\u88c5Performance Plugin<\/p>\n<p><br><\/p>\n<p>2.\u5728\u9700\u8981\u96c6\u6210jmeter-maven\u63d2\u4ef6\u7684\u5de5\u7a0b\u914d\u7f6e\u9875\u9762\uff0c\u6784\u5efa\u540e\u64cd\u4f5c\u52a0\u5165\u4e00\u4e2aPublish Performance test result report\uff0c\u5982\u56fe\u6240\u793a<\/p>\n<p>\u8bf4\u660e\uff1aPerformance report\u662f\u6307\u5c55\u73b0\u7684\u62a5\u544a\u79cd\u7c7b\uff0c\u76ee\u524d\u652f\u6301JMeter\u548cJUnit<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u5982\u679c\u6307\u5b9a\u4e3aJMeter\u9700\u8981\u6307\u51faJMeter\u6d4b\u8bd5\u7ed3\u679c\u96c6\u76ee\u5f55\uff0c**\u4ee3\u8868pom.xml\u6240\u5728\u76ee\u5f55<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; Performance threshold\u662f\u6307\u6807\u8bb0\u672c\u6b21\u6784\u5efa\u4e3aUnstable\u548cFailed\u65f6\u6240\u9700\u7684\u6700\u4f4e\u6d4b\u8bd5\u9519\u8bef\u767e\u5206\u6bd4<\/p>\n<p><br><\/p>\n<p>3.\u5728MAVEN Build\u7684Goals\u4e2d\u586b\u5165verify\u3002<\/p>\n<p><br><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-ae303cb elementor-widget elementor-widget-image\" data-id=\"ae303cb\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img fetchpriority=\"high\" decoding=\"async\" width=\"828\" height=\"893\" src=\"https:\/\/oneai.eu.org\/wp-content\/uploads\/2024\/05\/\u65e0\u6807\u9898.png\" class=\"attachment-large size-large wp-image-1468\" alt=\"\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-5b7d03b elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"5b7d03b\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-b830cb6\" data-id=\"b830cb6\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-e607653 elementor-widget elementor-widget-text-editor\" data-id=\"e607653\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>\u6ce8\u610f\u4e8b\u9879\uff1a\u5982\u679cJMeter\u6027\u80fd\u6d4b\u8bd5\u6bd4\u8f83\u8017\u65f6\uff0c\u5c31\u4e0d\u80fd\u628a\u5b83\u653e\u5728\u8fd9\u91cc\u6267\u884c\uff0c\u56e0\u4e3a\u5b83\u4f1a\u5bfc\u81f4Jenkins\u6784\u5efa\u65f6\u95f4\u8fc7\u957f\u3002\u5bf9\u6b64\uff0c\u53ef\u63d0\u524d\u624b\u5de5\u4f7f\u7528\u547d\u4ee4\u6267\u884c\uff0c\u4f8b\u5982\uff1a<\/p><p><br><\/p><p>$ jmeter -n -p user.properties -t my_test_plan.jmx -l my_results.jtl<\/p><p><br><\/p><p>\u4e5f\u53ef\u628a\u5b83\u505a\u6210Linux Crontab\u811a\u672c\u3002\u8fd8\u6709\u4e00\u79cd\u65b9\u5f0f\u662f\uff0c\u5229\u7528Jenkins\u7684\u5468\u671f\u6027\u6784\u5efa\u529f\u80fd\uff0c\u52fe\u9009Build periodically\u590d\u9009\u6846\uff0c\u8bbe\u5b9a\u4e00\u4e2a\u5b9a\u65f6\u6267\u884c\u95f4\u9694\u3002<\/p><p><br><\/p><p>4.\u6267\u884cJenkins\u6784\u5efa\uff0c\u89c2\u5bdf\u7ed3\u679c\u3002<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-8cdc335 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"8cdc335\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-b0d17bb\" data-id=\"b0d17bb\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-7f0aa47 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"7f0aa47\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-1e84c27\" data-id=\"1e84c27\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-13a4fcd elementor-widget elementor-widget-image\" data-id=\"13a4fcd\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" width=\"960\" height=\"786\" src=\"https:\/\/oneai.eu.org\/wp-content\/uploads\/2024\/05\/jmeterforjenkins2.png\" class=\"attachment-large size-large wp-image-1469\" alt=\"\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Jenkins\u4e2d\u96c6\u6210jmeter-maven\u63d2\u4ef6 2015-11-05 15:00 4\u4eba\u9605\u8bfb \u8bc4\u8bba(0) \u6536\u85cf \u4e3e\u62a5 jmeterjekins \u76ee\u5f55(?)[+] \u7b2c\u4e00\u6b65.\u5148\u5728maven\u5de5\u7a0b\u4e2d\u5355\u72ec\u4f7f\u7528jmeter-maven\u63d2\u4ef6 0.\u73af\u5883 1.\u5728POM.xml\u6587\u4ef6\u52a0\u5165 2.\u65b0\u5efascr\/test\/jmeter\u76ee\u5f55\uff08\u8fd9\u662fjmeter-maven\u63d2\u4ef6\u9ed8\u8ba4\u627ejmeter\u7684jmx\u6587\u4ef6\u7684\u4f4d\u7f6e\uff0c\u82e5\u8981\u66f4\u6539\u5728POM\u4e2d\u4f5c\u914d\u7f6e\uff09\uff0c\u628a\u5df2\u7ecf\u6d4b\u8bd5\u597d\u7684jmeter\u6587\u4ef6\u5982test1.jmx\u62f7\u8d1d\u8fdb\u53bb\u3002 \u7b2c\u4e8c\u6b65.\u5728Jenkins\u4e2d\u96c6\u6210\u4f7f\u7528jmeter-maven\u63d2\u4ef6 0.\u73af\u5883 1.\u5728\u5b89\u88c5Jenkins\u4e2d\u5b89\u88c5Performance Plugin 2.\u5728\u9700\u8981\u96c6\u6210jmeter-maven\u63d2\u4ef6\u7684\u5de5\u7a0b\u914d\u7f6e\u9875\u9762\uff0c\u6784\u5efa\u540e\u64cd\u4f5c\u52a0\u5165\u4e00\u4e2aPublish Performance test result report\uff0c\u5982\u56fe\u6240\u793a 3.\u5728MAVEN Build\u7684Goals\u4e2d\u586b\u5165verify\u3002 4.\u6267\u884cJenkins\u6784\u5efa\uff0c\u89c2\u5bdf\u7ed3\u679c\u3002 \u7b2c\u4e00\u6b65.\u5148\u5728maven\u5de5\u7a0b\u4e2d\u5355\u72ec\u4f7f\u7528jmeter-maven\u63d2\u4ef6 0.\u73af\u5883 &nbsp; &nbsp; Windows7 64bit &nbsp; &nbsp; SUN JDK 1.7 64bit &nbsp; &nbsp; eclipse v3.7 &nbsp; &nbsp; m2e v1.0.100.20110804-1717 &nbsp; &nbsp; eclipse\u4e2d\u5916\u6302maven 3.02 &nbsp; &nbsp; &nbsp; \u6ce8\u610f: \u7531\u4e8ejmeter-maven\u63d2\u4ef6\u8fd0\u884c\u65f6\u81ea\u52a8\u4f1a\u5f15\u5165jmeter\u6240\u9700\u7684\u7c7b\u5e93\uff0c\u6240\u4ee5\u673a\u5668\u4e0a\u4e0d\u9700\u8981\u5355\u72ec\u5b89\u88c5jmeter\u3002 1.\u5728POM.xml\u6587\u4ef6\u52a0\u5165 &lt;build&gt; &nbsp; &nbsp; &#8230; &nbsp; &nbsp; &lt;plugins&gt; &nbsp; &nbsp; &nbsp; &nbsp; &lt;plugin&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;groupId&gt;com.lazerycode.jmeter&lt;\/groupId&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;artifactId&gt;jmeter-maven-plugin&lt;\/artifactId&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;version&gt;1.8.2-SNAPSHOT&lt;\/version&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;configuration&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;resultsFileFormat&gt;xml&lt;\/resultsFileFormat&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;ignoreResultFailures&gt;true&lt;\/ignoreResultFailures&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;testResultsTimestamp&gt;false&lt;\/testResultsTimestamp&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/configuration&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;executions&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#038;&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_eb_attr":"","footnotes":""},"categories":[86,82],"tags":[],"class_list":["post-1467","post","type-post","status-publish","format-standard","hentry","category-jenkins","category-82"],"_links":{"self":[{"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/1467","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1467"}],"version-history":[{"count":6,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/1467\/revisions"}],"predecessor-version":[{"id":1476,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/1467\/revisions\/1476"}],"wp:attachment":[{"href":"https:\/\/oneai.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1467"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1467"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1467"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}