spring-cloud / spring-cloud-contract

Support for Consumer Driven Contracts in Spring
https://cloud.spring.io/spring-cloud-contract
Apache License 2.0
720 stars 439 forks source link

Unsupported class file major version 65 with Java21 and Springboot 3.2.1 #2084

Closed framilano closed 6 months ago

framilano commented 10 months ago

Environment:

Description: The issue appears while generating tests using spring-cloud-contract-verifier, it only happens with Java21, reverting to Java17 fixes it. I can easily reproduce the issue doing mvn clean package, here's the stacktrace (I had to hide a bunch of paths for privacy reasons):

--- spring-cloud-contract:4.1.0:generateTests (default-generateTests) @ project ---
[INFO] Generating server tests source code for Spring Cloud Contract Verifier contract verification
[INFO] Will use contracts provided in the folder [path/to/my/contracts]
[INFO] Directory with contract is present at [/path/to/my/contracts]
[INFO] Test Source directory: /path/to/my/test/sources/contracts added.
[INFO] Using [name.of.my.basecontractclass] as base class for test classes, [null] as base package for tests, [null] as package with base classes, base class mappings []
[ERROR] Exception occurred while trying to evaluate the contract at path [/path/to/my/groovy/file]
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
General error during conversion: Unsupported class file major version 65
java.lang.IllegalArgumentException: Unsupported class file major version 65
    at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:199)
    at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:180)
    at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:166)
    at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:287)
    at org.codehaus.groovy.ast.decompiled.AsmDecompiler.parseClass(AsmDecompiler.java:83)
    at org.codehaus.groovy.control.ClassNodeResolver.findDecompiled(ClassNodeResolver.java:255)
    at org.codehaus.groovy.control.ClassNodeResolver.tryAsLoaderClassOrScript(ClassNodeResolver.java:193)
    at org.codehaus.groovy.control.ClassNodeResolver.findClassNode(ClassNodeResolver.java:175)
    at org.codehaus.groovy.control.ClassNodeResolver.resolveName(ClassNodeResolver.java:129)
    at org.codehaus.groovy.ast.decompiled.AsmReferenceResolver.resolveClassNullable(AsmReferenceResolver.java:57)
    at org.codehaus.groovy.ast.decompiled.AsmReferenceResolver.resolveClass(AsmReferenceResolver.java:44)
    at org.codehaus.groovy.ast.decompiled.TypeSignatureParser.visitEnd(TypeSignatureParser.java:113)
    at groovyjarjarasm.asm.signature.SignatureReader.parseType(SignatureReader.java:206)
    at groovyjarjarasm.asm.signature.SignatureReader.accept(SignatureReader.java:122)
    at org.codehaus.groovy.ast.decompiled.ClassSignatureParser.parseClassSignature(ClassSignatureParser.java:104)
    at org.codehaus.groovy.ast.decompiled.ClassSignatureParser.configureClass(ClassSignatureParser.java:36)
    at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.lazyInitSupers(DecompiledClassNode.java:222)
    at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.isUsingGenerics(DecompiledClassNode.java:87)
    at org.codehaus.groovy.ast.tools.GenericsUtils.nonGeneric(GenericsUtils.java:297)
    at org.codehaus.groovy.ast.decompiled.MemberSignatureParser.createMethodNode(MemberSignatureParser.java:107)
    at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.lambda$createMethodNode$1(DecompiledClassNode.java:266)
    at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.createMethodNode(DecompiledClassNode.java:272)
    at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.lazyInitMembers(DecompiledClassNode.java:239)
    at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.getDeclaredMethods(DecompiledClassNode.java:123)
    at org.codehaus.groovy.ast.ClassNode.getDeclaredMethods(ClassNode.java:888)
    at org.codehaus.groovy.ast.ClassNode.getMethods(ClassNode.java:903)
    at org.apache.groovy.ast.tools.ClassNodeUtils.hasPossibleStaticMethod(ClassNodeUtils.java:252)
    at org.codehaus.groovy.ast.ClassNode.hasPossibleStaticMethod(ClassNode.java:1364)
    at org.codehaus.groovy.control.StaticImportVisitor.findStaticMethod(StaticImportVisitor.java:591)
    at org.codehaus.groovy.control.StaticImportVisitor.findStaticPropertyAccessorByFullName(StaticImportVisitor.java:525)
    at org.codehaus.groovy.control.StaticImportVisitor.findStaticPropertyAccessor(StaticImportVisitor.java:543)
    at org.codehaus.groovy.control.StaticImportVisitor.findStaticPropertyOrField(StaticImportVisitor.java:558)
    at org.codehaus.groovy.control.StaticImportVisitor.findStaticFieldOrPropertyAccessorImportFromModule(StaticImportVisitor.java:411)
    at org.codehaus.groovy.control.StaticImportVisitor.transformVariableExpression(StaticImportVisitor.java:221)
    at org.codehaus.groovy.control.StaticImportVisitor.transform(StaticImportVisitor.java:121)
    at org.codehaus.groovy.control.StaticImportVisitor.transformMethodCallExpression(StaticImportVisitor.java:244)
    at org.codehaus.groovy.control.StaticImportVisitor.transform(StaticImportVisitor.java:130)
    at org.codehaus.groovy.ast.expr.Expression.transformExpressions(Expression.java:49)
    at org.codehaus.groovy.ast.expr.ArgumentListExpression.transformExpression(ArgumentListExpression.java:67)
    at org.codehaus.groovy.control.StaticImportVisitor.transform(StaticImportVisitor.java:139)
    at org.codehaus.groovy.control.StaticImportVisitor.transformMethodCallExpression(StaticImportVisitor.java:246)
    at org.codehaus.groovy.control.StaticImportVisitor.transform(StaticImportVisitor.java:130)
    at org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitExpressionStatement(ClassCodeExpressionTransformer.java:108)
    at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:41)
    at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:86)
    at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:168)
    at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:70)
    at org.codehaus.groovy.control.StaticImportVisitor.transformClosureExpression(StaticImportVisitor.java:347)
    at org.codehaus.groovy.control.StaticImportVisitor.transform(StaticImportVisitor.java:133)
    at org.codehaus.groovy.ast.expr.Expression.transformExpressions(Expression.java:49)
    at org.codehaus.groovy.ast.expr.ArgumentListExpression.transformExpression(ArgumentListExpression.java:67)
    at org.codehaus.groovy.control.StaticImportVisitor.transform(StaticImportVisitor.java:139)
    at org.codehaus.groovy.control.StaticImportVisitor.transformMethodCallExpression(StaticImportVisitor.java:246)
    at org.codehaus.groovy.control.StaticImportVisitor.transform(StaticImportVisitor.java:130)
    at org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitExpressionStatement(ClassCodeExpressionTransformer.java:108)
    at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:41)
    at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:86)
    at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:168)
    at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:70)
    at org.codehaus.groovy.control.StaticImportVisitor.transformClosureExpression(StaticImportVisitor.java:347)
    at org.codehaus.groovy.control.StaticImportVisitor.transform(StaticImportVisitor.java:133)
    at org.codehaus.groovy.ast.expr.Expression.transformExpressions(Expression.java:49)
    at org.codehaus.groovy.ast.expr.ArgumentListExpression.transformExpression(ArgumentListExpression.java:67)
    at org.codehaus.groovy.control.StaticImportVisitor.transform(StaticImportVisitor.java:139)
    at org.codehaus.groovy.control.StaticImportVisitor.transformMethodCallExpression(StaticImportVisitor.java:246)
    at org.codehaus.groovy.control.StaticImportVisitor.transform(StaticImportVisitor.java:130)
    at org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitExpressionStatement(ClassCodeExpressionTransformer.java:108)
    at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:41)
    at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:86)
    at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:168)
    at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:70)
    at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:142)
    at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:115)
    at org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitConstructorOrMethod(ClassCodeExpressionTransformer.java:66)
    at org.codehaus.groovy.control.StaticImportVisitor.visitConstructorOrMethod(StaticImportVisitor.java:104)
    at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:110)
    at org.codehaus.groovy.ast.ClassNode.visitMethods(ClassNode.java:1135)
    at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1128)
    at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:52)
    at org.codehaus.groovy.control.CompilationUnit.lambda$addPhaseOperations$4(CompilationUnit.java:210)
    at org.codehaus.groovy.control.CompilationUnit$IPrimaryClassNodeOperation.doPhaseOperation(CompilationUnit.java:900)
    at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:654)
    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:628)
    at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:368)
    at groovy.lang.GroovyClassLoader.lambda$parseClass$2(GroovyClassLoader.java:311)
    at org.codehaus.groovy.runtime.memoize.StampedCommonCache.compute(StampedCommonCache.java:163)
    at org.codehaus.groovy.runtime.memoize.StampedCommonCache.getAndPut(StampedCommonCache.java:154)
    at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:309)
    at groovy.lang.GroovyShell.parseClass(GroovyShell.java:543)
    at groovy.lang.GroovyShell.parse(GroovyShell.java:556)
    at groovy.lang.GroovyShell.parse(GroovyShell.java:568)
    at groovy.lang.GroovyShell.evaluate(GroovyShell.java:431)
    at groovy.lang.GroovyShell.evaluate(GroovyShell.java:475)
    at org.springframework.cloud.contract.verifier.util.ContractVerifierDslConverter.toObject(ContractVerifierDslConverter.java:157)
    at org.springframework.cloud.contract.verifier.util.ContractVerifierDslConverter.convertAsCollection(ContractVerifierDslConverter.java:110)
    at org.springframework.cloud.contract.verifier.file.ContractFileScanner.appendRecursively(ContractFileScanner.java:130)
    at org.springframework.cloud.contract.verifier.file.ContractFileScanner.findContractsRecursively(ContractFileScanner.java:102)
    at org.springframework.cloud.contract.verifier.TestGenerator.generateTestClasses(TestGenerator.java:131)
    at org.springframework.cloud.contract.verifier.TestGenerator.generate(TestGenerator.java:111)
    at org.springframework.cloud.contract.maven.verifier.GenerateTestsMojo.execute(GenerateTestsMojo.java:296)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:328)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000(MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run(MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute(DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:206)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
    at java.base/java.lang.reflect.Method.invoke(Method.java:580)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:348)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
1 error
    at org.codehaus.groovy.control.ErrorCollector.failIfErrors (ErrorCollector.java:295)
    at org.codehaus.groovy.control.ErrorCollector.addException (ErrorCollector.java:143)
    at org.codehaus.groovy.control.CompilationUnit$IPrimaryClassNodeOperation.doPhaseOperation (CompilationUnit.java:934)
    at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations (CompilationUnit.java:654)
    at org.codehaus.groovy.control.CompilationUnit.compile (CompilationUnit.java:628)
    at groovy.lang.GroovyClassLoader.doParseClass (GroovyClassLoader.java:368)
    at groovy.lang.GroovyClassLoader.lambda$parseClass$2 (GroovyClassLoader.java:311)
    at org.codehaus.groovy.runtime.memoize.StampedCommonCache.compute (StampedCommonCache.java:163)
    at org.codehaus.groovy.runtime.memoize.StampedCommonCache.getAndPut (StampedCommonCache.java:154)
    at groovy.lang.GroovyClassLoader.parseClass (GroovyClassLoader.java:309)
    at groovy.lang.GroovyShell.parseClass (GroovyShell.java:543)
    at groovy.lang.GroovyShell.parse (GroovyShell.java:556)
    at groovy.lang.GroovyShell.parse (GroovyShell.java:568)
    at groovy.lang.GroovyShell.evaluate (GroovyShell.java:431)
    at groovy.lang.GroovyShell.evaluate (GroovyShell.java:475)
    at org.springframework.cloud.contract.verifier.util.ContractVerifierDslConverter.toObject (ContractVerifierDslConverter.java:157)
    at org.springframework.cloud.contract.verifier.util.ContractVerifierDslConverter.convertAsCollection (ContractVerifierDslConverter.java:110)
    at org.springframework.cloud.contract.verifier.file.ContractFileScanner.appendRecursively (ContractFileScanner.java:130)
    at org.springframework.cloud.contract.verifier.file.ContractFileScanner.findContractsRecursively (ContractFileScanner.java:102)
    at org.springframework.cloud.contract.verifier.TestGenerator.generateTestClasses (TestGenerator.java:131)
    at org.springframework.cloud.contract.verifier.TestGenerator.generate (TestGenerator.java:111)
    at org.springframework.cloud.contract.maven.verifier.GenerateTestsMojo.execute (GenerateTestsMojo.java:296)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103)
    at java.lang.reflect.Method.invoke (Method.java:580)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
    at org.codehaus.classworlds.Launcher.main (Launcher.java:47)

