I would like to use
PluginLicenceManager inside a Bamboo task so that I can print out a please licence message rather then just having the plugin be disabled completely. Is this possible?
I’m using Bamboo 6.9.1 configured with Spring Scanner 2 and UPM
The task works fine on the server’s built-in agent but remote agents fail to load the plugin:
Caused by: org.osgi.framework.BundleException: Unresolved constraint in bundle com.declarativesystems.bamboo.puppetdeploy : Unable to resolve 38.0: missing requirement [38.0] osgi.wiring.package; (osgi.wiring.package=com.atlassian.upm.api.license)
Looking at some of the forum posts, I tried adding:
<Import-Package> com.atlassian.upm.*;resolution:="optional", </Import-Package>
All this does though is mark the bean as optional during scanning. When my task is instantiated I see the error:
bamboo java.lang.NoClassDefFoundError: com/atlassian/upm/api/license/PluginLicenseManager
Which makes me think
PluginLicenseManager.class file is simply not available on a remote agent.
What are other plugin authors doing to get around this? Does anyone have a way figured out to access plugin license status from a Task when running remotely? I’m almost certain that trying to force bundling of UPM inside my plugin by removing
<scope>provided</scope> is a bad idea ™, is anyone able to confirm this?