jmeter-gradle-plugin icon indicating copy to clipboard operation
jmeter-gradle-plugin copied to clipboard

Still getting dependency errors due to bogus JMeter 2.13 POM file

Open bobtins opened this issue 9 years ago • 4 comments

Using gradle 2.4.

build.gradle:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath "com.github.kulya:jmeter-gradle-plugin:1.3.4-2.13"
        classpath group: 'kg.apc', name: 'jmeter-plugins-standard', version: '1.2.1'
    }
}

apply plugin: 'jmeter'

jmeterRun.configure {
    includes = [ "REST_create_orgs_10.jmx" ]
    jmeterPluginJars = [ "groovy-all", "jmeter-plugins-standard" ]
}

output:

$ gradle --refresh-dependencies jmeterRun |tee g.out
POM relocation to an other version number is not fully supported in Gradle : xml-apis#xml-apis;2.0.2 relocated to xml-apis#xml-apis;1.0.b2.
Please update your dependency to directly use the correct version 'xml-apis#xml-apis;1.0.b2'.
Resolution will only pick dependencies of the relocated element.  Artifacts and other metadata will be ignored.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'performance'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not find commons-math3:commons-math3:3.4.1.
     Searched in the following locations:
         https://repo1.maven.org/maven2/commons-math3/commons-math3/3.4.1/commons-math3-3.4.1.pom
         https://repo1.maven.org/maven2/commons-math3/commons-math3/3.4.1/commons-math3-3.4.1.jar
     Required by:
         :performance:unspecified > com.github.kulya:jmeter-gradle-plugin:1.3.4-2.13 > org.apache.jmeter:ApacheJMeter_core:2.13
         :performance:unspecified > com.github.kulya:jmeter-gradle-plugin:1.3.4-2.13 > org.apache.jmeter:ApacheJMeter_http:2.13
         :performance:unspecified > com.github.kulya:jmeter-gradle-plugin:1.3.4-2.13 > org.apache.jmeter:ApacheJMeter_components:2.13
         :performance:unspecified > kg.apc:jmeter-plugins-standard:1.2.1 > org.apache.jmeter:jorphan:2.13
   > Could not find commons-pool2:commons-pool2:2.3.
     Searched in the following locations:
         https://repo1.maven.org/maven2/commons-pool2/commons-pool2/2.3/commons-pool2-2.3.pom
         https://repo1.maven.org/maven2/commons-pool2/commons-pool2/2.3/commons-pool2-2.3.jar
     Required by:
         :performance:unspecified > com.github.kulya:jmeter-gradle-plugin:1.3.4-2.13 > org.apache.jmeter:ApacheJMeter_core:2.13
         :performance:unspecified > com.github.kulya:jmeter-gradle-plugin:1.3.4-2.13 > org.apache.jmeter:ApacheJMeter_http:2.13
         :performance:unspecified > com.github.kulya:jmeter-gradle-plugin:1.3.4-2.13 > org.apache.jmeter:ApacheJMeter_components:2.13
         :performance:unspecified > kg.apc:jmeter-plugins-standard:1.2.1 > org.apache.jmeter:jorphan:2.13

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 38.381 secs

It's not a bug in the plugin code or config, it's a problem with the ApacheJMeter_parent POM file. I saw the exclusions in the plugin POM, but for some reason they are not taking effect for the JMeter core, http, or components...is that because they are really getting dependencies from the parent POM?

Workaround was to create a local filesystem Maven repo with the fixed ApacheJMeter_parent POM file, and configure it in build.gradle:

buildscript {
    repositories {
        maven {
            url "file:/f:/projects/performance/fix-pom-repo"
        }
        mavenCentral()
    }
...

bobtins avatar Jun 11 '15 18:06 bobtins

is that because they are really getting dependencies from the parent POM

The POM exclusions are exactly to get around this. Last I tested, it seemed to work fine. Will try and reproduce this. Only difference that stands out is gradle version. Can you check with gradle v2.3 please?

foragerr avatar Jun 11 '15 18:06 foragerr

Just downloaded gradle 2.3, switched my path to it, tried again, and got the same result. I agree that the POM exclusions should fix this. The confusing thing is that there are a whole lot more ApacheJMeter_* POMs that use the problematic ApacheJMeter_parent which work (like _ftp, _ldap, etc.), but only _core, _http, _components, and jorphan seem to ignore the exclusion. Should I try blowing away my cache? I just turned on --debug so I'm going to see if I can make any sense of it. BTW, I am just getting started with Gradle, but I have a lot of experience with Maven and Groovy. This "dependency hell" is what I hate about Maven...someone screws up a POM file and wastes days of people's time. :rage: Also, is there another way to discuss the plugin besides logging an issue? I'm a newbie at Github too. :baby: Thanks for the quick response!

bobtins avatar Jun 12 '15 17:06 bobtins

Hit this same issue in Maven with:

        <dependency>
            <groupId>org.apache.jmeter</groupId>
            <artifactId>ApacheJMeter_core</artifactId>
            <version>2.13</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.jmeter</groupId>
            <artifactId>ApacheJMeter_java</artifactId>
            <version>2.13</version>
            <scope>provided</scope>
        </dependency>

dkirrane avatar Nov 11 '15 15:11 dkirrane

@dkirrane are you facing this problem while using this plugin? Or do you mean with jmeter 2.13 and maven in general?

for jmeter and maven, adding these exclusions helps:

  <exclusions>
    <exclusion>
      <artifactId>commons-math3</artifactId>
      <groupId>commons-math3</groupId>
    </exclusion>
    <exclusion>
      <artifactId>commons-pool2</artifactId>
      <groupId>commons-pool2</groupId>
    </exclusion>
  </exclusions>

As for this plugin, since we cant find the project owner, I started maintaining a fork over at https://github.com/jmeter-gradle-plugin/jmeter-gradle-plugin This issue is currently fixed, with some additional enhancements as well. If you face any issues with it, feel free to raise a new issue over there - I'll try to help you out.

foragerr avatar Nov 12 '15 00:11 foragerr