The strange thing is that simply packaging the application three times solves the issue. First mvn package generates the same exception, the second one too, the third one too, the fourth one is fixed. I see in /target that even if the exception is thrown the stubs get created correctly, obviously doing a mvn clean resets the situation. Here's my dependencies:

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-contract-verifier</artifactId>
        <version>4.1.0</version>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-contract-stub-runner</artifactId>
        <version>4.1.0</version>
    <scope>test</scope>
</dependency>

Here's my plugins configuration:

<plugins>
    <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
    </plugin>

    <plugin>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-contract-maven-plugin</artifactId>
        <version>4.1.0</version>
        <extensions>true</extensions>
        <configuration>
            <baseClassForTests>path.to.my.basecontract.class</baseClassForTests>
            <testMode>EXPLICIT</testMode>
        </configuration>
    </plugin>
</plugins>

Every single dependency is up-to-date, I tried to manually update inside the POM every outdated dependency present in spring-cloud-contract-verifier but with no success. Any idea on what is happening? Is java21 simply not supported right now?

marcingrzejszczak commented 10 months ago

It seems that Groovy 4.x doesn't work with JDK 21. I can't find any compatibility matrix other than this link

framilano commented 10 months ago

It seems that Groovy 4.x doesn't work with JDK 21. I can't find any compatibility matrix other than this link

