Jmeter-Maven-Plugin高级应用:Adding additional libraries to the classpath

Adding additional libraries to the classpath

You can add any additional Java libraries to JMeter's lib/ext directory by using the<jmeterExtensions> configuration element. This uses the Eclipse Aether libraries to perform dependency resolution.

+---+
<project>
    [...]
        <build>
            <plugins>
                <plugin>
                    <groupId>com.lazerycode.jmeter</groupId>
                    <artifactId>jmeter-maven-plugin</artifactId>
                    <version>2.0.3</version>
                    <executions>
                        <execution>
                            <id>jmeter-tests</id>
                            <goals>
                                <goal>jmeter</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <jmeterExtensions>
                            <artifact>kg.apc:jmeter-plugins:pom:1.3.1</artifact>
                        </jmeterExtensions>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    [...]
</project>
+---+

Adding jar's to the /lib/junit directory

You can add any additional Java libraries to JMeter's lib/junit directory by using the<junitLibraries> configuration element. This uses the Eclipse Aether libraries to perform dependency resolution.

+---+
<project>
    [...]
        <build>
            <plugins>
                <plugin>
                    <groupId>com.lazerycode.jmeter</groupId>
                    <artifactId>jmeter-maven-plugin</artifactId>
                    <version>2.0.3</version>
                    <executions>
                        <execution>
                            <id>jmeter-tests</id>
                            <goals>
                                <goal>jmeter</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <junitLibraries>
                            <artifact>com.lazerycode.junit:junit-test:1.0.0</artifact>
                        </junitLibraries>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    [...]
</project>
posted @ 2016-10-22 11:24  小学生II  阅读(872)  评论(1编辑  收藏  举报