0

I have created maven project repositories on my local machine successfully. (ref: https://github.com/jmeter-maven-plugin/jmeter-maven-plugin/wiki)

Also, I wrote test scenario in JMeter which works fine.

As per the documents available on internet, I kept my .jmx file in "\src\test\jmeter" directory.

My POM.xml looks like:

<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/maven-
v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.mycompany.app</groupId>
  <artifactId>my-app</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>my-app</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.lazerycode.jmeter</groupId>
                <artifactId>jmeter-maven-plugin</artifactId>
                <version>1.9.0</version>
                <executions>
                    <execution>
                        <id>jmeter-tests</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>jmeter</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </pluginManagement>
</build>
</project>

On running "mvn verify" command , no .jmx file is executed. but "Build Successful" message is displayed.

What am I missing in pom.xml file? What should I do to trigger .jmx file located in "\src\test\jmeter" directory?

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
abhishek
  • 325
  • 1
  • 9
  • 19

2 Answers2

0

Try to remove the <pluginManagement> element from your example. pluginManagement is only a way to share the same plugin configuration across all your project modules. See this question about pluginManagement for details.

Community
  • 1
  • 1
Michael Koch
  • 1,152
  • 11
  • 17
  • Thanks for your reply :) i remove and from above mentioned pom.xml. But on running "mvn verify" "BUILD FAILED" with below error: [ERROR] Plugin com.lazerycode.jmeter:jmeter-maven-plugin:1.9.0 or one of its dependencies could not be resolved: Failure to find com.lazerycode.jmeter :jmeter-maven-plugin:jar:1.9.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1] – abhishek Feb 26 '15 at 08:41
  • Sorry, no idea. It works for me... Maybe you have network problems? You can try running Maven with `-v`, perhaps the verbose output gives you a hint. – Michael Koch Feb 26 '15 at 09:10
  • Ok,What network issue it could be. i dont think its network issue , still i will check once. I didnt get "running maven with -v" can you please elaborate this ? – abhishek Feb 26 '15 at 09:24
  • On `-v`: sorry, I mixed up the Maven options. The option I meant was `-X` for debug output. Try running `mvn -X verify`. You can find documentation on the various Maven options here: http://books.sonatype.com/mvnref-book/reference/running-sect-options.html – Michael Koch Feb 26 '15 at 10:45
  • i tried this "mvn -X verify" , its giving me error "Unable to parse command line options: Unrecognized option: -x" and below that its displaying default options like -a, -b,-B,-C,-D,-cpu,-f,-ff ... etc – abhishek Feb 26 '15 at 11:58
  • `Unrecognized option: -x` Try a capital X instead of a lowercase one. – Michael Koch Feb 26 '15 at 12:57
0

Tests should be stored in:

${project.basedir)/src/test/jmeter

are you trying to store them in a root folder on your hard drive?

Ardesco
  • 7,281
  • 26
  • 49
  • I am storing my tests under the hard drive partition "E:\Folder1\sample-app2". here i kept all scr folder, target folder and pom.xml. Its root folder only, right ? – abhishek Mar 02 '15 at 06:57
  • May be easier if you take a screenshot of your folder structure and show us the log output. From what you have described it should be working – Ardesco Mar 03 '15 at 08:05
  • Folder structure is For Jmx file: "E:\folder1\webapp1.2\src\test\jmeter\MDMNFT_12.jmx" For Pom.xml: E:\folder1\webapp1.2\pom.xml Can you attach a POM.xml which is working fine at your end ? – abhishek Mar 04 '15 at 09:29
  • There is an example here you should be able to just check out and run https://github.com/jmeter-maven-plugin/jmeter-maven-plugin-example – Ardesco Mar 05 '15 at 08:15