How to convert the plugin project to a jar which can be used as implicitly in intellij projects.

Answered

I wan to convert the intellij plugin based project which is of gradle and consists of plugin.xml to a jar and then use it as a plugin in intellij.I tried converting the jar as an output directory and placed the jar in plugins folder.Still I cannot see my implementation when I restart the intellij.

12 comments
Comment actions Permalink

Pallavi,

There is a Gradle task available that is handling the build process: https://github.com/JetBrains/gradle-intellij-plugin#tasks

0
Comment actions Permalink

I am sorry I still didn't get it. which task I need to add it in plugin.xml? and after the particular task do I just need to run the custom code written and where will be the location of the jar so that I can place it in plugins folder of intellij idea

0
Comment actions Permalink

As you've mentioned, you already have a Gradle-based plugin, right?

I'd suggest you review your configuration and follow our documentation related to the Building Plugins with Gradle.

0
Comment actions Permalink

Yes I already have a readymade gradle based plugin project and its run as runide task and it is running successfully too.. Now I just want this gradle based plugin project to be converted to a jar and then use that jar in plugins folder of Intellij idea.I wanted to know how to do this.

0
Comment actions Permalink

I've already mentioned that there is a task available to prepare the plugin artifact. Please check the link in my first post.

0
Comment actions Permalink

I have tried running jarSearchableOptions task for my plugin project which is to create a jar but I am getting  a error 

Process 'command 'C:\Program Files\Java\java-se-8u41-ri\bin\java.exe'' finished with non-zero exit value 1.. Any idea why is that?

0
Comment actions Permalink

Have you tried the buildPlugin task?

0
Comment actions Permalink

YEs and sadly below is the log.. How is the runide task completes successfully.. :(

 

16:01:00: Executing task 'buildPlugin'...

> Task :compileJava UP-TO-DATE
> Task :patchPluginXml UP-TO-DATE
> Task :processResources UP-TO-DATE
> Task :classes UP-TO-DATE
> Task :instrumentCode UP-TO-DATE
> Task :postInstrumentCode
> Task :jar UP-TO-DATE
> Task :prepareSandbox UP-TO-DATE

> Task :buildSearchableOptions
[gradle-intellij-plugin :ImportedTest:buildSearchableOptions] Cannot download JetBrains Java Runtime jbr-11_0_5-windows-i586-b520.38. Run with --debug option to get more log output.
[gradle-intellij-plugin :ImportedTest:buildSearchableOptions] Cannot resolve builtin JBR 11_0_5b520.38. Falling local Java.
[gradle-intellij-plugin :ImportedTest:buildSearchableOptions] Cannot download JetBrains Java Runtime jbr-11_0_5-windows-i586-b520.38. Run with --debug option to get more log output.
[gradle-intellij-plugin :ImportedTest:buildSearchableOptions] Cannot resolve builtin JBR 11_0_5b520.38. Falling local Java.
[gradle-intellij-plugin :ImportedTest:buildSearchableOptions] Cannot download JetBrains Java Runtime jbr-11_0_5-windows-i586-b520.38. Run with --debug option to get more log output.
[gradle-intellij-plugin :ImportedTest:buildSearchableOptions] Cannot resolve builtin JBR 11_0_5b520.38. Falling local Java.
Starting searchable options index builder
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x07a1fcf5, pid=28984, tid=27024
#
# JRE version: OpenJDK Runtime Environment (8.0_41-b04) (build 1.8.0_41-b04)
# Java VM: OpenJDK Client VM (25.40-b25 mixed mode windows-x86 )
# Problematic frame:
# V [jvm.dll+0xbfcf5]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Users\Pallavi.Pallavi\.gradle\caches\modules-2\files-2.1\com.jetbrains.intellij.idea\ideaIC\2019.3.3\4c54deba9ff34a615b3072cd2def3558ff462987\ideaIC-2019.3.3\bin\hs_err_pid28984.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
#
Picked up _JAVA_OPTIONS: -Xmx512M

> Task :buildSearchableOptions FAILED
8 actionable tasks: 2 executed, 6 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':buildSearchableOptions'.
> Process 'command 'C:\Program Files\Java\java-se-8u41-ri\bin\java.exe'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 10s
16:01:11: Task execution finished 'buildPlugin'.

0
Comment actions Permalink

Hi, I have the same error. It began to appear after updating Android Studio

0
Comment actions Permalink

Android Studio 3.6.2 (192.7142.36) Intellij IDEA 2019.3.4 (193.6911.18). Please help me!

 

0
Comment actions Permalink

Nikomp1986 : The issue was solved for me after I had installed JDK from oracle website and not the OpenJDK. 

SInce I needed Open JDK I was able to get the jar under libs folder by setting jar as enabled to true in gradle.properties file.Hence I got the jar required for plugin.xml file

0
Comment actions Permalink

Thanks for your reply. Disabling buildSearchableOptions in settings.gradle it helped me:

startParameter.excludedTaskNames.add('buildSearchableOptions')
0

Please sign in to leave a comment.