基於 idea+maven 的 jmeter 開發環境搭建
下文將會詳細描述idea+maven的方式搭建jmeter(v5.3)的二次開發環境
idea、jdk、maven配置自行百度
一、下載jmeter原始碼
如下圖:
二、檢視jmeter core座標
三、新建jmeter工程
四、配置
1. 複製原始碼
2. 新增原jmeter core的依賴庫
<dependencies>
<dependency>
<groupId>org.apache.jmeter</groupId>
<artifactId>ApacheJMeter</artifactId>
<version>5.3</version>
</dependency>
<dependency>
<groupId>org.apache.jmeter</groupId>
<artifactId>jorphan</artifactId>
<version>5.3</version>
</dependency>
<dependency>
<groupId>bsf</groupId>
<artifactId>bsf</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>com.fifesoft</groupId>
<artifactId>rsyntaxtextarea</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>net.sf.jtidy</groupId>
<artifactId>jtidy</artifactId>
<version>r938</version>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.11.1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-1.2-api</artifactId>
<version>2.13.1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.13.1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.13.1</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.13.1</version>
</dependency>
<dependency>
<groupId>org.apiguardian</groupId>
<artifactId>apiguardian-api</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>oro</groupId>
<artifactId>oro</artifactId>
<version>2.0.8</version>
</dependency>
<dependency>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
<version>2.7.2</version>
</dependency>
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>Saxon-HE</artifactId>
<version>9.9.1-7</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.10.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.10.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.10.3</version>
</dependency>
<dependency>
<groupId>com.formdev</groupId>
<artifactId>svgSalamander</artifactId>
<version>1.1.2.1</version>
</dependency>
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>com.github.weisj</groupId>
<artifactId>darklaf-core</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>com.github.weisj</groupId>
<artifactId>darklaf-theme</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>com.github.weisj</groupId>
<artifactId>darklaf-property-loader</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>com.miglayout</groupId>
<artifactId>miglayout-swing</artifactId>
<version>5.2</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.14</version>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.10</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
<version>3.6.1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.8</version>
</dependency>
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-core</artifactId>
<version>1.24.1</version>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>xmlgraphics-commons</artifactId>
<version>2.3</version>
</dependency>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.30</version>
</dependency>
<dependency>
<groupId>org.jodd</groupId>
<artifactId>jodd-core</artifactId>
<version>5.0.13</version>
</dependency>
<dependency>
<groupId>org.jodd</groupId>
<artifactId>jodd-props</artifactId>
<version>5.0.13</version>
</dependency>
<dependency>
<groupId>org.mozilla</groupId>
<artifactId>rhino</artifactId>
<version>1.7.12</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.30</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-datetime</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-jmx</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-json</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-jsr223</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-sql</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-templates</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika-parsers</artifactId>
<version>1.24.1</version>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.12.0</version>
</dependency>
<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>1.4.01</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.66</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.12</version>
</dependency>
</dependencies>
3. build標籤
<build>
<plugins>
<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>
<encoding>utf-8</encoding>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.*</include>
</includes>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.html</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</build>
4. 修改JMeterUtils.java
在做了如上的一些操作後,還需要對JMeterUtils.java類的2個方法做處理,如下
修改前:
public static String getJMeterVersion() {
return JMeterVersion.getVERSION();
}
public static String getJMeterCopyright() {
return JMeterVersion.getCopyRight();
}
修改後:
public static String getJMeterVersion() {
return "5.3";
}
public static String getJMeterCopyright() {
return "Copyright (c) 1998-@YEAR@ The Apache Software Foundation";
}
做完如上的步驟後:jmeter core模組的二次開發環境即搭建完畢
注:
a.若要搭建jmeter其他模組開發環境,可依法炮製;
b.打包後,替換$JMETER_HOME/lib/ext/ApacheJMeter_core.jar包(唯一的問題是會導致jmeter GUI介面文字亂碼,而一般是命令列模式下執行,此小問題可忽略)
相關文章
- 搭建基於 Mac 的 Flutter 開發環境MacFlutter開發環境
- 基於Webpack搭建React開發環境WebReact開發環境
- 基於IDEA的JavaWeb開發環境搭建IdeaJavaWeb開發環境
- 基於 Xcode 搭建 OpenCV 開發環境XCodeOpenCV開發環境
- 基於滴滴雲搭建 Ceph 開發環境開發環境
- 基於 vagrant搭建移動端的開發環境開發環境
- 基於 Webpack4 搭建 Vue 開發環境WebVue開發環境
- 基於PHPnow搭建Eclipse開發環境PHPEclipse開發環境
- 基於Docker搭建PHP+Nginx+MySQL開發環境DockerPHPNginxMySql開發環境
- 基於mpvue框架搭建微信小程式開發環境Vue框架微信小程式開發環境
- 基於spring boot 及mybatis的web開發環境搭建Spring BootMyBatisWeb開發環境
- 基於Docker的LNMP開發環境DockerLNMP開發環境
- React基礎——快速搭建開發環境React開發環境
- 在windows環境下基於sublime text3的node.js開發環境搭建WindowsNode.js開發環境
- 自然語言處理之:搭建基於HanLP的開發環境自然語言處理HanLP開發環境
- flutter開發系列(搭建基礎的flutter環境)Flutter
- 基於Docker搭建LNMP環境DockerLNMP
- Vite ❤ Electron——基於Vite搭建Electron+Vue3的開發環境【一】ViteVue開發環境
- 搭建vue的開發環境Vue開發環境
- WinCE開發環境的搭建開發環境
- Python基礎:搭建開發環境(1)Python開發環境
- PHP基礎教程-04 開發環境搭建PHP開發環境
- 一鍵搭建基於docker的nodejs、php開發環境 (開源專案)DockerNodeJSPHP開發環境
- 如何基於Jupyter notebook搭建Spark叢集開發環境Spark開發環境
- 從零開始搭建一個簡單的基於webpack的vue開發環境WebVue開發環境
- 1 – 搭建開發環境開發環境
- rollup 開發環境搭建開發環境
- 搭建go開發環境Go開發環境
- Androdi開發環境搭建開發環境
- 前端開發環境搭建前端開發環境
- Theia 開發環境搭建開發環境
- QEMU 開發環境搭建開發環境
- Cordova 開發環境搭建開發環境
- 搭建VUE開發環境Vue開發環境
- 安卓開發環境搭建安卓開發環境
- 搭建Layui開發環境UI開發環境
- 搭建scala開發環境開發環境
- EBS開發環境搭建開發環境