Issue raised by an app vendor in DEVHELP:
Reproducing is easy.
1. Install the latest Kantega SSO for Bitbucket on Bitbucket 6.6.1 using UPM.
2. Observe stack trace
Our addon fails to install on Bitbucket 6.6.1. It's a transformer-plugin. The exception is:
This works fine on Bitbucket 6.6.0.
In terms of AMPS config, we have no custom OSGi instructions so the MANIFEST.MF is completely generated during the transformer/install phase. In the transformered(tm) version under /bitbucket/home/plugins/.osgi-cache/transformed-plugins/, I find this, among other things, this:
Looks good. Works fine.
Now, when deploying on 6.6.1, then in MANIFEST.MF I similarly find a generated statement saying:
However, this time the package fails to resolve causing the missing requirement message/stack trace above.
Looking at the OSGi browser, the package version 6.6.1 is available and exported by the System bundle, so I don't know why it fails to resolve. It also has resolution optional, so could you advice on why this appears to be working on 6.6.0 and not 6.6.1? This is HIGHLY critical for us as customers on 6.6.1 are already affected and can no longer install the addon. We have yet to find a way around this. By extension, it also means we currently have no way forward on Bitbucket and I'm worried that whichever change triggered this will find its way into newer releases on the rest of the Atlassian portfolio sooner rather than later (I assume the transformer/UPM stuff is all mostly shared libraries).
I've tried adding an OSGi instruction making the package optional and with a wider version range (though I didn't expect either to work - we don't even use this package directly but I assume it's pulled in transitively by us including bitbucket-api and bitbucket-spi). Now, the Import-Package statement actually gets changed to mandatory in the transformed JAR. The version also gets mangled somehow with an asterisk added to the end (not sure if this is significant or not). In any case the resolution fails. Example:
This yields a transformed MANIFEST.MF containing:
Addon installs and finds package
org.osgi.framework.BundleException missing requirement
It may also be of interest to you that we had one customer reporting similar problems with some other plugins on 6.6.1 as well (I'm not familiar with any of them):
"Similar behavior is also occurring on MIBEX plugins:
Repository Dashboard for Bitbucket Server
Repository Templates for Bitbucket Server
Sonar for Bitbucket Server"
We ended up hastily rewriting the plugin base to spring-scanner-1 over the weekend. This seems to have worked around the problem so this is no longer an issue for us.
The last reproducible version would be Kantega SSO 3.6.3, just in case you want to look into it (3.6.5 onwards is now transformerless).