RoshFsk
RoshFsk

Reputation: 325

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.

Upvotes: 9

Views: 2174

Answers (1)

vikingsteve
vikingsteve

Reputation: 40418

Here you go mate:

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

Edit: from 2020, use

PluginManagerCore.getPlugin

Upvotes: 12

Related Questions