Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically get the version of an IntelliJ IDEA plugin

Is there a way to programmatically get the version of an IntelliJ IDEA plugin?

I'm creating my own IntelliJ IDEA plugin, and I have set the version property in the plugin.xml(e.g.:<version>3.1.1</version>). I need to get the version to display in the "About" dialog of my plugin. Is there a way to get this value programmatically?

I'm new to IntelliJ IDEA plugin development, if there is a different way to display a version number please let me know.

like image 878
RoshFsk Avatar asked Jan 22 '15 03:01

RoshFsk


People also ask

How do I check my IntelliJ plugins?

Press Ctrl+Alt+S to open the IDE settings and select Plugins.

Where do I find IntelliJ version?

In the top bar where File, Edit, View... Are written, go to the Help section. Click on Help section and in the drop-down click on About. That will show you the information regarding the Intellij Version you are using.

How do I search specific methods in IntelliJ?

Ctrl+Alt+Shift+N : finds a symbol. In IntelliJ IDEA, a symbol is any code element such as method, field, class, constant, and so on. Ctrl+Shift+A : finds an action by name. You can find any action even if it doesn't have a mapped shortcut or appear in the menu.


1 Answers

Here you go mate:

PluginManager.getPlugin(PluginId.getId("my.plugin.id")).getVersion();

Edit: from 2020, use

PluginManagerCore.getPlugin
like image 183
vikingsteve Avatar answered Oct 05 '22 06:10

vikingsteve