Closed DKroot closed 9 months ago
Hi @DKroot,
I've tried to reproduce the issue with a minimal setup. As far as I can tell, the only groovy-dependency in this is 3.0.11
coming with org.apache.jmeter:ApacheJMeter_core:5.5
. So my educated guess is that you use any additional jmeterLibrary
or jmeterPlugin
dependencies which introduce the newer versions as a transitive dependency.
My suggestion would be to call gradlew dependencies
and check which are those libraries and downgrade them to an appropriate version.
If you can not downgrade the main dependency, there would be the possibility to force or exclude the required groovy version (see here) but I wouldn't suggest this as this could lead to other issues.
I don't have jmeterLibrary
nor jmeterPlugin
nor explicit org.apache.jmeter
dependency. Here are my dependencies:
plugins {
//region Server-side stack
id 'java'
/*
Adds Spring Boot tasks and configurations depending on other plug-ins.
The version of this plug-in determines versions of Spring Boot and its BOM (managed dependencies).
NOTE: temporarily enable `spring-boot-properties-migrator` dependency below after all Sprint Boot upgrades.
*/
id 'org.springframework.boot' version '2.6.+'
// Enables using the `spring-boot-dependencies` BOM and Spring Boot Starters inheriting versions from the BOM
id 'io.spring.dependency-management' version '1.0.+'
/*
Adds Lombok dependency to `annotationProcessor` and `compileOnly` configurations of each source set.
The `javadoc` task will be configured to read the `delombok`-ed sources instead of the actual sources.
Recommended to use by Lombok.
*/
id 'io.freefair.lombok' version '6.4.+'
//endregion
//region Client-side stack
// (automatically downloaded) `Node.js` and `npm` support
id 'com.github.node-gradle.node' version '3.4.+'
//endregion
// Basic tasks for building and pushing Docker images: https://github.com/palantir/gradle-docker
// Complemented with custom tasks using `docker` CLI.
id 'com.palantir.docker' version '0.32.+'
// Tasks for starting, stopping, and cleaning up a named container
id 'com.palantir.docker-run' version '0.32.+'
// Performance testing using JMeter
id 'de.qualersoft.jmeter' version '2.4.+'
// Static code analysis using SonarQube
id 'org.sonarqube' version '3.3'
// Prints task metadata and dependency information
id 'org.barfuin.gradle.taskinfo' version '1.4.+'
}
dependencies {
//region Spring Boot-managed dependencies
/*
Versions are specified by the Sprint Boot BOM, which is added by `io.spring.dependency-management`.
See the list of all managed dependencies here:
https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-dependency-versions.html
*/
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
// Core starter, including auto-configuration support, logging and YAML
implementation 'org.springframework.boot:spring-boot-starter'
// Starter for building RESTful web apps using `JAX-RS` and `Jersey`. An alternative to `spring-boot-starter-web`.
implementation 'org.springframework.boot:spring-boot-starter-jersey'
/*
Starter to provide the web app servlet, serving static content using Spring MVC and Tomcat as the default
embedded container.
*/
implementation 'org.springframework.boot:spring-boot-starter-web'
//implementation 'org.springframework.boot:spring-boot-starter-tomcat'
// Starter for using Spring Security
implementation 'org.springframework.boot:spring-boot-starter-security'
// Starter for using Spring Data JPA with Hibernate
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.apache.tomcat:tomcat-jdbc'
//region JDBC drivers
runtimeOnly 'net.sourceforge.jtds:jtds'
runtimeOnly 'com.oracle.database.jdbc:ojdbc11' // for Spring Boot 2.5.+
// runtimeOnly 'com.oracle.database.jdbc:ojdbc10' // for Spring Boot 2.4.x-
//endregion
// Starter for developer testing with JUnit, Hamcrest and Mockito
// `implementation` configuration also enables application use of `MockHttpSession` and `MockHttpServletRequest`
implementation 'org.springframework.boot:spring-boot-starter-test'
implementation 'org.slf4j:slf4j-api'
implementation 'org.slf4j:log4j-over-slf4j'
implementation 'org.apache.commons:commons-lang3'
/*
Spring Boot Developer Tools will be automatically disabled when running a JAR or if the app is started from a
special classloader.
Note: Dev Tools will:
1. Disable the Spring caching options by default
2. Enable DEBUG logging for the web logging group
3. Automatically restart the app whenever files on the classpath change
4. Embed `LiveReload` server
*/
developmentOnly 'org.springframework.boot:spring-boot-devtools'
/*
Prints diagnostics at startup, but also temporarily migrate properties at runtime for you.
*/
// runtimeOnly 'org.springframework.boot:spring-boot-properties-migrator'
//endregion
//region Other dependencies: specific (fixed or dynamic) versions. If you omit a version, the latest will be used.
// Google Guava: a common-purpose library
implementation 'com.google.guava:guava:29.+'
// FindBugs: provides null-check annotations
implementation 'com.google.code.findbugs:jsr305:3.+'
implementation 'io.jsonwebtoken:jjwt-api:0.+'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.+'
runtimeOnly 'io.jsonwebtoken:jjwt-jackson:0.+'
// Support for ANSI color codes on Windows: not working with Logback
// runtimeOnly 'org.fusesource.jansi:jansi:2.3.+'
//implementation 'io.springfox:springfox-boot-starter:3.+'
implementation 'io.springfox:springfox-swagger2:3.+'
//TODO How do we access the Swagger UI?
// implementation 'io.springfox:springfox-swagger-ui:3.+'
implementation 'io.swagger:swagger-jersey2-jaxrs:1.6.+'
// Backward compatibility support for JUnit 4 tests
testImplementation('org.junit.vintage:junit-vintage-engine') {
exclude group: 'org.hamcrest', module: 'hamcrest-core'
}
testImplementation 'com.opengamma.strata:strata-basics:2.+'
//endregion
}
Hi,
with the information you provided, I was able to drill down the issue, at least for the groovy 3.0.17 version, to the io.spring.dependency-management
plugin. The plugin seams to override any dependencies it can find. Also those which are managed by jmeter-plugin.
As this behaviour is out of my hand, please refer to the dependency-management plugin documentation, if there is a possibility to avoid this. If I remember correctly the plugin offer a way to set a fixed version for a dedicated dependency.
Still unclear to me is where the 3.0.13 came from, but I wasn't able to apply all plugins & dependencies. Maybe it's also a side effect of dependency-plugin in combination with those plugins/dependencies.
If you cannot force groovy version to 3.0.11, an alternative approach would be to isolate the jmeter-stuff in an isolated subproject.
Describe the bug The JMeter runs in our project using
id 'de.qualersoft.jmeter' version '2.4+'
. These runs started to fail suddenly with no build changes with the following error in JMeter logs:It happened on a couple of occasions in the last year. Once the runs start to fail, they fail consistently even after total project directory removal and recreation. Troubleshooting of the issue reveals that multiple versions of JMeter dependencies are present in
build/jmeter/lib
. Noticegroovy-3.0.13.jar
andgroovy-3.0.17.jar
. The original JMeter 5.5 distirbution actually hasgroovy-3.0.11.jar
. Hence the dependencies seem to be incorrect: not the ones which come with JMeter.To Reproduce Steps to reproduce the behavior: It's not entirely clear what triggered this, but it might have to do something to do with the global Gradle cache.
Expected behavior
build/jmeter/lib
has to consist of what comes with a particular version of JMeter. Otherwise, the integrity of JMeter is violated, and its behavior can be unpredictable.Data/Screenshots Portions of build.gradle:
System (please complete the following information):
Additional context
I was able to fix this problem for good by doing two things:
${project.buildDir}/jmeter
before eachjmRun
--no-build-cache
Gradle switchDoing just step 1 is not enough.
However, this now means that JMeter gets downloaded on every run.