New sdk version 2.14.0 package problem

I’m working on an IntelliJ plugin named . intellij-jenkinsfile-pro

Previously, in the plugin distribution, all JAR files were placed at the same level inside lib/, and everything loaded correctly.

After a packaging/layout change, a modules directory appeared inside lib, for example:

distributions/
  intellij-jenkinsfile-pro/
    lib/
      modules/
      intellij-jenkinsfile-pro-1.4.1.jar
      sentry-6.15.0.jar

Since this change, the modules located under lib/modules are no longer being loaded correctly.

Expected behavior

Plugin modules should still be loaded correctly even if they are placed under lib/modules, or there should be clear documentation about the expected distribution layout so the plugin continues to work.

Actual behavior

JARs placed inside lib/modules are not detected or loaded at runtime, while previously everything worked when all JARs were directly under lib/.

Impact

This breaks part of the plugin/module loading process and causes functionality that used to work to stop working.

What changed

The only apparent change is the distribution structure:

  • before: all .jar files were directly under lib/

  • now: some .jar files are inside lib/modules/

Question

Is lib/modules a supported location for plugin JARs in IntelliJ Platform plugins?
If yes, are there any additional requirements for those modules to be loaded correctly?
If not, what is the correct expected structure for plugin distribution packaging?

Hey, Darwin! Can you please share a minimal reproducible project or at least your build file? Thanks!

Hello, I created this repository so you can validate the error:
https://github.com/dalgarins/sdk-intellij-error

The main branch is using SDK version 2.14.0, which is causing the issue. The steps to reproduce the error are:

  1. Clone the repository

  2. Run the “Run IDE with Plugin” task

  3. Create an empty Java project using Gradle (gradle.kts)

As soon as the project opens, you will see an error in the bottom-right corner of the IDE.

I also created another branch in the same repository called fix. The only change there is that it uses SDK version 2.13.1. If you follow the same reproduction steps, you will see that there is no error and everything works correctly. The issue occurs due to what I mentioned when I created this ticket.

Thank you.

@jakub.chrzanowski were you able to reproduce the issue?

@yuriy.artamonov and @jakub.chrzanowski have you checked this issue? with new sdk version.

@dalgarins Sorry, I’ve been busy with the upcoming release. Let me quickly explain how bundling now works in the 2.14.0+

This Gradle plugin provides you with a few plugins you can use in the project:

  • org.jetbrains.intellij.platform — the main plugin you apply to the (often) root module which has the plugin.xml file
  • org.jetbrains.intellij.platform.module — a module plugin you apply to submodules in your project, which hold XML files other than the root one
  • org.jetbrains.intellij.platform.base — a bare pugin that gives you access to the IntelliJ Platform dependencies and related helpers but with almost no extra tasks involved. You can use it to enhance a shared library with the access to the IntelliJ Platform.
  1. Now, if your submodule applies the org.jetbrains.intellij.platform.module, and in your root module you have

    dependencies {
      implementation(project(":submodule"))
    }
    

    it is treated as a regular module and the produced jar goes into lib/modules/.

    To do that in previous versions you had to

    dependencies {
      intellijPlatform {
        pluginModule(implementation(project(":submodule")))
      }
    }
    

    but we decided to introduce a shorthand here due to the upcoming module v2 support.

  2. Still, if you deal with a submodule with org.jetbrains.intellij.platform.module applied, you have an option to combine that submodule’s jar with the main jar. That’ll result in a single jar in your distribution archive:

    dependencies {
      intellijPlatform {
        pluginComposedModule(implementation(project(":submodule")))
      }
    }
    
  3. And now if you want to keep the submodule as a regular jar in lib/, go for org.jetbrains.intellij.platform.base and the simple implementation will keep the default behavior

    dependencies {
      implementation(project(":submodule"))
    }