Closed ChristianIvicevic closed 4 months ago
I have a supposition that the test's classpath.index
file might not be up to date, ie even if it's cleared after the test, the file might be older.
If I'm leaning towards this is because while trying to debug, I found the com.intellij.util.lang.PathClassLoader
that is used as a system classloader, which is difficult to debug (due to being a system classloader). But in reading the source file I found out that to load a class it first try to pick that class from classpath.index
, and if the answer is no then it leads the the NCDFE
.
Removing the classpath.index
file in the build test resources folder doesn't work as the one from the gradle cache is retrieved. However I can clearly see that after compileTestKotlin --rerun
the hash of the classpath.index
file is different and there's no CNFE
.
Also I think this is an issue with the gradle-intellij-plugin, hopefully fixed with v2.
Your observation also indicates this is like a problem of gradle-intellij-plugin
instead. @hsz Do you want me to move this issue over into that repo instead?
This fix could be related https://github.com/JetBrains/gradle-intellij-plugin/issues/1515
@hsz I think this one can be closed since 1.17.1
What happened?
I noticed that every time I create a new test class and attempt to run it, either via the gutter icon or the
Run Tests
task that I receive aClassNotFoundException
despite the class file being in the build folder as seen in the attached screenshot. My gut feeling is that something with the preconfigured caching behavior of Gradle might be wrong. The only way I can make Gradle recognize the new files is by restarting IntelliJ itself and triggering a full rebuild of the plugin. Any suggestion how to resolve this would be appreciated.Relevant log output or stack trace
Steps to reproduce
Scaffold a new plugin from the template, add a new test file and try to run it which causes the error.
Gradle IntelliJ Plugin version
1.16.1
Gradle version
8.5
Operating System
macOS
Link to build, i.e. failing GitHub Action job
No response