Open diana-deliu opened 6 months ago
If it may help:
It works if downgrading to gradle-6.8-all and using id "org.springframework.cloud.contract" version "2.2.4.RELEASE"
@shanman190 any ideas what can cause this? Gradle + windows ?
@marcingrzejszczak, I don't think that it's a Windows + Gradle sort of problem.
Here's the steps that I'd go through:
Where are the tests located? src/test/resources/contracts/
? src/contractTest/resources/contracts/
?
Verify the dependencies by their configuration (test=testCompileClasspath, contractTest=contractTestCompileClasspath) with gradlew dependencyInsight --configuration <configuration> --dependency spring-cloud-contract-spec-java
since it's failing to compile and the Contract
class comes from that jar (repeat for other classes locations).
If Gradle is showing the jars are resolving from a dependency standpoint, I'd go into the Gradle user home and verify it's contents of those jars by looking specifically for the classes that are failing to resolve inside of them.
Hello!
The issue I use spring cloud contract tests for a while now and they were working as expected. I've recently had to change my laptop (old one - Windows, this one Windows as well) and now the spring cloud contract tests are not generated anymore. We use Gradle as build tool.
What we've tried so far
generating them from the IDE as well as from PowerShell -> same error.
.\gradlew.bat :contract-tests:generateContractTests --debug --rerun-tasks
manually compiling contract providing the full classpath and JDK -> the compilation is successful.
javac -cp "C:\Users\diadeliu\.gradle\.tmp\gradle-javaexec-classpath3162018629030617727.jar;C:\Program Files\Java\jdk-11\lib\jrt-fs.jar" C:\Users\diadeliu\IdeaProjects\repo\contract-tests\build\stubs\META-INF\com.company\contract-tests\0.0.0\contracts\producer_name\consumer_name\SampleContract.java
providing gradle_home via environment variable or the folder path directly, in gradlew.bat and gradlew.sh files -> same error![image](https://github.com/spring-cloud/spring-cloud-contract/assets/5650030/bd993f93-3c03-40de-8f36-d7c26241c62a)
"-Dgradle.user.home=C:\Gradle"
or"-Dgradle.user.home=gradle_home"
where gradle_home islocally installing gradle version 8.6 and make IDE use it -> same error
I've had this issue before and it was because I have had a space in the path of my folder structure "Name Surname", but now that's not the case anymore, as per the provided path above.
Please keep in mind that the provided configuration works for almost all of my peers and it's been working for me as well for the last couple of years. We use:
The actual error
We've run out of ideas, so any help is much appreciated. Thanks in advance!