How to get value from in intelliJ?


Want to get some values from in Intellij, such as the value of pluginName. The is as follow:

pluginName = a.b.c.d

I tried to use library method getProperty(), but it gets null value. Any answer will be very helpful. Thanks a lot. 

Comment actions Permalink


Please be more specific when describing issues. I assume you want to access your plugin name in running IDE instance with your plugin installed. Use com.intellij.ide.plugins.PluginManagerCore.getPlugin():

com.intellij.ide.plugins.PluginManagerCore.getPlugin(PluginId.getId("your plugin ID")).getName();

Also, your Gradle properties are used only during Gradle build tasks. Some of them are persisted in plugin.xml descriptor or in other places, but running IDE and plugin don't know anything about Gradle properties you built your project with.

Comment actions Permalink

Hi Karol,

Thank you for you answer. Yes, I want to access my plugin name when running my plugin. Your answer solved my question!


Please sign in to leave a comment.