Skip to content

[2.8.0 2.9.0] Custom testIde throws java.lang.ClassNotFoundException for bundled plugin #2022

@zielu

Description

@zielu

What happened?

After upgrading to 2.8.0 custom testIde task started failing with java.lang.ClassNotFoundException for class from bundled plugin.
Same thing happens in 2.9.0.

Test_repro1.patch

Relevant log output or stack trace

git4idea/repo/GitRepositoryManager
java.lang.NoClassDefFoundError: git4idea/repo/GitRepositoryManager
	at org.jetbrains.plugins.template.MyItTest.test(MyItTest.kt:20)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at com.intellij.testFramework.junit5.impl.TestLoggerInterceptor.intercept$lambda$0(TestLoggerInterceptor.kt:12)
	at com.intellij.testFramework.TestLoggerKt.recordErrorsLoggedInTheCurrentThreadAndReportThemAsFailures(testLogger.kt:81)
	at com.intellij.testFramework.junit5.impl.TestLoggerInterceptor.intercept(TestLoggerInterceptor.kt:11)
	at com.intellij.testFramework.junit5.impl.AbstractInvocationInterceptor.interceptTestMethod(AbstractInvocationInterceptor.kt:29)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
Caused by: java.lang.ClassNotFoundException: git4idea.repo.GitRepositoryManager
	at com.intellij.util.lang.UrlClassLoader.findClass(UrlClassLoader.java:235)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:593)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
	... 8 more

Steps to reproduce

  1. Checkout main (02df6e80) from intellij-platform-plugin-template
  2. Apply attached patch
  3. Run integrationTests task
  4. Notice NoClassDefFound
  5. Downgrade to 2.7.2
  6. Run integrationTests task
  7. Notice test passing

Gradle IntelliJ Plugin version

2.8.0 2.9.0

Gradle version

8.14.3 9.0.0

Operating System

macOS

Link to build, i.e. failing GitHub Action job

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions