gradle dependencies
Answered
I created plugin with the following dependencies:
compile group: 'org.apache.httpcomponents', name: 'fluent-hc', version: '4.5.6'
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
compile group: 'joda-time', name: 'joda-time', version: '2.10'
compile group: 'com.google.guava', name: 'guava', version: '26.0-jre'
and it is working perfect.
Then I added more dependencies:
compile group: 'javax.validation', name: 'validation-api', version: '2.0.1.Final'
compile group: 'org.hibernate.validator', name: 'hibernate-validator', version: '6.0.13.Final'
compile group: 'javax.el', name: 'javax.el-api', version: '3.0.0'
compile group: 'org.glassfish', name: 'javax.el', version: '3.0.0'
and it is working perfect when I tested plugin with runIde task on local.
When I added jar file to IDEA I got exception: java.lang.NoClassDefFoundError: javax/validation/Validation
In both cases jar file does't contain any dependencies.
What did I miss?
Please sign in to leave a comment.
> When I added jar file to IDEA I got exception: java.lang.NoClassDefFoundError: javax/validation/Validation
gradle-intellij-plugin never creates jar. It generates zip with all dependencies in `build/distributions`.
6 years old question:
https://stackoverflow.com/questions/11492301/how-does-intellij-idea-manage-plugin-dependencies
Is it still valid? If so how I can put my dependencies in the plugin jar?
Update build.gradle
@Alexander Zolotov
Do I need to select zip instead of jar when Im uploading file via "install plugin from disk" in IDEA or when Im uploading file to jetbrains plugin repo?
Plugins folder in IDEA contains jar files only.
> Do I need to select zip instead of jar when Im uploading file via "install plugin from disk" in IDEA or when Im uploading file to jetbrains plugin repo?
yes
> Plugins folder in IDEA contains jar files only.
These plugins are unpacked zips
@Alexander Zolotov
It works.
Thanks