I even tried updating manually to groovy alpha versions 5.0.0 released in December, no luck, kinda weird that there's still no real support for an LTS version of Java after 4 months, no?

marcingrzejszczak commented 10 months ago

Have you tried updating manually to groovy 5 alpha in Spring Cloud Contract and that didn't help?

framilano commented 10 months ago

Have you tried updating manually to groovy 5 alpha in Spring Cloud Contract and that didn't help?

Exactly, same issue

I tried with this (looking at dependency analyzer in Intellij)

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-contract-stub-runner</artifactId>
    <exclusions>
        <exclusion>
            <groupId>org.apache.groovy</groupId>
            <artifactId>groovy</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.apache.groovy</groupId>
            <artifactId>groovy-json</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.apache.groovy</groupId>
            <artifactId>groovy-nio</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.apache.groovy</groupId>
            <artifactId>groovy-xml</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-contract-verifier</artifactId>
    <exclusions>
        <exclusion>
            <groupId>org.apache.groovy</groupId>
            <artifactId>groovy</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.apache.groovy</groupId>
            <artifactId>groovy-json</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.apache.groovy</groupId>
            <artifactId>groovy-nio</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.apache.groovy</groupId>
            <artifactId>groovy-xml</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>org.apache.groovy</groupId>
    <artifactId>groovy-json</artifactId>
    <version>5.0.0-alpha-4</version>
</dependency>
<dependency>
    <groupId>org.apache.groovy</groupId>
    <artifactId>groovy-nio</artifactId>
    <version>5.0.0-alpha-4</version>
</dependency>
<dependency>
    <groupId>org.apache.groovy</groupId>
    <artifactId>groovy-xml</artifactId>
    <version>5.0.0-alpha-4</version>
</dependency>

Still no luck

namannigam commented 10 months ago

@framilano Can you confirm that executing mvn dependency:tree on your updated code lists a version of org.ow2.asm:asm:jar which is 9.5 and above? In the same output, you shall be able to see the tree from where the incorrect ASM jar is being still pulled in.

