Skip to content

NoClassDefFoundError when project applies java-test-fixtures plugin #1073

@domesticsimian

Description

@domesticsimian

I have a gradle based multi-project build with 2 sub-projects. proj2is a simple library applies the java-test-fixtures plugin. proj1 depends on proj2. When I attempt to run any test in proj1 via the Run Test (or Debug Test) Code Lens link, I get a java.lang.NoClassDefFoundError for the library from proj2. Looking at the classpath from the Java Test Runner trace logs, I see that the proj2 path is not included at all (though /proj2/bin/default is, but that's not a real path on my system).

Some things to note:

  • In this minimal reproduction of my issue, proj2 doesn't actually have any test fixtures - it simply applies the plugin. In my real-world use case, we do have test fixtures but that's apparently unnecessary.
  • Normal language server usage seems to work - vscode knows about the classes, adds the import statement, performs autocompletion, etc.
  • Running tests from the command line via ./gradlew build works as expected.

Here is a minimal reproduction of the issue: vscode.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions