# V2 plugin modules in unit tests

**URL:** <https://platform.jetbrains.com/t/v2-plugin-modules-in-unit-tests/3834>\
**Category:** Gradle Build Scripts\
**Created:** [March 9, 2026, 10:36am UTC](https://platform.jetbrains.com/t/v2-plugin-modules-in-unit-tests/3834 "2026-03-09T10:36:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jansorg](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/jansorg/32/52_2.png) [@jansorg](https://platform.jetbrains.com/u/jansorg)\
**Post date:** [March 9, 2026, 10:36am UTC](https://platform.jetbrains.com/t/v2-plugin-modules-in-unit-tests/3834/1 "2026-03-09T10:36:46Z")

</div>

I tried to migrate a large plugin to a V2 plugin descriptor to support split-mode. This turned into a Gradle nightmare and I’m now stuck with unit tests.

The main build uses `pluginModule(project(":my-current-module"))` to put the v2 modules of subprojects into `lib/modules/...` of the plugin.zip. Executing `runIde` is working mostly.

In unit tests of a submodule I have a `src/test/resources/META-INF/plugin.xml` file declaring the basic content modules to provide a v2 descriptor to tests:

```auto
<idea-plugin>
    <id>dev.j-a.swift</id>

    <content>
        <!-- my.current.module.xml also declares dependencies, 
               e.g. on my.own.module.dependency -->
        <module name="my.current.module" loading="required"/>
        <module name="my.own.module.dependency" loading="required"/>
    </content>
</idea-plugin>

```

How can I tell the Gradle build to put the sub-project .jar files into the test sandbox at `lib/modules/my.own.module.dependency.jar` and so on?

Tests are failing because the modules are not loaded because of the missing modules and unresolved dependencies.

How could I fix this to allow me to run unit tests with a v2 descriptor?

Thanks!

| Tool | Version |
| --- | --- |
| Gradle | 9.3.1 |
| IntelliJ Platform Gradle Plugin | 2.11.0 |

---

<div class="post-metadata">

**Author:** ![yuriy.artamonov](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/yuriy.artamonov/32/48_2.png) [@yuriy.artamonov](https://platform.jetbrains.com/u/yuriy.artamonov)\
**Post date:** [March 9, 2026, 12:21pm UTC](https://platform.jetbrains.com/t/v2-plugin-modules-in-unit-tests/3834/2 "2026-03-09T12:21:48Z")

</div>

As far as I understand tests must run on flat classpath still for you. For integration tests we are going to recommend writing them in a bigger tests module and/or module with plugin.xml, having all modules of a plugin as `testImplementation` dependencies - so all parts are discovered from its tests class path.

---

<div class="post-metadata">

**Author:** ![jansorg](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/jansorg/32/52_2.png) [@jansorg](https://platform.jetbrains.com/u/jansorg)\
**Post date:** [March 9, 2026, 2:52pm UTC](https://platform.jetbrains.com/t/v2-plugin-modules-in-unit-tests/3834/3 "2026-03-09T14:52:08Z")

</div>

Thank you, that was helpful.  
I had dependency issues with the v2 descriptors and modules (basically mismatch of Gradle build dependencies vs. runtime dependencies).

The duplication of the main `plugin.xml` file into `my-submodule/src/test/resources/META-INF/plugin.xml` is problematic because it’ll easily be out-of-sync and `xi:include` is apparently unavailable with v2 descriptors.