As for a hit and trial(without being able to actually execute the project) can you see if this kinda helps

        ... 
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-contract-verifier</artifactId>
            <version>4.1.0</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-contract-stub-runner</artifactId>
            <version>4.1.0</version>
            <scope>test</scope>
        </dependency>
        <!--Explicitly override the asm dependency resolution-->
        <dependency>
            <groupId>org.ow2.asm</groupId>
            <artifactId>asm</artifactId>
            <version>9.6</version>
        </dependency>
        ...
namannigam commented 10 months ago

@marcingrzejszczak Just to add slightly more information, independently adding the mentioned spring dependencies spring-cloud-contract-verifier and spring-cloud-starter-contract-stub-runner brings in the outdated version os asm via this tree:

[INFO] |  +- com.toomuchcoding.jsonassert:jsonassert:jar:0.7.0:test
[INFO] |  |  +- com.jayway.jsonpath:json-path:jar:2.8.0:test
[INFO] |  |  +- net.minidev:json-smart:jar:2.5.0:test
[INFO] |  |  |  \- net.minidev:accessors-smart:jar:2.5.0:test
[INFO] |  |  |     \- org.ow2.asm:asm:jar:9.3:test
framilano commented 10 months ago

@namannigam There's noorg.ow2.asm:asm:jar in my dependencies tree, I checked with mvn dependency:tree

I tried your suggested pom dependencies but still, same exact result.

namannigam commented 10 months ago

