Skip to content

plugin incorrectly filters out project's jar and test-jar #418

@shawnmckinney

Description

@shawnmckinney

Problem:

Jmeter plugin will filter out testPlan libraries when setting both the project's main and test jars. For example:

<testPlanLibraries>
  <artifact>org.apache.directory.fortress:fortress-core:jar:tests:${project.version}</artifact>
  <artifact>org.apache.directory.fortress:fortress-core:${project.version}</artifact>
  ...
</testPlanLibraries>

When I run a test, will get:

2022-01-14 15:54:31,095 ERROR o.a.j.JMeter: Uncaught exception in thread Thread[StandardJMeterEngine,5,main]
java.lang.NoClassDefFoundError: org/apache/directory/fortress/core/SecurityException

Note, that class is contained within the fortress-core artifact. So when I view the contents of

$ ls target/9998d2e4-c17b-4992-b3c5-c925e4651ae9/jmeter/lib/fortress-core*
target/9998d2e4-c17b-4992-b3c5-c925e4651ae9/jmeter/lib/fortress-core-2.0.8-SNAPSHOT-tests.jar

Older version of the plugin didn't have this problem:

<plugin>
  <groupId>com.lazerycode.jmeter</groupId>
  <artifactId>jmeter-maven-plugin</artifactId>
  <version>1.10.1</version>
  ...
            <dependencies>
              <dependency>
                <groupId>org.apache.directory.fortress</groupId>
                <artifactId>fortress-core</artifactId>
                <version>${project.version}</version>
              </dependency>
              <dependency>
                <groupId>org.apache.directory.fortress</groupId>
                <artifactId>fortress-core</artifactId>
                <type>test-jar</type>
                <version>${project.version}</version>
              </dependency>
$ ls target/jmeter/lib/fortress-core*
target/jmeter/lib/fortress-core-2.0.8-SNAPSHOT.jar  target/jmeter/lib/fortress-core-2.0.8-SNAPSHOT-tests.jar

The older version is the correct behavior. There is no workaround for this problem that I know of. It prevents projects from pulling from both the main and tests jars for running jmeter.

I also described this problem on the ML but have not yet received a response:
https://groups.google.com/g/maven-jmeter-plugin-users/c/HhH7T1Q34M8

I'm happy to help test and document a fix, as needed, but don't have any experience developing maven plugins. Would be willing to take this on if someone from the project would mentor.

Thanks

--
Shawn

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions