pom.xml中jmeter-maven-plugin配置

Jmeter+Maven构建本地自动化测试

<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.test</groupId>
<artifactId>jmetertest</artifactId>
<version>1.1.0</version>
<packaging>jar</packaging>

<name>test</name>
<url>http://maven.apache.org</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.jmeter</groupId>
<artifactId>ApacheJMeter_java</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.4</version>
</dependency>

</dependencies>

<build>
<plugins>
<!-- execute JMeter test -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>2.9.0</version>
<executions>
<execution>
<id>jmeter-tests</id>
<phase>verify</phase>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
</executions>
<configuration>
<jmeterVersion>5.1.1</jmeterVersion>
<ignoreResultFailures>true</ignoreResultFailures>
<excludedArtifacts>
<exclusion>org.mongodb:mongo-java-driver</exclusion>
</excludedArtifacts>
<jmeterExtensions>
<artifact>com.bill99:jmeter-result-mongodb-collector:3.3.0</artifact>
<!--<artifact>com.bill99:jmeter-monitor-mongodb-collector-plugin:1.1.4</artifact> -->
<artifact>com.bill99.nf.cps.mgw:cps-mgw:1.1.0</artifact>
</jmeterExtensions>
<propertiesUser>
<mongo_host>192.168.65.11</mongo_host>
<mongo_port>27017</mongo_port>
<scenarioname>${group_name}</scenarioname>
<threads>${thread}</threads>
<time>${time}</time>
<test_dataname>${test_dataname}</test_dataname>
<startTime>${startTime}</startTime>
<monitor_time>${monitor_time}</monitor_time>
<monitor_host>${monitor_host}</monitor_host>
<monitor_metric>${monitor_metric}</monitor_metric>
</propertiesUser>
<jMeterProcessJVMSettings>
<xms>2048</xms>
<xmx>2048</xmx>
</jMeterProcessJVMSettings>
<propertiesJMeter>
<sampleresult.default.encoding>UTF-8</sampleresult.default.encoding>
</propertiesJMeter>

<testFilesIncluded>
<jMeterTestFile>${group_name}.jmx</jMeterTestFile>
<!--<jMeterTestFile>mgw-cnp-purchase.jmx</jMeterTestFile>
<jMeterTestFile>mgw-Ind-auth.jmx</jMeterTestFile> -->
</testFilesIncluded>
</configuration>
</plugin>
</plugins>
</build>

</project>

--------------------------------

<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.maven</groupId>
<artifactId>hat</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>hat</name>
<url>http://maven.apache.org</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<build>
<plugins>
<!-- <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin> -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>2.9.0</version>
<executions>
<execution>
<id>jmeter-tests</id>
<phase>verify</phase>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
</executions>
<configuration>
<jmeterVersion>5.1.1</jmeterVersion>
<ignoreResultFailures>true</ignoreResultFailures>
<excludedArtifacts>
<exclusion>org.mongodb:mongo-java-driver</exclusion>
</excludedArtifacts>
<jmeterExtensions>
<artifact>com.bill99:jmeter-result-mongodb-collector:3.3.0</artifact>
</jmeterExtensions>
<jMeterProcessJVMSettings>
<xms>1024</xms>
<xmx>1024</xmx>
</jMeterProcessJVMSettings>
<propertiesUser>
<mongo_host>192.168.65.11</mongo_host>
<mongo_port>27017</mongo_port>
<scenarioname>hat</scenarioname>
<threads>${thread}</threads>
<time>${time}</time>
<ipp>${data_name}</ipp>
<startTime>${startTime}</startTime>
<monitor_time>${monitor_time}</monitor_time>
<monitor_host>${monitor_host}</monitor_host>
<monitor_metric>${monitor_metric}</monitor_metric>
<ramp_up_period>10</ramp_up_period>
<monitor_time>5</monitor_time>
</propertiesUser>
<testFilesIncluded>
hat.jmx
</testFilesIncluded>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>


<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.4</version>
</dependency>

<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
</dependency>

<dependency>
<groupId>org.apache.jmeter</groupId>
<artifactId>ApacheJMeter_java</artifactId>
<version>3.1</version>
</dependency>

<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
</dependencies>
</project>

posted @ 2021-08-10 15:01  up~up  阅读(146)  评论(0编辑  收藏  举报