簡體   English   中英

如何在Maven中運行Jmeter測試?

[英]HOw to run Jmeter tests with Maven?

有人可以建議如何在Maven中運行Jmeter測試嗎? 這只是一個簡單的jmeter腳本,帶有對google.com的http調用,沒有任何變量。 只是想從一個簡單的開始。

我已經創建了maven可以識別的路徑C:\\ Jmeterautomation \\ src \\ test \\ jmeter \\ google.jmx

我在此目錄C:\\ Jmeterautomation中創建了pom.xml。

這就是pom的樣子

<?xml version="1.0" encoding="UTF-8"?>
  <project xmlns="http://Maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://Maven.apache.org/POM/4.0.0 http://Maven.apache.org/xsd/Maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.adp.ds.services</groupId>
    <artifactId>01-run-with-Maven</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>pom</packaging>
    <build>
    <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>
     </plugin>
    </plugins>
  </build>
  </project>

當我打開命令窗口並轉到此C:\\ Jmeterautomation並鍵入mvn verify時,出現錯誤,mvn無法識別為內部或外部命令

我已經下載了這個jmeter-maven-plugin-1.4.1.jar並保存在C:\\ Jmeter \\ apache-jmeter-2.13 \\ lib \\ ext中。

我在這里做錯了什么?嘗試了所有我知道的可能的方法,請問是否有任何逐步說明可以通過該過程。 提前致謝

I'm getting error mvn is not recognized as internal or external command 

請先安裝Maven:

https://maven.apache.org/guides/getting-started/windows-prerequisites.html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM