Plugin gradle dependencies not included in plugin artifact

Answered

Hi,

I am working on a tool integration plugin that calls some REST APIs to internal services. This requires some dependencies like org.json et.al. which I've declared in build.gradle:

plugins {
  id 'java'
  id 'org.jetbrains.intellij' version '1.3.1'
}
group 'my.company'
version '1.0.0-SNAPSHOT'
dependencies {
  implementation 'org.json:json:20211205'
  implementation 'io.socket:engine.io-client:2.0.0'
  implementation 'com.miglayout:miglayout-swing:11.0'
  testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
  testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
}
intellij {
  version = '2021.3.2'
}
patchPluginXml {
  version = project.version
  sinceBuild = '211'
  untilBuild = '213.*'
  changeNotes = """..."""
}
buildSearchableOptions {
  enabled = false
}

test {
  useJUnitPlatform()
}

This works great when running the runIde gralde task, but when I'm trying to test the plugin by installing it from disk, I only have the jar file with my classes in build\libs\ and when the plugin loads it's failing because of the missing dependencies.
I would like to be able to generate a zip file that includes the dependencies, but I've only found documentation on how to do that using DevKit, could someone help me understand how that works using gradle?
 
Regards,
Daniel F.
2 comments
Comment actions Permalink

Hi Daniel,

You check the wrong directory. Your plugin artifact is located in the "build/distributions" directory, where you should find the ZIP with all dependencies inside.

0
Comment actions Permalink

You are right - I have everything in build/distributions.

Thank you Karol!

0

Please sign in to leave a comment.