@framilano In that case, if not the exact group and artifact, there could be some other resolution of the asm in your tree for sure which is where the ClassReader would get loaded from and without which groovy cannot generate the byte code. But it would be helpful if you could share a "minimal, complete and verifiable example" (MCVE

framilano commented 10 months ago

@namannigam I'm an idiot, actually there's org.ow2.asm in my dependencies tree (I was checking the wrong project, here's my dependency tree). Anyway, even with the updated asm to 9.6, still no difference.

[INFO] +- org.springframework.boot:spring-boot-starter-webflux:jar:3.2.1:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter:jar:3.2.1:compile
[INFO] |  |  +- org.springframework.boot:spring-boot:jar:3.2.1:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-autoconfigure:jar:3.2.1:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-logging:jar:3.2.1:compile
[INFO] |  |  |  +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.21.1:compile
[INFO] |  |  |  |  \- org.apache.logging.log4j:log4j-api:jar:2.21.1:compile
[INFO] |  |  |  \- org.slf4j:jul-to-slf4j:jar:2.0.9:compile
[INFO] |  |  \- jakarta.annotation:jakarta.annotation-api:jar:2.1.1:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-json:jar:3.2.1:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.15.3:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.15.3:compile
[INFO] |  |  \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.15.3:compile
[INFO] |  +- org.springframework.boot:spring-boot-starter-reactor-netty:jar:3.2.1:compile
[INFO] |  |  \- io.projectreactor.netty:reactor-netty-http:jar:1.1.14:compile
[INFO] |  |     +- io.netty:netty-codec-http:jar:4.1.104.Final:compile
[INFO] |  |     |  +- io.netty:netty-common:jar:4.1.104.Final:compile
[INFO] |  |     |  +- io.netty:netty-buffer:jar:4.1.104.Final:compile
[INFO] |  |     |  +- io.netty:netty-transport:jar:4.1.104.Final:compile
[INFO] |  |     |  +- io.netty:netty-codec:jar:4.1.104.Final:compile
[INFO] |  |     |  \- io.netty:netty-handler:jar:4.1.104.Final:compile
[INFO] |  |     +- io.netty:netty-codec-http2:jar:4.1.104.Final:compile
[INFO] |  |     +- io.netty:netty-resolver-dns:jar:4.1.104.Final:compile
[INFO] |  |     |  +- io.netty:netty-resolver:jar:4.1.104.Final:compile
[INFO] |  |     |  \- io.netty:netty-codec-dns:jar:4.1.104.Final:compile
[INFO] |  |     +- io.netty:netty-resolver-dns-native-macos:jar:osx-x86_64:4.1.104.Final:compile
[INFO] |  |     |  \- io.netty:netty-resolver-dns-classes-macos:jar:4.1.104.Final:compile
[INFO] |  |     +- io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.104.Final:compile
[INFO] |  |     |  +- io.netty:netty-transport-native-unix-common:jar:4.1.104.Final:compile
[INFO] |  |     |  \- io.netty:netty-transport-classes-epoll:jar:4.1.104.Final:compile
[INFO] |  |     \- io.projectreactor.netty:reactor-netty-core:jar:1.1.14:compile
[INFO] |  |        \- io.netty:netty-handler-proxy:jar:4.1.104.Final:compile
[INFO] |  |           \- io.netty:netty-codec-socks:jar:4.1.104.Final:compile
[INFO] |  +- org.springframework:spring-web:jar:6.1.2:compile
[INFO] |  \- org.springframework:spring-webflux:jar:6.1.2:compile
[INFO] +- ch.qos.logback:logback-classic:jar:1.4.14:compile
[INFO] |  \- org.slf4j:slf4j-api:jar:2.0.9:compile
[INFO] +- ch.qos.logback:logback-core:jar:1.4.14:compile
[INFO] +- org.springframework.boot:spring-boot-starter-actuator:jar:3.2.1:compile
[INFO] |  +- org.springframework.boot:spring-boot-actuator-autoconfigure:jar:3.2.1:compile
[INFO] |  |  \- org.springframework.boot:spring-boot-actuator:jar:3.2.1:compile
[INFO] |  +- io.micrometer:micrometer-observation:jar:1.12.1:compile
[INFO] |  |  \- io.micrometer:micrometer-commons:jar:1.12.1:compile
[INFO] |  \- io.micrometer:micrometer-jakarta9:jar:1.12.1:compile
[INFO] +- org.springframework.boot:spring-boot-starter-test:jar:3.2.1:test
[INFO] |  +- org.springframework.boot:spring-boot-test:jar:3.2.1:test
[INFO] |  +- org.springframework.boot:spring-boot-test-autoconfigure:jar:3.2.1:test
[INFO] |  +- com.jayway.jsonpath:json-path:jar:2.8.0:test
[INFO] |  +- jakarta.xml.bind:jakarta.xml.bind-api:jar:4.0.1:test
[INFO] |  |  \- jakarta.activation:jakarta.activation-api:jar:2.1.2:test
[INFO] |  +- net.minidev:json-smart:jar:2.5.0:test
[INFO] |  |  \- net.minidev:accessors-smart:jar:2.5.0:test
[INFO] |  +- org.assertj:assertj-core:jar:3.24.2:test
[INFO] |  |  \- net.bytebuddy:byte-buddy:jar:1.14.10:test
[INFO] |  +- org.awaitility:awaitility:jar:4.2.0:test
[INFO] |  +- org.hamcrest:hamcrest:jar:2.2:compile
[INFO] |  +- org.junit.jupiter:junit-jupiter:jar:5.10.1:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-params:jar:5.10.1:test
[INFO] |  |  \- org.junit.jupiter:junit-jupiter-engine:jar:5.10.1:test
[INFO] |  |     \- org.junit.platform:junit-platform-engine:jar:1.10.1:test
[INFO] |  +- org.mockito:mockito-core:jar:5.7.0:test
[INFO] |  |  +- net.bytebuddy:byte-buddy-agent:jar:1.14.10:test
[INFO] |  |  \- org.objenesis:objenesis:jar:3.3:test
[INFO] |  +- org.mockito:mockito-junit-jupiter:jar:5.7.0:test
[INFO] |  +- org.skyscreamer:jsonassert:jar:1.5.1:test
[INFO] |  |  \- com.vaadin.external.google:android-json:jar:0.0.20131108.vaadin1:test
[INFO] |  +- org.springframework:spring-core:jar:6.1.2:compile
[INFO] |  |  \- org.springframework:spring-jcl:jar:6.1.2:compile
[INFO] |  +- org.springframework:spring-test:jar:6.1.2:test
[INFO] |  \- org.xmlunit:xmlunit-core:jar:2.9.1:test
[INFO] +- org.springframework.boot:spring-boot-starter-data-mongodb:jar:3.2.1:compile
[INFO] |  +- org.mongodb:mongodb-driver-sync:jar:4.11.1:compile
[INFO] |  \- org.springframework.data:spring-data-mongodb:jar:4.2.1:compile
[INFO] |     +- org.springframework:spring-tx:jar:6.1.2:compile
[INFO] |     +- org.springframework:spring-context:jar:6.1.2:compile
[INFO] |     |  \- org.springframework:spring-aop:jar:6.1.2:compile
[INFO] |     +- org.springframework:spring-expression:jar:6.1.2:compile
[INFO] |     \- org.springframework.data:spring-data-commons:jar:3.2.1:compile
[INFO] +- org.springframework.boot:spring-boot-starter-data-mongodb-reactive:jar:3.2.1:compile
[INFO] |  \- io.projectreactor:reactor-core:jar:3.6.1:compile
[INFO] +- org.mongodb:mongodb-driver-reactivestreams:jar:4.11.1:compile
[INFO] |  +- org.mongodb:bson:jar:4.11.1:compile
[INFO] |  +- org.mongodb:mongodb-driver-core:jar:4.11.1:compile
[INFO] |  |  \- org.mongodb:bson-record-codec:jar:4.11.1:runtime
[INFO] |  \- org.reactivestreams:reactive-streams:jar:1.0.4:compile
[INFO] +- org.apache.commons:commons-lang3:jar:3.13.0:compile
[INFO] +- de.codecentric:spring-boot-admin-starter-client:jar:3.1.8:compile
[INFO] |  \- de.codecentric:spring-boot-admin-client:jar:3.1.8:compile
[INFO] +- joda-time:joda-time:jar:2.12.5:compile
[INFO] +- io.micrometer:micrometer-registry-prometheus:jar:1.12.0:compile
[INFO] |  +- io.micrometer:micrometer-core:jar:1.12.1:compile
[INFO] |  |  +- org.hdrhistogram:HdrHistogram:jar:2.1.12:runtime
[INFO] |  |  \- org.latencyutils:LatencyUtils:jar:2.0.3:runtime
[INFO] |  \- io.prometheus:simpleclient_common:jar:0.16.0:compile
[INFO] |     \- io.prometheus:simpleclient:jar:0.16.0:compile
[INFO] |        +- io.prometheus:simpleclient_tracer_otel:jar:0.16.0:compile
[INFO] |        |  \- io.prometheus:simpleclient_tracer_common:jar:0.16.0:compile
[INFO] |        \- io.prometheus:simpleclient_tracer_otel_agent:jar:0.16.0:compile
[INFO] +- io.rest-assured:rest-assured:jar:5.3.1:compile
[INFO] |  +- org.apache.groovy:groovy:jar:4.0.16:compile
[INFO] |  +- org.apache.groovy:groovy-xml:jar:4.0.16:compile
[INFO] |  +- org.apache.httpcomponents:httpclient:jar:4.5.13:compile
[INFO] |  |  +- org.apache.httpcomponents:httpcore:jar:4.4.16:compile
[INFO] |  |  +- commons-logging:commons-logging:jar:1.2:compile
[INFO] |  |  \- commons-codec:commons-codec:jar:1.16.0:compile
[INFO] |  +- org.apache.httpcomponents:httpmime:jar:4.5.13:compile
[INFO] |  +- org.ccil.cowan.tagsoup:tagsoup:jar:1.2.1:compile
[INFO] |  +- io.rest-assured:json-path:jar:5.3.2:compile
[INFO] |  |  \- io.rest-assured:rest-assured-common:jar:5.3.2:compile
[INFO] |  \- io.rest-assured:xml-path:jar:5.3.2:compile
[INFO] +- org.codehaus.janino:janino:jar:3.1.11:compile
[INFO] |  \- org.codehaus.janino:commons-compiler:jar:3.1.11:compile
[INFO] +- com.sndyuk:logback-more-appenders:jar:1.8.8:compile
[INFO] +- io.jsonwebtoken:jjwt-api:jar:0.11.5:compile
[INFO] +- io.jsonwebtoken:jjwt-impl:jar:0.11.5:runtime
[INFO] +- io.jsonwebtoken:jjwt-jackson:jar:0.11.5:runtime
[INFO] |  \- com.fasterxml.jackson.core:jackson-databind:jar:2.15.3:compile
[INFO] |     +- com.fasterxml.jackson.core:jackson-annotations:jar:2.15.3:compile
[INFO] |     \- com.fasterxml.jackson.core:jackson-core:jar:2.15.3:compile
[INFO] +- junit:junit:jar:4.13.2:test
[INFO] |  \- org.hamcrest:hamcrest-core:jar:2.2:test
[INFO] +- io.projectreactor:reactor-test:jar:3.6.1:test
[INFO] +- de.flapdoodle.embed:de.flapdoodle.embed.mongo.spring3x:jar:4.12.0:test
[INFO] |  \- de.flapdoodle.embed:de.flapdoodle.embed.mongo:jar:4.12.0:test
[INFO] |     +- de.flapdoodle.embed:de.flapdoodle.embed.process:jar:4.10.1:test
[INFO] |     |  +- de.flapdoodle.reverse:de.flapdoodle.reverse:jar:1.7.2:test
[INFO] |     |  |  +- de.flapdoodle.graph:de.flapdoodle.graph:jar:1.3.3:test
[INFO] |     |  |  |  \- org.jgrapht:jgrapht-core:jar:1.4.0:test
[INFO] |     |  |  |     \- org.jheaps:jheaps:jar:0.11:test
[INFO] |     |  |  \- de.flapdoodle.java8:de.flapdoodle.java8:jar:1.4.2:test
[INFO] |     |  +- org.apache.commons:commons-compress:jar:1.25.0:test
[INFO] |     |  +- net.java.dev.jna:jna:jar:5.13.0:test
[INFO] |     |  +- net.java.dev.jna:jna-platform:jar:5.13.0:test
[INFO] |     |  \- de.flapdoodle:de.flapdoodle.os-api:jar:1.4.1:test
[INFO] |     \- de.flapdoodle.embed:de.flapdoodle.embed.mongo.packageresolver:jar:4.11.0:test
[INFO] |        \- de.flapdoodle:de.flapdoodle.os:jar:1.5.3:test
[INFO] +- org.springframework.cloud:spring-cloud-contract-verifier:jar:4.1.0:test
[INFO] |  +- org.springframework.cloud:spring-cloud-contract-spec:jar:4.1.0:test
[INFO] |  |  +- org.springframework.cloud:spring-cloud-contract-spec-java:jar:4.1.0:test
[INFO] |  |  |  \- dk.brics:automaton:jar:1.12-4:test
[INFO] |  |  \- org.springframework.cloud:spring-cloud-contract-spec-groovy:jar:4.1.0:test
[INFO] |  +- org.springframework.cloud:spring-cloud-contract-shade:jar:4.1.0:test
[INFO] |  +- org.apache.commons:commons-text:jar:1.11.0:test
[INFO] |  +- javax.inject:javax.inject:jar:1:test
[INFO] |  +- com.github.tomakehurst:wiremock-jre8-standalone:jar:2.35.1:test
[INFO] |  +- com.toomuchcoding.jsonassert:jsonassert:jar:0.7.0:test
[INFO] |  +- org.apache.maven.resolver:maven-resolver-api:jar:1.9.18:test
[INFO] |  +- com.rackspace.eclipse.webtools.sourceediting:org.eclipse.wst.xml.xpath2.processor:jar:2.1.100:test
[INFO] |  |  +- edu.princeton.cup:java-cup:jar:10k:test
[INFO] |  |  \- com.ibm.icu:icu4j:jar:4.6:test
[INFO] |  +- org.apache.groovy:groovy-nio:jar:4.0.16:test
[INFO] |  +- org.apache.groovy:groovy-json:jar:4.0.16:compile
[INFO] |  +- com.github.jknack:handlebars:jar:4.3.1:test
[INFO] |  +- commons-beanutils:commons-beanutils:jar:1.9.4:test
[INFO] |  |  \- commons-collections:commons-collections:jar:3.2.2:test
[INFO] |  +- org.yaml:snakeyaml:jar:2.2:compile
[INFO] |  +- com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:jar:2.15.3:test
[INFO] |  +- net.javacrumbs.json-unit:json-unit-assertj:jar:2.38.0:test
[INFO] |  |  +- net.javacrumbs.json-unit:json-unit-core:jar:2.38.0:test
[INFO] |  |  \- net.javacrumbs.json-unit:json-unit-json-path:jar:2.38.0:test
[INFO] |  \- org.junit.jupiter:junit-jupiter-api:jar:5.10.1:test
[INFO] |     +- org.opentest4j:opentest4j:jar:1.3.0:test
[INFO] |     +- org.junit.platform:junit-platform-commons:jar:1.10.1:test
[INFO] |     \- org.apiguardian:apiguardian-api:jar:1.1.2:test
[INFO] +- org.springframework.cloud:spring-cloud-starter-contract-stub-runner:jar:4.1.0:test
[INFO] |  +- org.springframework.cloud:spring-cloud-contract-stub-runner:jar:4.1.0:test
[INFO] |  |  +- org.springframework.cloud:spring-cloud-contract-converters:jar:4.1.0:test
[INFO] |  |  +- org.eclipse.jgit:org.eclipse.jgit:jar:6.6.1.202309021850-r:test
[INFO] |  |  |  \- com.googlecode.javaewah:JavaEWAH:jar:1.2.3:test
[INFO] |  |  +- org.eclipse.jgit:org.eclipse.jgit.ssh.jsch:jar:6.7.0.202309050840-r:test
[INFO] |  |  |  +- com.jcraft:jsch:jar:0.1.55:test
[INFO] |  |  |  \- com.jcraft:jzlib:jar:1.1.3:test
[INFO] |  |  +- com.jcraft:jsch.agentproxy.sshagent:jar:0.0.9:test
[INFO] |  |  |  \- com.jcraft:jsch.agentproxy.core:jar:0.0.9:test
[INFO] |  |  +- com.jcraft:jsch.agentproxy.jsch:jar:0.0.9:test
[INFO] |  |  \- com.jcraft:jsch.agentproxy.usocket-jna:jar:0.0.9:test
[INFO] |  +- org.springframework.cloud:spring-cloud-contract-wiremock:jar:4.1.0:test
[INFO] |  |  +- jakarta.servlet:jakarta.servlet-api:jar:6.0.0:test
[INFO] |  |  +- org.apache.httpcomponents.client5:httpclient5:jar:5.2.3:test
[INFO] |  |  |  +- org.apache.httpcomponents.core5:httpcore5:jar:5.2.4:test
[INFO] |  |  |  \- org.apache.httpcomponents.core5:httpcore5-h2:jar:5.2.4:test
[INFO] |  |  \- org.springframework.cloud:spring-cloud-test-support:jar:4.1.0:test
[INFO] |  |     +- org.apache.maven.resolver:maven-resolver-connector-basic:jar:1.9.16:test
[INFO] |  |     |  +- org.apache.maven.resolver:maven-resolver-spi:jar:1.9.16:test
[INFO] |  |     |  \- org.apache.maven.resolver:maven-resolver-util:jar:1.9.16:test
[INFO] |  |     +- org.apache.maven.resolver:maven-resolver-impl:jar:1.9.16:test
[INFO] |  |     |  \- org.apache.maven.resolver:maven-resolver-named-locks:jar:1.9.16:test
[INFO] |  |     +- org.apache.maven:maven-resolver-provider:jar:3.9.5:test
[INFO] |  |     |  +- org.apache.maven:maven-model:jar:3.9.5:test
[INFO] |  |     |  +- org.apache.maven:maven-model-builder:jar:3.9.5:test
[INFO] |  |     |  |  +- org.codehaus.plexus:plexus-interpolation:jar:1.26:test
[INFO] |  |     |  |  +- org.apache.maven:maven-artifact:jar:3.9.5:test
[INFO] |  |     |  |  \- org.apache.maven:maven-builder-support:jar:3.9.5:test
[INFO] |  |     |  \- org.apache.maven:maven-repository-metadata:jar:3.9.5:test
[INFO] |  |     \- org.apache.maven.resolver:maven-resolver-transport-http:jar:1.9.16:test
[INFO] |  \- org.sonatype.sisu:sisu-inject-plexus:jar:2.6.0:test
[INFO] |     +- org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:test
[INFO] |     +- org.codehaus.plexus:plexus-classworlds:jar:2.5.2:test
[INFO] |     +- org.codehaus.plexus:plexus-utils:jar:3.0.18:test
[INFO] |     +- org.sonatype.sisu:sisu-inject-bean:jar:2.6.0:test
[INFO] |     |  +- javax.enterprise:cdi-api:jar:1.0:test
[INFO] |     |  |  \- javax.annotation:jsr250-api:jar:1.0:test
[INFO] |     |  +- org.sonatype.sisu:sisu-guice:jar:no_aop:3.2.5:test
[INFO] |     |  |  \- com.google.guava:guava:jar:16.0.1:test
[INFO] |     |  \- org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.3.0:test
[INFO] |     \- org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.3.0:test
[INFO] +- org.ow2.asm:asm:jar:9.6:compile
[INFO] +- org.springframework.cloud:spring-cloud-starter-zipkin:jar:2.2.8.RELEASE:compile
[INFO] |  +- org.springframework.cloud:spring-cloud-starter-sleuth:jar:2.2.8.RELEASE:compile
[INFO] |  |  +- org.springframework.cloud:spring-cloud-starter:jar:4.1.0:compile
[INFO] |  |  |  +- org.springframework.cloud:spring-cloud-context:jar:4.1.0:compile
[INFO] |  |  |  \- org.springframework.security:spring-security-rsa:jar:1.1.1:compile
[INFO] |  |  |     \- org.bouncycastle:bcprov-jdk18on:jar:1.74:compile
[INFO] |  |  +- org.springframework.boot:spring-boot-starter-aop:jar:3.2.1:compile
[INFO] |  |  |  \- org.aspectj:aspectjweaver:jar:1.9.21:compile
[INFO] |  |  \- org.springframework.cloud:spring-cloud-sleuth-core:jar:2.2.8.RELEASE:compile
[INFO] |  |     +- org.aspectj:aspectjrt:jar:1.9.21:compile
[INFO] |  |     +- io.zipkin.brave:brave:jar:5.16.0:compile
[INFO] |  |     +- io.zipkin.brave:brave-context-slf4j:jar:5.16.0:compile
[INFO] |  |     +- io.zipkin.brave:brave-instrumentation-messaging:jar:5.16.0:compile
[INFO] |  |     +- io.zipkin.brave:brave-instrumentation-rpc:jar:5.16.0:compile
[INFO] |  |     +- io.zipkin.brave:brave-instrumentation-spring-web:jar:5.16.0:compile
[INFO] |  |     |  \- io.zipkin.brave:brave-instrumentation-http:jar:5.16.0:compile
[INFO] |  |     +- io.zipkin.brave:brave-instrumentation-spring-rabbit:jar:5.16.0:compile
[INFO] |  |     +- io.zipkin.brave:brave-instrumentation-kafka-clients:jar:5.16.0:compile
[INFO] |  |     +- io.zipkin.brave:brave-instrumentation-kafka-streams:jar:5.16.0:compile
[INFO] |  |     +- io.zipkin.brave:brave-instrumentation-httpclient:jar:5.16.0:compile
[INFO] |  |     +- io.zipkin.brave:brave-instrumentation-httpasyncclient:jar:5.16.0:compile
[INFO] |  |     +- io.zipkin.brave:brave-instrumentation-spring-webmvc:jar:5.16.0:compile
[INFO] |  |     |  \- io.zipkin.brave:brave-instrumentation-servlet:jar:5.16.0:compile
[INFO] |  |     +- io.zipkin.brave:brave-instrumentation-jms:jar:5.16.0:compile
[INFO] |  |     \- io.zipkin.reporter2:zipkin-reporter-metrics-micrometer:jar:2.16.3:compile
[INFO] |  \- org.springframework.cloud:spring-cloud-sleuth-zipkin:jar:2.2.8.RELEASE:compile
[INFO] |     +- org.springframework.cloud:spring-cloud-commons:jar:4.1.0:compile
[INFO] |     |  \- org.springframework.security:spring-security-crypto:jar:6.2.1:compile
[INFO] |     +- io.zipkin.zipkin2:zipkin:jar:2.23.2:compile
[INFO] |     +- io.zipkin.reporter2:zipkin-reporter:jar:2.16.3:compile
[INFO] |     +- io.zipkin.reporter2:zipkin-reporter-brave:jar:2.16.3:compile
[INFO] |     +- io.zipkin.reporter2:zipkin-sender-kafka:jar:2.16.3:compile
[INFO] |     +- io.zipkin.reporter2:zipkin-sender-activemq-client:jar:2.16.3:compile
[INFO] |     \- io.zipkin.reporter2:zipkin-sender-amqp-client:jar:2.16.3:compile
[INFO] \- org.springframework:spring-beans:jar:6.1.2:compile
[INFO] ---------------------------------------------------------
rohitkrishna-marneni commented 8 months ago

Were you guys able to figure this out?

davidmelia commented 7 months ago

I had to add the following groovy dep to fix this

                <plugin>
                    <groupId>org.springframework.cloud</groupId>
                    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
                    ....
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.groovy</groupId>
                            <artifactId>groovy</artifactId>
                            <version>4.0.19</version>
                        </dependency>
                    </dependencies>
                </plugin>   
                ...
marcingrzejszczak commented 6 months ago

@davidmelia is there a problem with the Groovy version we're bringing in by default?

namannigam commented 6 months ago

@davidmelia is there a problem with the Groovy version we're bringing in by default?

Even in the latest version spring-cloud-contract-verifier:4.1.2, yes, the groovy version 4.0.16 is brought in with spring-cloud-contract-parent, as seen here.

<dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.apache.groovy</groupId>
        <artifactId>groovy-bom</artifactId>
        <version>4.0.16</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
</dependencyManagement>
marcingrzejszczak commented 6 months ago

I've bumped the Groovy dep to the latest version. Hopefully that fixes any issues

jakub-bochenski commented 2 months ago

Any chance for a backport to 3.x branch?