I’m trying to perform certain actions after plugin is installed. I’m familiar with ActiveObjectsUpgradeTask, but since this action has nothing to do with database I’m looking for a more elegant solution. I found an article regarding PluginUpgradeTask, but it’s heavily outdated - when I try to use component element in atlassian-plugin.xml, I’m getting following error:
atlassian-plugin.xml contains a definition of component. This is not allowed when Atlassian-Plugin-Key is set.
Linked help document describes that I shouldn’t be using component element and use @Component annotation instead. This of course doesn’t work. I also found some posts about the need to add package export to pom.xml, so I did:
<Export-Package>
my.product.configuration.upgrade
</Export-Package>
I also added @ExportAsService(PluginUpgradeTask.class) and @Component annotations to my class.
This task doesn’t run, neither on fresh install nor update. How do I make PluginUpgradeTask work OR what should I use instead to perform actions right after my plugin is installed?